1.1 --- a/epoc32/include/cntfield.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,642 +0,0 @@
1.4 -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -// Persistence layer exports
1.18 -//
1.19 -//
1.20 -
1.21 -
1.22 -
1.23 -#if !defined(__CNTFIELD_H__)
1.24 -#define __CNTFIELD_H__
1.25 -
1.26 -#include <cntdef.h>
1.27 -
1.28 -
1.29 -
1.30 -const TInt KNullFieldId=-1;
1.31 -
1.32 -//const TInt KIntContactFieldHint???=0x01;
1.33 -const TInt KIntContactHintIsPhone=0x02;
1.34 -const TInt KIntContactHintIsMsg=0x04;
1.35 -const TInt KIntContactHintIsCompanyName=0x08;
1.36 -const TInt KIntContactHintIsFamilyName=0x10;
1.37 -const TInt KIntContactHintIsGivenName=0x20;
1.38 -const TInt KIntContactHintIsAddress=0x40;
1.39 -const TInt KIntContactHintIsAdditionalName=0x80;
1.40 -const TInt KIntContactHintIsSuffixName=0x100;
1.41 -const TInt KIntContactHintIsPrefixName=0x200;
1.42 -const TInt KIntContactHintStorageInline=0x400;
1.43 -const TInt KIntContactHintIsEmail=0x4000;
1.44 -const TInt KIntContactHintIsPronunciation=0x800;
1.45 -const TInt KIntContactHintIsCompanyNamePronunciation=KIntContactHintIsPronunciation|KIntContactHintIsCompanyName;
1.46 -const TInt KIntContactHintIsGivenNamePronunciation=KIntContactHintIsPronunciation|KIntContactHintIsGivenName;
1.47 -const TInt KIntContactHintIsFamilyNamePronunciation=KIntContactHintIsPronunciation|KIntContactHintIsFamilyName;
1.48 -
1.49 -const TInt KHintTypeMask = 0x1FFFFF;
1.50 -
1.51 -#ifdef __SYMBIAN_CNTMODEL_USE_SQLITE__
1.52 -const TInt KHintAdditionalMask = 0x7F000000; //Number of additional type ids.
1.53 -const TInt KHintVCardMappingMask = 0x80000000; //bit flag to show if there is a vCard mapping uid.
1.54 -const TInt KHintTemplateFieldMask = 0x7FFFFFFF; //Template field mask in low hint value.
1.55 -
1.56 -const TInt KHintAdditionalMaskShift = 24;
1.57 -
1.58 -#else //_SYMBIAN_USE_SQLITE__
1.59 -
1.60 -const TInt KHintAdditionalMask = 0x200000;
1.61 -const TInt KHintIdMask = 0xFFC00000;
1.62 -
1.63 -#endif //_SYMBIAN_USE_SQLITE__
1.64 -
1.65 -
1.66 -class RWriteStream;
1.67 -class RReadStream;
1.68 -class CContactFieldStorage;
1.69 -class CContactTextField;
1.70 -class CContactStoreField;
1.71 -class CContactAgentField;
1.72 -class CContactDateField;
1.73 -class TFieldHeader;
1.74 -class CContactItemField;
1.75 -class CContactItemFieldDef;
1.76 -class CContactItemFieldSet;
1.77 -class CContactItem;
1.78 -
1.79 -class CContentType : public CBase
1.80 -/** The content type for a contact item field.
1.81 -
1.82 -The content type identifies the field's type and the vCard property which
1.83 -the field maps to. It is owned by the field. Field types are defined as UIDs
1.84 -in cntdef.h.
1.85 -
1.86 -The vCard mapping is optional. It should be specified if the field type alone
1.87 -is not enough to identify the mapping. The possible values for the vCard
1.88 -mapping are defined as UIDs in cntdef.h.
1.89 -
1.90 -Each field is uniquely identified by the combination of UIDs contained in
1.91 -the content type.
1.92 -@publishedAll
1.93 -@released
1.94 -*/
1.95 - {
1.96 -public:
1.97 - IMPORT_C ~CContentType();
1.98 - IMPORT_C static CContentType* NewL();
1.99 - IMPORT_C static CContentType* NewL(TFieldType aFieldType,TUid aMapping=KNullUid);
1.100 - IMPORT_C static CContentType* NewL(const CContentType &aContentType);
1.101 - static CContentType* NewLC(RReadStream& aStream);
1.102 - IMPORT_C void SetMapping(TUid aMapping);
1.103 - IMPORT_C void AddFieldTypeL(TFieldType aFieldType);
1.104 - IMPORT_C void RemoveFieldType(TFieldType aFieldType);
1.105 - IMPORT_C TFieldType FieldType(TInt aIndex) const;
1.106 - IMPORT_C TInt FieldTypeCount() const;
1.107 - IMPORT_C TUid Mapping() const;
1.108 - IMPORT_C TBool ContainsFieldType(TFieldType aFieldType) const;
1.109 - IMPORT_C TBool SupportsMultipleLines() const;
1.110 - IMPORT_C TBool operator==(const CContentType &aType) const;
1.111 - IMPORT_C TBool IsEqualForSyncUpdate(const CContentType& aType) const;
1.112 - IMPORT_C TBool IsEqual(const CContentType& aType) const;
1.113 - void Reset();
1.114 - void InternalizeAdditionalUidsL(TInt aCount,RReadStream& aStream);
1.115 - void ExternalizeL(RWriteStream& aStream) const;
1.116 - void InternalizeL(RReadStream& aStream);
1.117 -private:
1.118 - CContentType();
1.119 - CContentType(TUid aMapping);
1.120 - void ConstructL();
1.121 - void CloneL(const CContentType &aContentType);
1.122 -private:
1.123 - TUid iMapping;
1.124 - CArrayFix<TUid>* iFieldTypes;
1.125 - };
1.126 -
1.127 -class CContactItemField : public CBase
1.128 -/** A field in a contact item.
1.129 -
1.130 -Fields are grouped into a field set (CContactItemFieldSet), which is owned by
1.131 -the contact item.
1.132 -
1.133 -The contact item field stores the field data. The data may be text, a date/time
1.134 -value, or an agent, as indicated by the storage type (TStorageType). The storage
1.135 -type is also owned by the field. Note that numeric field data is not supported.
1.136 -All numbers, for instance telephone or fax numbers are stored as text.
1.137 -
1.138 -Fields also have a content type, attributes and a label. The label is a string
1.139 -which identifies the field to a user e.g. First name, Last name.
1.140 -
1.141 -The following attributes are supported:
1.142 -
1.143 -- hidden: the field is not displayed if the view definition masks hidden
1.144 -fields
1.145 -
1.146 -- disabled: the field cannot be deleted from the original template and thus
1.147 -is marked as disabled
1.148 -
1.149 -- read only: the field cannot be written to
1.150 -
1.151 -- synchronise: used by Connectivity applications; set by default for all
1.152 -contact item fields
1.153 -
1.154 -- user added: the field was added by the user and was not taken from the
1.155 -template
1.156 -
1.157 -- template: indicates that the field is part of a template. Template fields
1.158 -differ from other fields in that they are persisted when they do not contain
1.159 -any data.
1.160 -
1.161 -- speed dial: the field contains a telephone number which maps to one of
1.162 -the nine possible speed dial positions.
1.163 -
1.164 -These attributes can be set using member functions of this class, but they
1.165 -are normally set automatically by other functions, for instance when
1.166 -setting a speed dial field, CContactDatabase automatically sets the field's
1.167 -speed dial attribute.
1.168 -@publishedAll
1.169 -@released
1.170 -*/
1.171 - {
1.172 -private:
1.173 - friend class TFieldHeader;
1.174 - friend class CContactItemFieldSet;
1.175 - friend class CContactDatabase;
1.176 - friend class CContactTables;
1.177 - friend class RPplContactTable;
1.178 - friend class CPackagerTests;
1.179 - class THint
1.180 - /**
1.181 - @internalComponent
1.182 - @released
1.183 - */
1.184 - {
1.185 - public:
1.186 - THint();
1.187 - THint(TInt aValue);
1.188 - TBool operator==(const THint& aHint) const;
1.189 - TBool operator!=(const THint& aHint) const;
1.190 - TInt HintType() const;
1.191 - inline void SetIsMatchAll();
1.192 - inline void SetIsPhone();
1.193 - inline void SetIsMsg();
1.194 - inline void SetIsCompanyName();
1.195 - inline void SetIsFamilyName();
1.196 - inline void SetIsGivenName();
1.197 - inline void SetIsCompanyNamePronunciation();
1.198 - inline void SetIsFamilyNamePronunciation();
1.199 - inline void SetIsGivenNamePronunciation();
1.200 - inline void SetIsAddress();
1.201 - inline void SetIsAdditionalName();
1.202 - inline void SetIsSuffixName();
1.203 - inline void SetIsPrefixName();
1.204 - inline void SetStorageIsInline();
1.205 - inline void SetIsEmail();
1.206 - inline TBool IsMatchAll() const;
1.207 - inline TBool IsDefault() const;
1.208 - inline TBool IsPhone() const;
1.209 - inline TBool IsMsg() const;
1.210 - inline TBool IsCompanyName() const;
1.211 - inline TBool IsFamilyName() const;
1.212 - inline TBool IsGivenName() const;
1.213 - inline TBool IsCompanyNamePronunciation() const;
1.214 - inline TBool IsFamilyNamePronunciation() const;
1.215 - inline TBool IsGivenNamePronunciation() const;
1.216 - inline TBool IsAddress() const;
1.217 - inline TBool IsAdditionalName() const;
1.218 - inline TBool IsSuffixName() const;
1.219 - inline TBool IsPrefixName() const;
1.220 - inline TBool IsStorageInline() const;
1.221 - inline TBool IsEmail() const;
1.222 - inline TBool Contains(const THint& aHint) const;
1.223 -
1.224 -#ifndef __SYMBIAN_CNTMODEL_USE_SQLITE__
1.225 - inline void SetHasAdditionalUids();
1.226 - TBool HasAdditionalUids() const;
1.227 -
1.228 - TInt FieldId() const;
1.229 - void SetFieldId(TInt aId);
1.230 -
1.231 -#else //__SYMBIAN_CNTMODEL_USE_SQLITE__
1.232 - TInt TemplateFieldId() const;
1.233 - void SetTemplateFieldId(TInt aTemplateFieldId);
1.234 -
1.235 - inline void SetHasVCardMappingUid();
1.236 - inline TBool HasVCardMappingUid() const;
1.237 -
1.238 - inline TInt AdditionalUidsNum() const;
1.239 - inline void SetAdditionalUidsNum(TInt aNumber);
1.240 -#endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
1.241 - public:
1.242 - TInt iHintValue;
1.243 -
1.244 - };
1.245 -
1.246 -public:
1.247 - IMPORT_C static CContactItemField* NewLC();
1.248 - IMPORT_C static CContactItemField* NewL(TStorageType aType);
1.249 - IMPORT_C static CContactItemField* NewLC(TStorageType aType);
1.250 - IMPORT_C static CContactItemField* NewL(TStorageType aType, TFieldType aFieldType);
1.251 - IMPORT_C static CContactItemField* NewLC(TStorageType aType, TFieldType aFieldType);
1.252 - IMPORT_C static CContactItemField* NewL(const CContactItemField &aField);
1.253 - IMPORT_C static CContactItemField* NewLC(const CContactItemField &aField);
1.254 - IMPORT_C static CContactItemField* NewL(TStorageType aType, const CContentType &aContentType);
1.255 - IMPORT_C static CContactItemField* NewLC(TStorageType aType, const CContentType &aContentType);
1.256 - IMPORT_C ~CContactItemField();
1.257 -
1.258 - IMPORT_C TStorageType StorageType() const;
1.259 - IMPORT_C const CContentType &ContentType() const;
1.260 - inline TBool IsHidden() const;
1.261 - inline TBool IsReadOnly() const;
1.262 - inline TBool IsDisabled() const;
1.263 - inline TBool IsTemplate() const;
1.264 - inline TBool IsPrivate() const;
1.265 - inline TBool IsSpeedDial() const;
1.266 - inline TBool DoSynchronize() const;
1.267 - inline TBool OverRidesLabel() const;
1.268 - inline TBool HasExtraStream() const;
1.269 - inline TBool UsesTemplateTypes() const;
1.270 - inline TBool LabelUnspecified() const;
1.271 - inline TBool UserAddedField() const;
1.272 - inline TBool IsCustomFilterable() const;
1.273 - IMPORT_C void SetHintType(TInt aType);
1.274 - IMPORT_C TPtrC Label() const;
1.275 - IMPORT_C void ResetStore();
1.276 - IMPORT_C CContactFieldStorage* Storage() const;
1.277 - IMPORT_C CContactTextField * TextStorage() const;
1.278 - IMPORT_C CContactStoreField * StoreStorage() const;
1.279 - IMPORT_C CContactAgentField * AgentStorage() const;
1.280 - IMPORT_C CContactDateField * DateTimeStorage() const;
1.281 - IMPORT_C void AddFieldTypeL(TFieldType aFieldType);
1.282 - IMPORT_C void RemoveFieldType(TFieldType aFieldType);
1.283 - IMPORT_C void SetMapping(TUid aMapping);
1.284 - IMPORT_C void SetHidden(TBool aHidden);
1.285 - IMPORT_C void SetReadOnly(TBool aReadOnly);
1.286 - IMPORT_C void SetSynchronize(TBool aSynchronize);
1.287 - IMPORT_C void SetDisabled(TBool aDisabled);
1.288 - IMPORT_C void SetLabelL(const TDesC& aLabel);
1.289 - IMPORT_C void SetLabel(HBufC* aLabel);
1.290 - IMPORT_C void SetUserAddedField(TBool aUserAddedField);
1.291 - IMPORT_C void SetTemplateField(TBool aTemplateField);
1.292 - IMPORT_C void SetPrivate(TBool aTemplateField);
1.293 - IMPORT_C void SetSpeedDial(TBool aSpeedDialField);
1.294 - IMPORT_C void SetId(TInt aId);
1.295 - IMPORT_C TInt Id() const;
1.296 - IMPORT_C TUint UserFlags() const;
1.297 - IMPORT_C void SetUserFlags(TUint aFlags);
1.298 - IMPORT_C static TBool IsValidLabel(const TDesC& aLabel,TInt& aInvalidPos);
1.299 - IMPORT_C TBool IsTemplateLabelField() const;
1.300 - IMPORT_C void GetFieldText(TDes &aText) const;
1.301 - IMPORT_C void RestoreHeaderL(RReadStream& aStream, const CContactItemFieldSet *aSystemTemplateFields);
1.302 - IMPORT_C TStreamId RestoreFieldTypesL(RReadStream &aRootStream, const CContactItemFieldSet *aSystemTemplateFields);
1.303 - IMPORT_C void RestoreTextL(HBufC *aTextStream,TInt aTextFieldIndex);
1.304 - IMPORT_C TBool RestoreIfMatchL(RReadStream& aStream,const CContactItemFieldDef *aFieldDef, const CContactItemFieldSet *aSystemTemplateFields,HBufC *aTextStream,TInt aTextIndex);
1.305 -
1.306 -public:
1.307 - IMPORT_C void SetCustomFilterable(EContactFieldFlags aContactFilterType);
1.308 - IMPORT_C void Reset();
1.309 - void SetUsesTemplateTypes(TBool aUsesTemplateTypes);
1.310 - void SetOverRidesLabel(TBool aValue);
1.311 - TInt TemplateFieldId() const;
1.312 - void SetDeleted(TBool aDeleted);
1.313 - inline TBool IsDeleted() const;
1.314 - void CopyStorageL(const CContactItemField &aField);
1.315 - void UpdateFieldFlags(const CContactItemFieldSet& aTemplateFieldSet);
1.316 - void PopulateStoreL(RStoreWriteStream& aRootStream, TInt aCount, CArrayFix<TFieldHeader>& aFieldHeaderArray) const;
1.317 - void PrepareFieldAsTemplateL(CContactItemFieldSet& aSystemTemplateFieldSet);
1.318 - IMPORT_C TBool HasCustomFilter(EContactFieldFlags& contactFieldFlag) const;
1.319 - TBool RestoreIfMatchL(RReadStream& aStream,TFieldType aFieldType, const CContactItemFieldSet *aSystemTemplateFields,HBufC *aTextStream,TInt aTextIndex);
1.320 - void ExternalizeL(RWriteStream& aStream) const;
1.321 - void InternalizeL(RReadStream& aStream);
1.322 -
1.323 -protected:
1.324 - void UsesTemplateData(TInt aTemplateFieldId);
1.325 -private:
1.326 - void UsesTemplateLabel();
1.327 - void SetLabelUnspecified(TBool aUnspecified);
1.328 - const CContentType &TemplateContentType(const CContactItemFieldSet &aSystemTemplateFields) const;
1.329 - TFieldHeader StoreL(RWriteStream& aTextStream,CStreamStore& aBlobStore,TInt aTextFieldIndex);
1.330 - TStreamId StoreAdditionalUidsL(CStreamStore& aStore,TStreamId aId, CArrayFixFlat<TUid> *aAdditionalFields);
1.331 - TStreamId StoreDataL(CStreamStore& aStore);
1.332 -
1.333 - void RestoreL(CStreamStore& aStore,RReadStream& aStream);
1.334 - void RestoreDataL(CStreamStore& aStore,TStreamId aId);
1.335 -
1.336 - TStreamId RestoreHintL(CStreamStore& aStore,RReadStream& aStream);
1.337 - TBool AddFieldToHint(TFieldType aFieldType, CContactItemField::THint &aHint) const;
1.338 - void MapHintsToFieldTypesL(THint aHint);
1.339 - CContactItemField();
1.340 - CContactItemField(TStorageType aType);
1.341 - void CloneL(const CContactItemField &aField);
1.342 - void ConstructStorageL();
1.343 -private:
1.344 - enum {EUserMaskShift=4};
1.345 - enum // er5 hard coded enum most of which have been used but not documented ;o(
1.346 - {
1.347 - EHidden =0x00000001,
1.348 - EReadOnly =0x00000002,
1.349 - ESynchronize =0x00000004,
1.350 - EDisabled =0x00000008,
1.351 - /* 0x00000010,-> 0x00000080 are used for
1.352 - the user defined attribs / categories like work /
1.353 - Personal / Other / None - used in er5 UI */
1.354 - EUserMask =0x000000F0,
1.355 - ETemplateMask =EUserMask|ESynchronize|EReadOnly|EHidden,
1.356 - EOverRidesLabel =0x00000100,
1.357 - EUsesTemplateData =0x00000200,
1.358 - EUserAddedField =0x00000400,
1.359 - ETemplate =0x00000800,
1.360 - /* 0x00001000,-> 0x0000F000 are used for
1.361 - the storage type of the contact field */
1.362 - ELabelUnspecified =0x40000000,
1.363 - EDeleted =0x80000000
1.364 - };
1.365 - enum
1.366 - // new extended enum to allow cntmodel to have
1.367 - // more attributes per field
1.368 - {
1.369 - EPrivate =0x00000001,
1.370 - ESpeedDial =0x00000002,
1.371 - EUserDefinedFilter =0x00000004,
1.372 - EUserDefinedFilter1 =0x00000008,
1.373 - EUserDefinedFilter2 =0x00000010,
1.374 - EUserDefinedFilter3 =0x00000020,
1.375 - EUserDefinedFilter4 =0x00000040
1.376 - };
1.377 -
1.378 -private:
1.379 - CContentType *iContentType;
1.380 - TStorageType iStorageType;
1.381 - HBufC* iLabel;
1.382 - TInt iId;
1.383 - TUint32 iAttributes;
1.384 - TUint32 iExtendedAttributes;
1.385 - CContactFieldStorage* iStorage;
1.386 - TInt iTemplateFieldId;
1.387 - };
1.388 -
1.389 -class CContactItemFieldDef : public CArrayFixFlat<TUid>
1.390 -/** A field definition.
1.391 -
1.392 -This is an array of field types. Field definitions are used by
1.393 -CContactDatabase to specify a subset of fields when searching.
1.394 -
1.395 -The CContactItemFieldDef class is derived from CArrayFixFlat<TUid> so all
1.396 -relevant functions can be used, e.g. to add and remove elements. It adds no
1.397 -functions other than a constructor.
1.398 -@publishedAll
1.399 -@released
1.400 -*/
1.401 - {
1.402 -public:
1.403 - inline CContactItemFieldDef() : CArrayFixFlat<TUid>(8)
1.404 - /** Constructs the CContactItemFieldDef object, with an array granularity of 8. */
1.405 - {};
1.406 - };
1.407 -
1.408 -class TContactFieldAtts
1.409 -/**
1.410 -@internalComponent
1.411 -@released
1.412 -*/
1.413 - {
1.414 -public:
1.415 - inline TContactFieldAtts() : iStorage(0)
1.416 - {};
1.417 -
1.418 - void SetAttribs(TUint32 aAttribs);
1.419 - void SetExtendedAttribs(TUint32 aExtendedAttribs);
1.420 - void SetType(TStorageType aType);
1.421 - TUint32 Attribs() const;
1.422 - TUint32 ExtendedAttribs() const;
1.423 - TStorageType Type() const;
1.424 - void InternalizeL(RReadStream& aStream);
1.425 - void ExternalizeL(RWriteStream& aStream) const;
1.426 -
1.427 -#ifndef __SYMBIAN_CNTMODEL_USE_SQLITE__
1.428 - TInt Count() const;
1.429 - void SetCount(TInt aCount);
1.430 - TInt TemplateFieldId() const;
1.431 - void SetTemplateFieldId(TInt aId);
1.432 -#endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
1.433 -
1.434 -
1.435 -private:
1.436 - TUint32 iStorage;
1.437 -
1.438 -#ifndef __SYMBIAN_CNTMODEL_USE_SQLITE__
1.439 - TUint32 iExtendedAttribs;
1.440 -#endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
1.441 - };
1.442 -
1.443 -
1.444 -class TFieldHeader
1.445 -/**
1.446 -@internalComponent
1.447 -@released
1.448 -*/
1.449 -#ifdef __SYMBIAN_CNTMODEL_USE_SQLITE__
1.450 -
1.451 - {
1.452 -public:
1.453 - TFieldHeader();
1.454 - TFieldHeader(TContactFieldAtts aAtts, TUint32 aFieldUid, TStreamId aId);
1.455 -
1.456 - inline TContactFieldAtts FieldAtts() const;
1.457 - inline void SetFieldAtts(TContactFieldAtts aAtts);
1.458 -
1.459 - inline TInt FieldId() const;
1.460 - inline void SetFieldId(TInt aId);
1.461 -
1.462 - inline TStreamId StreamId() const;
1.463 - inline void SetStreamId(TStreamId aId);
1.464 -
1.465 -private:
1.466 - TContactFieldAtts iAtts;
1.467 - TInt iFieldUid;
1.468 - TStreamId iStreamId;
1.469 - };
1.470 -
1.471 -#else //__SYMBIAN_CNTMODEL_USE_SQLITE__
1.472 -
1.473 - {
1.474 -public:
1.475 - inline TFieldHeader(TStreamId aId,TContactFieldAtts aAtts);
1.476 -
1.477 -public:
1.478 - TStreamId iStreamId;
1.479 - TContactFieldAtts iAtts;
1.480 - };
1.481 -
1.482 -inline TFieldHeader::TFieldHeader(TStreamId aId,TContactFieldAtts aAtts)
1.483 - { iStreamId=aId; iAtts=aAtts; }
1.484 -#endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
1.485 -
1.486 -inline TBool CContactItemField::IsHidden() const
1.487 -/** Gets the value of the field's hidden attribute.
1.488 -
1.489 -@return ETrue if hidden attribute is set, EFalse if not set. */
1.490 - { return iAttributes&EHidden; }
1.491 -
1.492 -inline TBool CContactItemField::IsReadOnly() const
1.493 -/** Gets the value of the field's read only attribute.
1.494 -
1.495 -@return ETrue if read only attribute set, EFalse if not set. */
1.496 - { return iAttributes&EReadOnly; }
1.497 -
1.498 -inline TBool CContactItemField::IsDisabled() const
1.499 -/** Gets the value of the field's disabled attribute.
1.500 -
1.501 -@return ETrue if disabled attribute set, EFalse if not set. */
1.502 - { return iAttributes&EDisabled; }
1.503 -
1.504 -inline TBool CContactItemField::IsTemplate() const
1.505 -/** Tests whether the field is in a template, as set by SetTemplateField().
1.506 -
1.507 -@return ETrue if field is a template field. EFalse if not. */
1.508 - { return iAttributes&ETemplate; }
1.509 -
1.510 -inline TBool CContactItemField::IsPrivate() const
1.511 -/** Tests whether the field's private attribute is set.
1.512 -
1.513 -@return True if the field's private attribute is set, false if not. */
1.514 - { return iExtendedAttributes&EPrivate; }
1.515 -
1.516 -inline TBool CContactItemField::IsSpeedDial() const
1.517 -/** Tests whether the field is a speed dial field.
1.518 -
1.519 -@return True if the field is a speed dial field, false if not. */
1.520 - { return iExtendedAttributes&ESpeedDial; }
1.521 -
1.522 -inline TBool CContactItemField::DoSynchronize() const
1.523 -/** Gets the value of the field's synchronise attribute.
1.524 -
1.525 -@return ETrue if synchronise attribute is set, EFalse if not set. */
1.526 - { return iAttributes&ESynchronize; }
1.527 -
1.528 -inline TBool CContactItemField::IsDeleted() const
1.529 -/** Gets the value of the field's deleted attribute.
1.530 -
1.531 -@return ETrue if the field is deleted, otherwise EFalse. */
1.532 - { return iAttributes&EDeleted; }
1.533 -
1.534 -inline void CContactItemField::THint::SetIsPhone()
1.535 - {iHintValue|=KIntContactHintIsPhone;}
1.536 -inline void CContactItemField::THint::SetIsMsg()
1.537 - {iHintValue|=KIntContactHintIsMsg;}
1.538 -// turn off Pronunciation bit too?
1.539 -inline void CContactItemField::THint::SetIsCompanyName()
1.540 - {iHintValue|=KIntContactHintIsCompanyName;}
1.541 -inline void CContactItemField::THint::SetIsFamilyName()
1.542 - {iHintValue|=KIntContactHintIsFamilyName;}
1.543 -inline void CContactItemField::THint::SetIsGivenName()
1.544 - {iHintValue|=KIntContactHintIsGivenName;}
1.545 -inline void CContactItemField::THint::SetIsCompanyNamePronunciation()
1.546 - {iHintValue|=KIntContactHintIsCompanyName|KIntContactHintIsPronunciation;}
1.547 -inline void CContactItemField::THint::SetIsFamilyNamePronunciation()
1.548 - {iHintValue|=KIntContactHintIsFamilyName|KIntContactHintIsPronunciation;}
1.549 -inline void CContactItemField::THint::SetIsGivenNamePronunciation()
1.550 - {iHintValue|=KIntContactHintIsGivenName|KIntContactHintIsPronunciation;}
1.551 -inline void CContactItemField::THint::SetIsAddress()
1.552 - {iHintValue|=KIntContactHintIsAddress;}
1.553 -inline void CContactItemField::THint::SetIsAdditionalName()
1.554 - {iHintValue|=KIntContactHintIsAdditionalName;}
1.555 -inline void CContactItemField::THint::SetIsSuffixName()
1.556 - {iHintValue|=KIntContactHintIsSuffixName;}
1.557 -inline void CContactItemField::THint::SetIsPrefixName()
1.558 - {iHintValue|=KIntContactHintIsPrefixName;}
1.559 -inline void CContactItemField::THint::SetStorageIsInline()
1.560 - {iHintValue|=KIntContactHintStorageInline;}
1.561 -inline void CContactItemField::THint::SetIsEmail()
1.562 - {iHintValue|=KIntContactHintIsEmail;}
1.563 -inline TBool CContactItemField::THint::IsPhone() const
1.564 - {return (iHintValue&KIntContactHintIsPhone);}
1.565 -inline TBool CContactItemField::THint::IsMsg() const
1.566 - {return (iHintValue&KIntContactHintIsMsg);}
1.567 -inline TBool CContactItemField::THint::IsCompanyName() const
1.568 - {return ((iHintValue&KIntContactHintIsCompanyNamePronunciation) == KIntContactHintIsCompanyName);}
1.569 -inline TBool CContactItemField::THint::IsFamilyName() const
1.570 - {return ((iHintValue&KIntContactHintIsFamilyNamePronunciation)==KIntContactHintIsFamilyName);}
1.571 -inline TBool CContactItemField::THint::IsGivenName() const
1.572 - {return ((iHintValue&KIntContactHintIsGivenNamePronunciation)==KIntContactHintIsGivenName);}
1.573 -inline TBool CContactItemField::THint::IsCompanyNamePronunciation() const
1.574 - {return ((iHintValue&KIntContactHintIsCompanyNamePronunciation) == KIntContactHintIsCompanyNamePronunciation);}
1.575 -inline TBool CContactItemField::THint::IsFamilyNamePronunciation() const
1.576 - {return ((iHintValue&KIntContactHintIsFamilyNamePronunciation)==KIntContactHintIsFamilyNamePronunciation);}
1.577 -inline TBool CContactItemField::THint::IsGivenNamePronunciation() const
1.578 - {return ((iHintValue&KIntContactHintIsGivenNamePronunciation)==KIntContactHintIsGivenNamePronunciation);}
1.579 -inline TBool CContactItemField::THint::IsAddress() const
1.580 - {return (iHintValue&KIntContactHintIsAddress);}
1.581 -inline TBool CContactItemField::THint::IsAdditionalName() const
1.582 - {return (iHintValue&KIntContactHintIsAdditionalName);}
1.583 -inline TBool CContactItemField::THint::IsSuffixName() const
1.584 - {return (iHintValue&KIntContactHintIsSuffixName);}
1.585 -inline TBool CContactItemField::THint::IsPrefixName() const
1.586 - {return (iHintValue&KIntContactHintIsPrefixName);}
1.587 -inline TBool CContactItemField::THint::IsStorageInline() const
1.588 - {return (iHintValue&KIntContactHintStorageInline);}
1.589 -inline TBool CContactItemField::THint::IsEmail() const
1.590 - {return (iHintValue&KIntContactHintIsEmail);}
1.591 -
1.592 -#ifndef __SYMBIAN_CNTMODEL_USE_SQLITE__
1.593 -inline void CContactItemField::THint::SetHasAdditionalUids()
1.594 - {iHintValue|=KHintAdditionalMask;}
1.595 -#endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
1.596 -inline TBool CContactItemField::THint::Contains(const THint& aHint) const
1.597 - {return (iHintValue&aHint.iHintValue);}
1.598 -
1.599 -inline TBool CContactItemField::OverRidesLabel() const
1.600 -/** Tests whether the field's label (as set by SetLabel()) overrides the label
1.601 -specified in the field's template.
1.602 -
1.603 -@return True if the field's label overrides the label specified in the template;
1.604 -false if not. */
1.605 - {return iAttributes&EOverRidesLabel;}
1.606 -
1.607 -inline TBool CContactItemField::HasExtraStream() const
1.608 -/** Tests whether the field needs an extra stream to store information not contained
1.609 -in the template. This is the case if the field's content type is not based
1.610 -on a template, or if the field has a label which overrides the label specified
1.611 -in the template.
1.612 -
1.613 -@return True if the field uses an extra stream; false if not. */
1.614 - {return(!(iAttributes&EUsesTemplateData) || iAttributes&EOverRidesLabel);}
1.615 -
1.616 -inline TBool CContactItemField::UsesTemplateTypes() const
1.617 -/** Tests whether or not the field's content type is based on a template.
1.618 -
1.619 -@return True if the field's content type is based on a template; false if not. */
1.620 - {return iAttributes&EUsesTemplateData;}
1.621 -
1.622 -inline TBool CContactItemField::LabelUnspecified() const
1.623 -/** Tests whether the field's label has been set, either by a call to SetLabel()
1.624 -or by inheriting a label specified in the template.
1.625 -
1.626 -@return True if the field's label has been set, false if not. */
1.627 - {return iAttributes&ELabelUnspecified;}
1.628 -
1.629 -inline TBool CContactItemField::UserAddedField() const
1.630 -/** Gets the value of the user added field attribute.
1.631 -
1.632 -@return ETrue if the user added attribute is set, EFalse if not. */
1.633 - {return iAttributes&EUserAddedField;}
1.634 -
1.635 -inline TBool CContactItemField::IsCustomFilterable() const
1.636 -/** Tests the value of the user defined filter attribute.
1.637 -
1.638 -@return ETrue if the user defined filter attribute is set, EFalse if not. */
1.639 - {
1.640 - return (iExtendedAttributes&EUserDefinedFilter || iExtendedAttributes&EUserDefinedFilter1 ||
1.641 - iExtendedAttributes&EUserDefinedFilter2 || iExtendedAttributes&EUserDefinedFilter3
1.642 - || iExtendedAttributes&EUserDefinedFilter4);
1.643 - }
1.644 -
1.645 -#endif