epoc32/include/app/cntfield.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Persistence layer exports
    15 // 
    16 //
    17 
    18 
    19 
    20 #if !defined(__CNTFIELD_H__)
    21 #define __CNTFIELD_H__
    22 
    23 #include <cntdef.h>
    24 
    25 
    26 
    27 /** Null field ID.
    28 @publishedAll
    29 @released
    30 */
    31 const TInt KNullFieldId=-1;
    32 
    33 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
    34 /** @internalComponent */
    35 const TInt KIntContactHintIsPhone=0x02;
    36 /** @internalComponent */
    37 const TInt KIntContactHintIsMsg=0x04;
    38 /** @internalComponent */
    39 const TInt KIntContactHintIsCompanyName=0x08;
    40 /** @internalComponent */
    41 const TInt KIntContactHintIsFamilyName=0x10;
    42 /** @internalComponent */
    43 const TInt KIntContactHintIsGivenName=0x20;
    44 /** @internalComponent */
    45 const TInt KIntContactHintIsAddress=0x40;
    46 /** @internalComponent */
    47 const TInt KIntContactHintIsAdditionalName=0x80;
    48 /** @internalComponent */
    49 const TInt KIntContactHintIsSuffixName=0x100;
    50 /** @internalComponent */
    51 const TInt KIntContactHintIsPrefixName=0x200;
    52 /** @internalComponent */
    53 const TInt KIntContactHintStorageInline=0x400;
    54 /** @internalComponent */
    55 const TInt KIntContactHintIsEmail=0x4000;
    56 /** @internalComponent */
    57 const TInt KIntContactHintIsPronunciation=0x800;
    58 /** @internalComponent */
    59 const TInt KIntContactHintIsCompanyNamePronunciation=KIntContactHintIsPronunciation|KIntContactHintIsCompanyName;
    60 /** @internalComponent */
    61 const TInt KIntContactHintIsGivenNamePronunciation=KIntContactHintIsPronunciation|KIntContactHintIsGivenName;
    62 /** @internalComponent */
    63 const TInt KIntContactHintIsFamilyNamePronunciation=KIntContactHintIsPronunciation|KIntContactHintIsFamilyName;
    64 
    65 /** @internalComponent */
    66 const TInt KHintTypeMask = 0x1FFFFF;
    67 
    68 #ifdef __SYMBIAN_CNTMODEL_USE_SQLITE__
    69 
    70 /** Number of additional type ids.
    71 @internalComponent 
    72 */
    73 const TInt KHintAdditionalMask    = 0x7F000000;
    74 /** Bit flag to show if there is a vCard mapping uid.
    75 @internalComponent 
    76 */
    77 const TInt KHintVCardMappingMask  = 0x80000000;
    78 /** Template field mask in low hint value.
    79 @internalComponent 
    80 */
    81 const TInt KHintTemplateFieldMask = 0x7FFFFFFF;
    82 
    83 /** @internalComponent */
    84 const TInt KHintAdditionalMaskShift = 24;
    85 
    86 #else //_SYMBIAN_USE_SQLITE__
    87 
    88 /** @internalComponent */
    89 const TInt KHintAdditionalMask = 0x200000;
    90 /** @internalComponent */
    91 const TInt KHintIdMask = 0xFFC00000;
    92 
    93 #endif //_SYMBIAN_USE_SQLITE__
    94 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
    95 
    96 class RWriteStream;
    97 class RReadStream;
    98 class CContactFieldStorage;
    99 class CContactTextField;
   100 class CContactStoreField;
   101 class CContactAgentField;
   102 class CContactDateField;
   103 class TFieldHeader;
   104 class CContactItemField;
   105 class CContactItemFieldDef;
   106 class CContactItemFieldSet;
   107 class CContactItem;
   108 
   109 class CContentType : public CBase
   110 /** The content type for a contact item field. 
   111 
   112 The content type identifies the field's type and the vCard property which 
   113 the field maps to. It is owned by the field. Field types are defined as UIDs 
   114 in cntdef.h.
   115 
   116 The vCard mapping is optional. It should be specified if the field type alone 
   117 is not enough to identify the mapping. The possible values for the vCard 
   118 mapping are defined as UIDs in cntdef.h.
   119 
   120 Each field is uniquely identified by the combination of UIDs contained in 
   121 the content type. 
   122 @publishedAll
   123 @released
   124 */
   125     {
   126 public:
   127     IMPORT_C ~CContentType();
   128 	IMPORT_C static CContentType* NewL();
   129 	IMPORT_C static CContentType* NewL(TFieldType aFieldType,TUid aMapping=KNullUid);
   130 	IMPORT_C static CContentType* NewL(const CContentType &aContentType);
   131 	static CContentType* NewLC(RReadStream& aStream);
   132 	IMPORT_C void SetMapping(TUid aMapping);
   133 	IMPORT_C void AddFieldTypeL(TFieldType aFieldType);
   134 	IMPORT_C void RemoveFieldType(TFieldType aFieldType);
   135     IMPORT_C TFieldType FieldType(TInt aIndex) const;
   136     IMPORT_C TInt FieldTypeCount() const;
   137     IMPORT_C TUid Mapping() const;
   138 	IMPORT_C TBool ContainsFieldType(TFieldType aFieldType) const;
   139 	IMPORT_C TBool SupportsMultipleLines() const;
   140 	IMPORT_C TBool operator==(const CContentType &aType) const;
   141 	IMPORT_C TBool IsEqualForSyncUpdate(const CContentType& aType) const;
   142 	IMPORT_C TBool IsEqual(const CContentType& aType) const;
   143 	void Reset(); 
   144 	void InternalizeAdditionalUidsL(TInt aCount,RReadStream& aStream);
   145 	void ExternalizeL(RWriteStream& aStream) const;
   146 	void InternalizeL(RReadStream& aStream);		
   147 private:
   148     CContentType();
   149 	CContentType(TUid aMapping);
   150 	void ConstructL();
   151 	void CloneL(const CContentType &aContentType);
   152 private:
   153     TUid iMapping;
   154 	CArrayFix<TUid>* iFieldTypes;
   155     };
   156 
   157 class CContactItemField : public CBase
   158 /** A field in a contact item.
   159 
   160 Fields are grouped into a field set (CContactItemFieldSet), which is owned by 
   161 the contact item.
   162 
   163 The contact item field stores the field data. The data may be text, a date/time 
   164 value, or an agent, as indicated by the storage type (TStorageType). The storage 
   165 type is also owned by the field. Note that numeric field data is not supported. 
   166 All numbers, for instance telephone or fax numbers are stored as text.
   167 
   168 Fields also have a content type, attributes and a label. The label is a string 
   169 which identifies the field to a user e.g. First name, Last name.
   170 
   171 The following attributes are supported: 
   172 
   173 - hidden: the field is not displayed if the view definition masks hidden 
   174 fields
   175 
   176 - disabled: the field cannot be deleted from the original template and thus 
   177 is marked as disabled
   178 
   179 - read only: the field cannot be written to
   180 
   181 - synchronise: used by Connectivity applications; set by default for all 
   182 contact item fields
   183 
   184 - user added: the field was added by the user and was not taken from the 
   185 template
   186 
   187 - template: indicates that the field is part of a template. Template fields 
   188 differ from other fields in that they are persisted when they do not contain 
   189 any data.
   190 
   191 - speed dial: the field contains a telephone number which maps to one of 
   192 the nine possible speed dial positions.
   193 
   194 These attributes can be set using member functions of this class, but they 
   195 are normally set automatically by other functions, for instance when 
   196 setting a speed dial field, CContactDatabase automatically sets the field's 
   197 speed dial attribute. 
   198 @publishedAll
   199 @released
   200 */
   201 	{
   202 private:
   203 	friend class TFieldHeader;
   204 	friend class CContactItemFieldSet;
   205 	friend class CContactDatabase;      
   206 	friend class CContactTables;
   207 	friend class RPplContactTable;
   208 	friend class CPackagerTests;
   209 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
   210     class THint;
   211 #else
   212 	class THint
   213 	/**
   214 	@internalComponent
   215 	@released
   216 	*/
   217 		{
   218 	public:
   219 		THint();
   220 		THint(TInt aValue);
   221 		TBool operator==(const THint& aHint) const;
   222 		TBool operator!=(const THint& aHint) const;
   223 		TInt  HintType() const;
   224 		inline void SetIsMatchAll();
   225 		inline void SetIsPhone();
   226 		inline void SetIsMsg();
   227 		inline void SetIsCompanyName();
   228 		inline void SetIsFamilyName();
   229 		inline void SetIsGivenName();
   230 		inline void SetIsCompanyNamePronunciation();
   231 		inline void SetIsFamilyNamePronunciation();
   232 		inline void SetIsGivenNamePronunciation();
   233 		inline void SetIsAddress();
   234 		inline void SetIsAdditionalName();
   235 		inline void SetIsSuffixName();
   236 		inline void SetIsPrefixName();
   237 		inline void SetStorageIsInline();
   238 		inline void SetIsEmail();
   239 		inline TBool IsMatchAll() const;
   240 		inline TBool IsDefault() const;
   241 		inline TBool IsPhone() const;
   242 		inline TBool IsMsg() const;
   243 		inline TBool IsCompanyName() const;
   244 		inline TBool IsFamilyName() const;
   245 		inline TBool IsGivenName() const;
   246 		inline TBool IsCompanyNamePronunciation() const;
   247 		inline TBool IsFamilyNamePronunciation() const;
   248 		inline TBool IsGivenNamePronunciation() const;
   249 		inline TBool IsAddress() const;
   250 		inline TBool IsAdditionalName() const;
   251 		inline TBool IsSuffixName() const;
   252 		inline TBool IsPrefixName() const;
   253 		inline TBool IsStorageInline() const;
   254 		inline TBool IsEmail() const;
   255 		inline TBool Contains(const THint& aHint) const;
   256 		
   257 #ifndef __SYMBIAN_CNTMODEL_USE_SQLITE__
   258 		inline void SetHasAdditionalUids();
   259 		TBool HasAdditionalUids() const;
   260 		
   261 		TInt FieldId() const;
   262 		void SetFieldId(TInt aId);
   263 		
   264 #else //__SYMBIAN_CNTMODEL_USE_SQLITE__
   265         TInt  TemplateFieldId() const;
   266         void  SetTemplateFieldId(TInt aTemplateFieldId);
   267         
   268         inline void SetHasVCardMappingUid();
   269         inline TBool HasVCardMappingUid() const;
   270         
   271         inline TInt  AdditionalUidsNum() const;
   272         inline void  SetAdditionalUidsNum(TInt aNumber);
   273 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__		
   274 	public:
   275 		TInt iHintValue;
   276 
   277 		};
   278 #endif
   279 		
   280 public:
   281 	IMPORT_C static CContactItemField* NewLC();
   282 	IMPORT_C static CContactItemField* NewL(TStorageType aType);
   283 	IMPORT_C static CContactItemField* NewLC(TStorageType aType);
   284 	IMPORT_C static CContactItemField* NewL(TStorageType aType, TFieldType aFieldType);
   285 	IMPORT_C static CContactItemField* NewLC(TStorageType aType, TFieldType aFieldType);
   286 	IMPORT_C static CContactItemField* NewL(const CContactItemField &aField);
   287 	IMPORT_C static CContactItemField* NewLC(const CContactItemField &aField);
   288 	IMPORT_C static CContactItemField* NewL(TStorageType aType, const CContentType &aContentType);
   289 	IMPORT_C static CContactItemField* NewLC(TStorageType aType, const CContentType &aContentType);
   290 	IMPORT_C ~CContactItemField();
   291 
   292 	IMPORT_C TStorageType StorageType() const;
   293 	IMPORT_C const CContentType &ContentType() const;
   294 	inline TBool IsHidden() const;
   295 	inline TBool IsReadOnly() const;
   296 	inline TBool IsDisabled() const;
   297 	inline TBool IsTemplate() const;
   298 	inline TBool IsPrivate() const;
   299 	inline TBool IsSpeedDial() const;
   300 	inline TBool DoSynchronize() const;
   301 	inline TBool OverRidesLabel() const;
   302 	inline TBool HasExtraStream() const;
   303 	inline TBool UsesTemplateTypes() const;
   304 	inline TBool LabelUnspecified() const;
   305 	inline TBool UserAddedField() const;
   306 	inline TBool IsCustomFilterable() const;
   307 	IMPORT_C void SetHintType(TInt aType);
   308 	IMPORT_C TPtrC Label() const;
   309 	IMPORT_C void ResetStore();
   310 	IMPORT_C CContactFieldStorage* Storage() const;
   311 	IMPORT_C CContactTextField * TextStorage() const;
   312 	IMPORT_C CContactStoreField * StoreStorage() const;
   313 	IMPORT_C CContactAgentField * AgentStorage() const;
   314 	IMPORT_C CContactDateField * DateTimeStorage() const;
   315 	IMPORT_C void AddFieldTypeL(TFieldType aFieldType);
   316 	IMPORT_C void RemoveFieldType(TFieldType aFieldType);
   317 	IMPORT_C void SetMapping(TUid aMapping);
   318 	IMPORT_C void SetHidden(TBool aHidden);
   319 	IMPORT_C void SetReadOnly(TBool aReadOnly);
   320 	IMPORT_C void SetSynchronize(TBool aSynchronize);
   321 	IMPORT_C void SetDisabled(TBool aDisabled);
   322 	IMPORT_C void SetLabelL(const TDesC& aLabel);
   323 	IMPORT_C void SetLabel(HBufC* aLabel);
   324 	IMPORT_C void SetUserAddedField(TBool aUserAddedField);
   325 	IMPORT_C void SetTemplateField(TBool aTemplateField);
   326 	IMPORT_C void SetPrivate(TBool aTemplateField);
   327 	IMPORT_C void SetSpeedDial(TBool aSpeedDialField);
   328 	IMPORT_C void SetId(TInt aId);
   329 	IMPORT_C TInt Id() const;
   330 	IMPORT_C TUint UserFlags() const;
   331 	IMPORT_C void SetUserFlags(TUint aFlags);
   332 	IMPORT_C static TBool IsValidLabel(const TDesC& aLabel,TInt& aInvalidPos);
   333 	IMPORT_C TBool IsTemplateLabelField() const;
   334 	IMPORT_C void GetFieldText(TDes &aText) const;
   335 	IMPORT_C void RestoreHeaderL(RReadStream& aStream, const CContactItemFieldSet *aSystemTemplateFields);
   336 	IMPORT_C TStreamId RestoreFieldTypesL(RReadStream &aRootStream, const CContactItemFieldSet *aSystemTemplateFields);
   337 	IMPORT_C void RestoreTextL(HBufC *aTextStream,TInt aTextFieldIndex);
   338 	IMPORT_C TBool RestoreIfMatchL(RReadStream& aStream,const CContactItemFieldDef *aFieldDef, const CContactItemFieldSet *aSystemTemplateFields,HBufC *aTextStream,TInt aTextIndex);
   339 
   340 public:
   341 	IMPORT_C void SetCustomFilterable(EContactFieldFlags aContactFilterType);
   342 	IMPORT_C void Reset();
   343 	void SetUsesTemplateTypes(TBool aUsesTemplateTypes);
   344 	void SetOverRidesLabel(TBool aValue);
   345 	TInt TemplateFieldId() const;
   346 	void SetDeleted(TBool aDeleted);
   347 	inline TBool IsDeleted() const;
   348 	void CopyStorageL(const CContactItemField &aField);
   349 	void UpdateFieldFlags(const CContactItemFieldSet& aTemplateFieldSet);
   350 	void PopulateStoreL(RStoreWriteStream& aRootStream, TInt aCount, CArrayFix<TFieldHeader>& aFieldHeaderArray) const;
   351 	void PrepareFieldAsTemplateL(CContactItemFieldSet& aSystemTemplateFieldSet);
   352 	IMPORT_C TBool HasCustomFilter(EContactFieldFlags& contactFieldFlag) const;
   353 	TBool RestoreIfMatchL(RReadStream& aStream,TFieldType aFieldType, const CContactItemFieldSet *aSystemTemplateFields,HBufC *aTextStream,TInt aTextIndex);
   354 	void ExternalizeL(RWriteStream& aStream) const;
   355 	void InternalizeL(RReadStream& aStream);		
   356 	
   357 protected:
   358 	void UsesTemplateData(TInt aTemplateFieldId);
   359 private:
   360 	void UsesTemplateLabel();
   361 	void SetLabelUnspecified(TBool aUnspecified);
   362 	const CContentType &TemplateContentType(const CContactItemFieldSet &aSystemTemplateFields) const;
   363 	TFieldHeader StoreL(RWriteStream& aTextStream,CStreamStore& aBlobStore,TInt aTextFieldIndex);
   364 	TStreamId StoreAdditionalUidsL(CStreamStore& aStore,TStreamId aId, CArrayFixFlat<TUid> *aAdditionalFields);
   365   	TStreamId StoreDataL(CStreamStore& aStore);
   366 
   367    	void RestoreL(CStreamStore& aStore,RReadStream& aStream);
   368     void RestoreDataL(CStreamStore& aStore,TStreamId aId);
   369 	
   370  	TStreamId RestoreHintL(CStreamStore& aStore,RReadStream& aStream);
   371 	TBool AddFieldToHint(TFieldType aFieldType, CContactItemField::THint &aHint) const;
   372 	void MapHintsToFieldTypesL(THint aHint);
   373 	CContactItemField();
   374 	CContactItemField(TStorageType aType);
   375 	void CloneL(const CContactItemField &aField);
   376 	void ConstructStorageL();
   377 private:
   378 	enum {EUserMaskShift=4};
   379 	enum // er5 hard coded enum most of which have been used but not documented ;o(
   380 		{
   381 		EHidden				=0x00000001,
   382 		EReadOnly			=0x00000002,
   383 		ESynchronize		=0x00000004,
   384 		EDisabled			=0x00000008,
   385 		/* 0x00000010,-> 0x00000080 are used for 
   386 			the user defined attribs / categories like work /
   387 			Personal / Other / None - used in er5 UI */
   388 		EUserMask			=0x000000F0,
   389 		ETemplateMask		=EUserMask|ESynchronize|EReadOnly|EHidden,
   390 		EOverRidesLabel		=0x00000100,
   391 		EUsesTemplateData	=0x00000200,
   392 		EUserAddedField		=0x00000400,
   393 		ETemplate			=0x00000800,
   394 		/* 0x00001000,-> 0x0000F000 are used for 
   395 			the storage type of the contact field */
   396 		ELabelUnspecified	=0x40000000,
   397 		EDeleted			=0x80000000
   398 		};
   399 	enum 
   400 		// new extended enum to allow cntmodel to have
   401 		// more attributes per field
   402 		{
   403 		EPrivate			=0x00000001,
   404 		ESpeedDial			=0x00000002,
   405 		EUserDefinedFilter	=0x00000004,
   406 		EUserDefinedFilter1 =0x00000008,
   407 		EUserDefinedFilter2	=0x00000010,
   408 		EUserDefinedFilter3	=0x00000020,
   409 		EUserDefinedFilter4	=0x00000040
   410 		};
   411 	
   412 private:
   413 	CContentType *iContentType;
   414 	TStorageType iStorageType;
   415 	HBufC* iLabel;
   416 	TInt iId;
   417 	TUint32 iAttributes;
   418 	TUint32 iExtendedAttributes;
   419 	CContactFieldStorage* iStorage;
   420 	TInt iTemplateFieldId;
   421 	};
   422 
   423 class CContactItemFieldDef : public CArrayFixFlat<TUid>
   424 /** A field definition. 
   425 
   426 This is an array of field types. Field definitions are used by 
   427 CContactDatabase to specify a subset of fields when searching.
   428 
   429 The CContactItemFieldDef class is derived from CArrayFixFlat<TUid> so all 
   430 relevant functions can be used, e.g. to add and remove elements. It adds no 
   431 functions other than a constructor. 
   432 @publishedAll
   433 @released
   434 */
   435 	{
   436 public:
   437 	inline CContactItemFieldDef() : CArrayFixFlat<TUid>(8) 
   438 	/** Constructs the CContactItemFieldDef object, with an array granularity of 8. */
   439 		{};
   440 	};
   441 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
   442 class TContactFieldAtts
   443 /**
   444 @internalComponent
   445 @released
   446 */
   447 	{
   448 public:
   449 	inline TContactFieldAtts() : iStorage(0)
   450 		{};
   451 
   452 	void SetAttribs(TUint32 aAttribs);
   453 	void SetExtendedAttribs(TUint32 aExtendedAttribs);
   454 	void SetType(TStorageType aType);
   455 	TUint32 Attribs() const;
   456 	TUint32 ExtendedAttribs() const;
   457 	TStorageType Type() const;
   458 	void InternalizeL(RReadStream& aStream);
   459 	void ExternalizeL(RWriteStream& aStream) const;
   460 
   461 #ifndef __SYMBIAN_CNTMODEL_USE_SQLITE__	
   462 	TInt Count() const;
   463 	void SetCount(TInt aCount);
   464 	TInt TemplateFieldId() const;
   465 	void SetTemplateFieldId(TInt aId);
   466 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
   467 
   468 		
   469 private:
   470 	TUint32 iStorage;
   471 	
   472 #ifndef __SYMBIAN_CNTMODEL_USE_SQLITE__	
   473 	TUint32 iExtendedAttribs;
   474 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
   475 	};
   476 
   477 
   478 class TFieldHeader
   479 /**
   480 @internalComponent
   481 @released
   482 */
   483 #ifdef __SYMBIAN_CNTMODEL_USE_SQLITE__
   484 
   485 	{
   486 public:
   487     TFieldHeader();
   488 	TFieldHeader(TContactFieldAtts aAtts, TUint32 aFieldUid, TStreamId aId);
   489 	
   490 	inline TContactFieldAtts FieldAtts() const;
   491 	inline void SetFieldAtts(TContactFieldAtts aAtts);
   492 	
   493 	inline TInt FieldId() const;
   494     inline void SetFieldId(TInt aId);
   495     
   496     inline TStreamId StreamId() const;
   497     inline void SetStreamId(TStreamId aId);
   498     
   499 private:
   500 	TContactFieldAtts iAtts;
   501     TInt      iFieldUid;
   502 	TStreamId iStreamId;
   503 	};
   504 
   505 #else //__SYMBIAN_CNTMODEL_USE_SQLITE__
   506 
   507 	{
   508 public:
   509 	inline TFieldHeader(TStreamId aId,TContactFieldAtts aAtts);
   510 	
   511 public:
   512 	TStreamId iStreamId;
   513 	TContactFieldAtts iAtts;
   514 	};
   515 
   516 inline TFieldHeader::TFieldHeader(TStreamId aId,TContactFieldAtts aAtts)
   517 	{ iStreamId=aId; iAtts=aAtts; }
   518 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
   519 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
   520 
   521 inline TBool CContactItemField::IsHidden() const
   522 /** Gets the value of the field's hidden attribute.
   523 
   524 @return ETrue if hidden attribute is set, EFalse if not set. */
   525     { return iAttributes&EHidden; }
   526 
   527 inline TBool CContactItemField::IsReadOnly() const
   528 /** Gets the value of the field's read only attribute.
   529 
   530 @return ETrue if read only attribute set, EFalse if not set. */
   531     { return iAttributes&EReadOnly; }
   532 
   533 inline TBool CContactItemField::IsDisabled() const
   534 /** Gets the value of the field's disabled attribute.
   535 
   536 @return ETrue if disabled attribute set, EFalse if not set. */
   537 	{ return iAttributes&EDisabled; }
   538 
   539 inline TBool CContactItemField::IsTemplate() const
   540 /** Tests whether the field is in a template, as set by SetTemplateField().
   541 
   542 @return ETrue if field is a template field. EFalse if not. */
   543 	{ return iAttributes&ETemplate; }
   544 
   545 inline TBool CContactItemField::IsPrivate() const
   546 /** Tests whether the field's private attribute is set.
   547 
   548 @return True if the field's private attribute is set, false if not. */
   549 	{ return iExtendedAttributes&EPrivate; }
   550 
   551 inline TBool CContactItemField::IsSpeedDial() const
   552 /** Tests whether the field is a speed dial field.
   553 
   554 @return True if the field is a speed dial field, false if not. */
   555 	{ return iExtendedAttributes&ESpeedDial; }
   556 
   557 inline TBool CContactItemField::DoSynchronize() const
   558 /** Gets the value of the field's synchronise attribute.
   559 
   560 @return ETrue if synchronise attribute is set, EFalse if not set. */
   561     { return iAttributes&ESynchronize; }
   562 
   563 inline TBool CContactItemField::IsDeleted() const
   564 /** Gets the value of the field's deleted  attribute.
   565 
   566 @return ETrue if the field is deleted, otherwise EFalse.                            */
   567 	{ return iAttributes&EDeleted; }
   568 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
   569 inline void CContactItemField::THint::SetIsPhone()
   570 	{iHintValue|=KIntContactHintIsPhone;}
   571 inline void CContactItemField::THint::SetIsMsg()
   572 	{iHintValue|=KIntContactHintIsMsg;}
   573 // turn off Pronunciation bit too?
   574 inline void CContactItemField::THint::SetIsCompanyName()
   575 	{iHintValue|=KIntContactHintIsCompanyName;}
   576 inline void CContactItemField::THint::SetIsFamilyName()
   577 	{iHintValue|=KIntContactHintIsFamilyName;}
   578 inline void CContactItemField::THint::SetIsGivenName()
   579 	{iHintValue|=KIntContactHintIsGivenName;}
   580 inline void CContactItemField::THint::SetIsCompanyNamePronunciation()
   581 	{iHintValue|=KIntContactHintIsCompanyName|KIntContactHintIsPronunciation;}
   582 inline void CContactItemField::THint::SetIsFamilyNamePronunciation()
   583 	{iHintValue|=KIntContactHintIsFamilyName|KIntContactHintIsPronunciation;}
   584 inline void CContactItemField::THint::SetIsGivenNamePronunciation()
   585 	{iHintValue|=KIntContactHintIsGivenName|KIntContactHintIsPronunciation;}
   586 inline void CContactItemField::THint::SetIsAddress()
   587 	{iHintValue|=KIntContactHintIsAddress;}
   588 inline void CContactItemField::THint::SetIsAdditionalName()
   589 	{iHintValue|=KIntContactHintIsAdditionalName;}
   590 inline void CContactItemField::THint::SetIsSuffixName()
   591 	{iHintValue|=KIntContactHintIsSuffixName;}
   592 inline void CContactItemField::THint::SetIsPrefixName()
   593 	{iHintValue|=KIntContactHintIsPrefixName;}
   594 inline void CContactItemField::THint::SetStorageIsInline()
   595 	{iHintValue|=KIntContactHintStorageInline;}
   596 inline void CContactItemField::THint::SetIsEmail()
   597 	{iHintValue|=KIntContactHintIsEmail;}
   598 inline TBool CContactItemField::THint::IsPhone() const
   599 	{return (iHintValue&KIntContactHintIsPhone);}
   600 inline TBool CContactItemField::THint::IsMsg() const
   601 	{return (iHintValue&KIntContactHintIsMsg);}
   602 inline TBool CContactItemField::THint::IsCompanyName() const
   603 	{return ((iHintValue&KIntContactHintIsCompanyNamePronunciation) == KIntContactHintIsCompanyName);}
   604 inline TBool CContactItemField::THint::IsFamilyName() const
   605 	{return ((iHintValue&KIntContactHintIsFamilyNamePronunciation)==KIntContactHintIsFamilyName);}
   606 inline TBool CContactItemField::THint::IsGivenName() const
   607 	{return ((iHintValue&KIntContactHintIsGivenNamePronunciation)==KIntContactHintIsGivenName);}
   608 inline TBool CContactItemField::THint::IsCompanyNamePronunciation() const
   609 	{return ((iHintValue&KIntContactHintIsCompanyNamePronunciation) == KIntContactHintIsCompanyNamePronunciation);}
   610 inline TBool CContactItemField::THint::IsFamilyNamePronunciation() const
   611 	{return ((iHintValue&KIntContactHintIsFamilyNamePronunciation)==KIntContactHintIsFamilyNamePronunciation);}
   612 inline TBool CContactItemField::THint::IsGivenNamePronunciation() const
   613 	{return ((iHintValue&KIntContactHintIsGivenNamePronunciation)==KIntContactHintIsGivenNamePronunciation);}
   614 inline TBool CContactItemField::THint::IsAddress() const
   615 	{return (iHintValue&KIntContactHintIsAddress);}
   616 inline TBool CContactItemField::THint::IsAdditionalName() const
   617 	{return (iHintValue&KIntContactHintIsAdditionalName);}
   618 inline TBool CContactItemField::THint::IsSuffixName() const
   619 	{return (iHintValue&KIntContactHintIsSuffixName);}
   620 inline TBool CContactItemField::THint::IsPrefixName() const
   621 	{return (iHintValue&KIntContactHintIsPrefixName);}
   622 inline TBool CContactItemField::THint::IsStorageInline() const
   623 	{return (iHintValue&KIntContactHintStorageInline);}
   624 inline TBool CContactItemField::THint::IsEmail() const
   625 	{return (iHintValue&KIntContactHintIsEmail);}
   626 	
   627 #ifndef __SYMBIAN_CNTMODEL_USE_SQLITE__	
   628 inline void CContactItemField::THint::SetHasAdditionalUids()
   629 	{iHintValue|=KHintAdditionalMask;}
   630 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__ 
   631 inline TBool CContactItemField::THint::Contains(const THint& aHint) const
   632 	{return (iHintValue&aHint.iHintValue);}
   633 #endif
   634 inline TBool CContactItemField::OverRidesLabel() const
   635 /** Tests whether the field's label (as set by SetLabel()) overrides the label 
   636 specified in the field's template.
   637 
   638 @return True if the field's label overrides the label specified in the template; 
   639 false if not. */
   640 	{return iAttributes&EOverRidesLabel;}
   641 
   642 inline TBool CContactItemField::HasExtraStream() const
   643 /** Tests whether the field needs an extra stream to store information not contained 
   644 in the template. This is the case if the field's content type is not based 
   645 on a template, or if the field has a label which overrides the label specified 
   646 in the template.
   647 
   648 @return True if the field uses an extra stream; false if not. */
   649 	{return(!(iAttributes&EUsesTemplateData) || iAttributes&EOverRidesLabel);}
   650 
   651 inline TBool CContactItemField::UsesTemplateTypes() const
   652 /** Tests whether or not the field's content type is based on a template.
   653 
   654 @return True if the field's content type is based on a template; false if not. */
   655 	{return iAttributes&EUsesTemplateData;}
   656 
   657 inline TBool CContactItemField::LabelUnspecified() const
   658 /** Tests whether the field's label has been set, either by a call to SetLabel() 
   659 or by inheriting a label specified in the template.
   660 
   661 @return True if the field's label has been set, false if not. */
   662 	{return iAttributes&ELabelUnspecified;}
   663 
   664 inline TBool CContactItemField::UserAddedField() const
   665 /** Gets the value of the user added field attribute.
   666 
   667 @return ETrue if the user added attribute is set, EFalse if not. */
   668 	{return iAttributes&EUserAddedField;}
   669 
   670 inline TBool CContactItemField::IsCustomFilterable() const
   671 /** Tests the value of the user defined filter attribute.
   672 
   673 @return ETrue if the user defined filter attribute is set, EFalse if not. */
   674 	{
   675 	return (iExtendedAttributes&EUserDefinedFilter || iExtendedAttributes&EUserDefinedFilter1 ||
   676 	       iExtendedAttributes&EUserDefinedFilter2 || iExtendedAttributes&EUserDefinedFilter3 
   677 	       || iExtendedAttributes&EUserDefinedFilter4);
   678 	}
   679 	
   680 #endif