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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Persistence layer exports
20 #if !defined(__CNTFIELD_H__)
21 #define __CNTFIELD_H__
31 const TInt KNullFieldId=-1;
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;
65 /** @internalComponent */
66 const TInt KHintTypeMask = 0x1FFFFF;
68 #ifdef __SYMBIAN_CNTMODEL_USE_SQLITE__
70 /** Number of additional type ids.
73 const TInt KHintAdditionalMask = 0x7F000000;
74 /** Bit flag to show if there is a vCard mapping uid.
77 const TInt KHintVCardMappingMask = 0x80000000;
78 /** Template field mask in low hint value.
81 const TInt KHintTemplateFieldMask = 0x7FFFFFFF;
83 /** @internalComponent */
84 const TInt KHintAdditionalMaskShift = 24;
86 #else //_SYMBIAN_USE_SQLITE__
88 /** @internalComponent */
89 const TInt KHintAdditionalMask = 0x200000;
90 /** @internalComponent */
91 const TInt KHintIdMask = 0xFFC00000;
93 #endif //_SYMBIAN_USE_SQLITE__
94 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
98 class CContactFieldStorage;
99 class CContactTextField;
100 class CContactStoreField;
101 class CContactAgentField;
102 class CContactDateField;
104 class CContactItemField;
105 class CContactItemFieldDef;
106 class CContactItemFieldSet;
109 class CContentType : public CBase
110 /** The content type for a contact item field.
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
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.
120 Each field is uniquely identified by the combination of UIDs contained in
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;
144 void InternalizeAdditionalUidsL(TInt aCount,RReadStream& aStream);
145 void ExternalizeL(RWriteStream& aStream) const;
146 void InternalizeL(RReadStream& aStream);
149 CContentType(TUid aMapping);
151 void CloneL(const CContentType &aContentType);
154 CArrayFix<TUid>* iFieldTypes;
157 class CContactItemField : public CBase
158 /** A field in a contact item.
160 Fields are grouped into a field set (CContactItemFieldSet), which is owned by
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.
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.
171 The following attributes are supported:
173 - hidden: the field is not displayed if the view definition masks hidden
176 - disabled: the field cannot be deleted from the original template and thus
177 is marked as disabled
179 - read only: the field cannot be written to
181 - synchronise: used by Connectivity applications; set by default for all
184 - user added: the field was added by the user and was not taken from the
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
191 - speed dial: the field contains a telephone number which maps to one of
192 the nine possible speed dial positions.
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.
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
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;
257 #ifndef __SYMBIAN_CNTMODEL_USE_SQLITE__
258 inline void SetHasAdditionalUids();
259 TBool HasAdditionalUids() const;
261 TInt FieldId() const;
262 void SetFieldId(TInt aId);
264 #else //__SYMBIAN_CNTMODEL_USE_SQLITE__
265 TInt TemplateFieldId() const;
266 void SetTemplateFieldId(TInt aTemplateFieldId);
268 inline void SetHasVCardMappingUid();
269 inline TBool HasVCardMappingUid() const;
271 inline TInt AdditionalUidsNum() const;
272 inline void SetAdditionalUidsNum(TInt aNumber);
273 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
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();
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);
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);
358 void UsesTemplateData(TInt aTemplateFieldId);
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);
367 void RestoreL(CStreamStore& aStore,RReadStream& aStream);
368 void RestoreDataL(CStreamStore& aStore,TStreamId aId);
370 TStreamId RestoreHintL(CStreamStore& aStore,RReadStream& aStream);
371 TBool AddFieldToHint(TFieldType aFieldType, CContactItemField::THint &aHint) const;
372 void MapHintsToFieldTypesL(THint aHint);
374 CContactItemField(TStorageType aType);
375 void CloneL(const CContactItemField &aField);
376 void ConstructStorageL();
378 enum {EUserMaskShift=4};
379 enum // er5 hard coded enum most of which have been used but not documented ;o(
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,
400 // new extended enum to allow cntmodel to have
401 // more attributes per field
403 EPrivate =0x00000001,
404 ESpeedDial =0x00000002,
405 EUserDefinedFilter =0x00000004,
406 EUserDefinedFilter1 =0x00000008,
407 EUserDefinedFilter2 =0x00000010,
408 EUserDefinedFilter3 =0x00000020,
409 EUserDefinedFilter4 =0x00000040
413 CContentType *iContentType;
414 TStorageType iStorageType;
418 TUint32 iExtendedAttributes;
419 CContactFieldStorage* iStorage;
420 TInt iTemplateFieldId;
423 class CContactItemFieldDef : public CArrayFixFlat<TUid>
424 /** A field definition.
426 This is an array of field types. Field definitions are used by
427 CContactDatabase to specify a subset of fields when searching.
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.
437 inline CContactItemFieldDef() : CArrayFixFlat<TUid>(8)
438 /** Constructs the CContactItemFieldDef object, with an array granularity of 8. */
441 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
442 class TContactFieldAtts
449 inline TContactFieldAtts() : iStorage(0)
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;
461 #ifndef __SYMBIAN_CNTMODEL_USE_SQLITE__
463 void SetCount(TInt aCount);
464 TInt TemplateFieldId() const;
465 void SetTemplateFieldId(TInt aId);
466 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
472 #ifndef __SYMBIAN_CNTMODEL_USE_SQLITE__
473 TUint32 iExtendedAttribs;
474 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
483 #ifdef __SYMBIAN_CNTMODEL_USE_SQLITE__
488 TFieldHeader(TContactFieldAtts aAtts, TUint32 aFieldUid, TStreamId aId);
490 inline TContactFieldAtts FieldAtts() const;
491 inline void SetFieldAtts(TContactFieldAtts aAtts);
493 inline TInt FieldId() const;
494 inline void SetFieldId(TInt aId);
496 inline TStreamId StreamId() const;
497 inline void SetStreamId(TStreamId aId);
500 TContactFieldAtts iAtts;
505 #else //__SYMBIAN_CNTMODEL_USE_SQLITE__
509 inline TFieldHeader(TStreamId aId,TContactFieldAtts aAtts);
513 TContactFieldAtts iAtts;
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
521 inline TBool CContactItemField::IsHidden() const
522 /** Gets the value of the field's hidden attribute.
524 @return ETrue if hidden attribute is set, EFalse if not set. */
525 { return iAttributes&EHidden; }
527 inline TBool CContactItemField::IsReadOnly() const
528 /** Gets the value of the field's read only attribute.
530 @return ETrue if read only attribute set, EFalse if not set. */
531 { return iAttributes&EReadOnly; }
533 inline TBool CContactItemField::IsDisabled() const
534 /** Gets the value of the field's disabled attribute.
536 @return ETrue if disabled attribute set, EFalse if not set. */
537 { return iAttributes&EDisabled; }
539 inline TBool CContactItemField::IsTemplate() const
540 /** Tests whether the field is in a template, as set by SetTemplateField().
542 @return ETrue if field is a template field. EFalse if not. */
543 { return iAttributes&ETemplate; }
545 inline TBool CContactItemField::IsPrivate() const
546 /** Tests whether the field's private attribute is set.
548 @return True if the field's private attribute is set, false if not. */
549 { return iExtendedAttributes&EPrivate; }
551 inline TBool CContactItemField::IsSpeedDial() const
552 /** Tests whether the field is a speed dial field.
554 @return True if the field is a speed dial field, false if not. */
555 { return iExtendedAttributes&ESpeedDial; }
557 inline TBool CContactItemField::DoSynchronize() const
558 /** Gets the value of the field's synchronise attribute.
560 @return ETrue if synchronise attribute is set, EFalse if not set. */
561 { return iAttributes&ESynchronize; }
563 inline TBool CContactItemField::IsDeleted() const
564 /** Gets the value of the field's deleted attribute.
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);}
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);}
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.
638 @return True if the field's label overrides the label specified in the template;
640 {return iAttributes&EOverRidesLabel;}
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
648 @return True if the field uses an extra stream; false if not. */
649 {return(!(iAttributes&EUsesTemplateData) || iAttributes&EOverRidesLabel);}
651 inline TBool CContactItemField::UsesTemplateTypes() const
652 /** Tests whether or not the field's content type is based on a template.
654 @return True if the field's content type is based on a template; false if not. */
655 {return iAttributes&EUsesTemplateData;}
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.
661 @return True if the field's label has been set, false if not. */
662 {return iAttributes&ELabelUnspecified;}
664 inline TBool CContactItemField::UserAddedField() const
665 /** Gets the value of the user added field attribute.
667 @return ETrue if the user added attribute is set, EFalse if not. */
668 {return iAttributes&EUserAddedField;}
670 inline TBool CContactItemField::IsCustomFilterable() const
671 /** Tests the value of the user defined filter attribute.
673 @return ETrue if the user defined filter attribute is set, EFalse if not. */
675 return (iExtendedAttributes&EUserDefinedFilter || iExtendedAttributes&EUserDefinedFilter1 ||
676 iExtendedAttributes&EUserDefinedFilter2 || iExtendedAttributes&EUserDefinedFilter3
677 || iExtendedAttributes&EUserDefinedFilter4);