CContactItemField Class Reference

class CContactItemField : public CBase

A field in a contact item.

Fields are grouped into a field set (CContactItemFieldSet), which is owned by the contact item.

The contact item field stores the field data. The data may be text, a date/time value, or an agent, as indicated by the storage type (TStorageType). The storage type is also owned by the field. Note that numeric field data is not supported. All numbers, for instance telephone or fax numbers are stored as text.

Fields also have a content type, attributes and a label. The label is a string which identifies the field to a user e.g. First name, Last name.

The following attributes are supported:

  • hidden: the field is not displayed if the view definition masks hidden fields

  • disabled: the field cannot be deleted from the original template and thus is marked as disabled

  • read only: the field cannot be written to

  • synchronise: used by Connectivity applications; set by default for all contact item fields

  • user added: the field was added by the user and was not taken from the template

  • template: indicates that the field is part of a template. Template fields differ from other fields in that they are persisted when they do not contain any data.

  • speed dial: the field contains a telephone number which maps to one of the nine possible speed dial positions.

These attributes can be set using member functions of this class, but they are normally set automatically by other functions, for instance when setting a speed dial field, CContactDatabase automatically sets the field's speed dial attribute.

Inherits from

Nested Classes and Structures

Public Member Functions
~CContactItemField()
IMPORT_C voidAddFieldTypeL(TFieldType)
IMPORT_C CContactAgentField *AgentStorage()
IMPORT_C const CContentType &ContentType()
voidCopyStorageL(const CContactItemField &)
IMPORT_C CContactDateField *DateTimeStorage()
TBool DoSynchronize()
voidExternalizeL(RWriteStream &)
IMPORT_C voidGetFieldText(TDes &)
IMPORT_C TBoolHasCustomFilter(EContactFieldFlags &)
TBool HasExtraStream()
IMPORT_C TIntId()
voidInternalizeL(RReadStream &)
TBool IsCustomFilterable()
TBool IsDeleted()
TBool IsDisabled()
TBool IsHidden()
TBool IsPrivate()
TBool IsReadOnly()
TBool IsSpeedDial()
TBool IsTemplate()
IMPORT_C TBoolIsTemplateLabelField()
IMPORT_C TBoolIsValidLabel(const TDesC &, TInt &)
IMPORT_C TPtrCLabel()
TBool LabelUnspecified()
IMPORT_C CContactItemField *NewL(TStorageType)
IMPORT_C CContactItemField *NewL(TStorageType, TFieldType)
IMPORT_C CContactItemField *NewL(const CContactItemField &)
IMPORT_C CContactItemField *NewL(TStorageType, const CContentType &)
IMPORT_C CContactItemField *NewLC()
IMPORT_C CContactItemField *NewLC(TStorageType)
IMPORT_C CContactItemField *NewLC(TStorageType, TFieldType)
IMPORT_C CContactItemField *NewLC(const CContactItemField &)
IMPORT_C CContactItemField *NewLC(TStorageType, const CContentType &)
TBool OverRidesLabel()
voidPopulateStoreL(RStoreWriteStream &, TInt, CArrayFix< TFieldHeader > &)
voidPrepareFieldAsTemplateL(CContactItemFieldSet &)
IMPORT_C voidRemoveFieldType(TFieldType)
IMPORT_C voidReset()
IMPORT_C voidResetStore()
IMPORT_C TStreamIdRestoreFieldTypesL(RReadStream &, const CContactItemFieldSet *)
IMPORT_C voidRestoreHeaderL(RReadStream &, const CContactItemFieldSet *)
IMPORT_C TBoolRestoreIfMatchL(RReadStream &, const CContactItemFieldDef *, const CContactItemFieldSet *, HBufC *, TInt)
TBool RestoreIfMatchL(RReadStream &, TFieldType, const CContactItemFieldSet *, HBufC *, TInt)
IMPORT_C voidRestoreTextL(HBufC *, TInt)
IMPORT_C voidSetCustomFilterable(EContactFieldFlags)
voidSetDeleted(TBool)
IMPORT_C voidSetDisabled(TBool)
IMPORT_C voidSetHidden(TBool)
IMPORT_C voidSetHintType(TInt)
IMPORT_C voidSetId(TInt)
IMPORT_C voidSetLabel(HBufC *)
IMPORT_C voidSetLabelL(const TDesC &)
IMPORT_C voidSetMapping(TUid)
voidSetOverRidesLabel(TBool)
IMPORT_C voidSetPrivate(TBool)
IMPORT_C voidSetReadOnly(TBool)
IMPORT_C voidSetSpeedDial(TBool)
IMPORT_C voidSetSynchronize(TBool)
IMPORT_C voidSetTemplateField(TBool)
IMPORT_C voidSetUserAddedField(TBool)
IMPORT_C voidSetUserFlags(TUint)
voidSetUsesTemplateTypes(TBool)
IMPORT_C CContactFieldStorage *Storage()
IMPORT_C TStorageTypeStorageType()
IMPORT_C CContactStoreField *StoreStorage()
TInt TemplateFieldId()
IMPORT_C CContactTextField *TextStorage()
voidUpdateFieldFlags(const CContactItemFieldSet &)
TBool UserAddedField()
IMPORT_C TUintUserFlags()
TBool UsesTemplateTypes()
Protected Member Functions
voidUsesTemplateData(TInt)
Private Member Functions
CContactItemField()
CContactItemField(TStorageType)
TBool AddFieldToHint(TFieldType, CContactItemField::THint &)
voidCloneL(const CContactItemField &)
voidConstructStorageL()
voidMapHintsToFieldTypesL(THint)
voidRestoreDataL(CStreamStore &, TStreamId)
TStreamId RestoreHintL(CStreamStore &, RReadStream &)
voidRestoreL(CStreamStore &, RReadStream &)
voidSetLabelUnspecified(TBool)
TStreamId StoreAdditionalUidsL(CStreamStore &, TStreamId, CArrayFixFlat< TUid > *)
TStreamId StoreDataL(CStreamStore &)
TFieldHeader StoreL(RWriteStream &, CStreamStore &, TInt)
const CContentType &TemplateContentType(const CContactItemFieldSet &)
voidUsesTemplateLabel()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Member Enumerations
enumanonymous {
EHidden = 0x00000001, EReadOnly = 0x00000002, ESynchronize = 0x00000004, EDisabled = 0x00000008, EUserMask = 0x000000F0, ETemplateMask = EUserMask|ESynchronize|EReadOnly|EHidden, EOverRidesLabel = 0x00000100, EUsesTemplateData = 0x00000200, EUserAddedField = 0x00000400, ETemplate = 0x00000800, ELabelUnspecified = 0x40000000, EDeleted = 0x80000000
}
enumanonymous {
EPrivate = 0x00000001, ESpeedDial = 0x00000002, EUserDefinedFilter = 0x00000004, EUserDefinedFilter1 = 0x00000008, EUserDefinedFilter2 = 0x00000010, EUserDefinedFilter3 = 0x00000020, EUserDefinedFilter4 = 0x00000040
}
Private Attributes
TUint32 iAttributes
CContentType *iContentType
TUint32 iExtendedAttributes
TInt iId
HBufC *iLabel
CContactFieldStorage *iStorage
TStorageType iStorageType
TInt iTemplateFieldId

Constructor & Destructor Documentation

CContactItemField()

CContactItemField()[private]

CContactItemField(TStorageType)

CContactItemField(TStorageTypeaType)[private]

Parameters

TStorageType aType

~CContactItemField()

IMPORT_C~CContactItemField()

Member Functions Documentation

AddFieldToHint(TFieldType, CContactItemField::THint &)

TBool AddFieldToHint(TFieldTypeaFieldType,
CContactItemField::THint &aHint
)const [private]

Parameters

TFieldType aFieldType
CContactItemField::THint & aHint

AddFieldTypeL(TFieldType)

IMPORT_C voidAddFieldTypeL(TFieldTypeaFieldType)

Parameters

TFieldType aFieldType

AgentStorage()

IMPORT_C CContactAgentField *AgentStorage()const

CloneL(const CContactItemField &)

voidCloneL(const CContactItemField &aField)[private]

Parameters

const CContactItemField & aField

ConstructStorageL()

voidConstructStorageL()[private]

ContentType()

IMPORT_C const CContentType &ContentType()const

CopyStorageL(const CContactItemField &)

voidCopyStorageL(const CContactItemField &aField)

Parameters

const CContactItemField & aField

DateTimeStorage()

IMPORT_C CContactDateField *DateTimeStorage()const

DoSynchronize()

TBool DoSynchronize()const [inline]

Gets the value of the field's synchronise attribute.

ETrue if synchronise attribute is set, EFalse if not set.

ExternalizeL(RWriteStream &)

voidExternalizeL(RWriteStream &aStream)const

Parameters

RWriteStream & aStream

GetFieldText(TDes &)

IMPORT_C voidGetFieldText(TDes &aText)const

Parameters

TDes & aText

HasCustomFilter(EContactFieldFlags &)

IMPORT_C TBoolHasCustomFilter(EContactFieldFlags &contactFieldFlag)const

Parameters

EContactFieldFlags & contactFieldFlag

HasExtraStream()

TBool HasExtraStream()const [inline]

Tests whether the field needs an extra stream to store information not contained in the template. This is the case if the field's content type is not based on a template, or if the field has a label which overrides the label specified in the template.

True if the field uses an extra stream; false if not.

Id()

IMPORT_C TIntId()const

InternalizeL(RReadStream &)

voidInternalizeL(RReadStream &aStream)

Parameters

RReadStream & aStream

IsCustomFilterable()

TBool IsCustomFilterable()const [inline]

Tests the value of the user defined filter attribute.

ETrue if the user defined filter attribute is set, EFalse if not.

IsDeleted()

TBool IsDeleted()const [inline]

Gets the value of the field's deleted attribute.

ETrue if the field is deleted, otherwise EFalse.

IsDisabled()

TBool IsDisabled()const [inline]

Gets the value of the field's disabled attribute.

ETrue if disabled attribute set, EFalse if not set.

IsHidden()

TBool IsHidden()const [inline]

Gets the value of the field's hidden attribute.

ETrue if hidden attribute is set, EFalse if not set.

IsPrivate()

TBool IsPrivate()const [inline]

Tests whether the field's private attribute is set.

True if the field's private attribute is set, false if not.

IsReadOnly()

TBool IsReadOnly()const [inline]

Gets the value of the field's read only attribute.

ETrue if read only attribute set, EFalse if not set.

IsSpeedDial()

TBool IsSpeedDial()const [inline]

Tests whether the field is a speed dial field.

True if the field is a speed dial field, false if not.

IsTemplate()

TBool IsTemplate()const [inline]

Tests whether the field is in a template, as set by SetTemplateField().

ETrue if field is a template field. EFalse if not.

IsTemplateLabelField()

IMPORT_C TBoolIsTemplateLabelField()const

IsValidLabel(const TDesC &, TInt &)

IMPORT_C TBoolIsValidLabel(const TDesC &aLabel,
TInt &aInvalidPos
)[static]

Parameters

const TDesC & aLabel
TInt & aInvalidPos

Label()

IMPORT_C TPtrCLabel()const

LabelUnspecified()

TBool LabelUnspecified()const [inline]

Tests whether the field's label has been set, either by a call to SetLabel() or by inheriting a label specified in the template.

True if the field's label has been set, false if not.

MapHintsToFieldTypesL(THint)

voidMapHintsToFieldTypesL(THintaHint)[private]

Parameters

THint aHint

NewL(TStorageType)

IMPORT_C CContactItemField *NewL(TStorageTypeaType)[static]

Parameters

TStorageType aType

NewL(TStorageType, TFieldType)

IMPORT_C CContactItemField *NewL(TStorageTypeaType,
TFieldTypeaFieldType
)[static]

Parameters

TStorageType aType
TFieldType aFieldType

NewL(const CContactItemField &)

IMPORT_C CContactItemField *NewL(const CContactItemField &aField)[static]

Parameters

const CContactItemField & aField

NewL(TStorageType, const CContentType &)

IMPORT_C CContactItemField *NewL(TStorageTypeaType,
const CContentType &aContentType
)[static]

Parameters

TStorageType aType
const CContentType & aContentType

NewLC()

IMPORT_C CContactItemField *NewLC()[static]

NewLC(TStorageType)

IMPORT_C CContactItemField *NewLC(TStorageTypeaType)[static]

Parameters

TStorageType aType

NewLC(TStorageType, TFieldType)

IMPORT_C CContactItemField *NewLC(TStorageTypeaType,
TFieldTypeaFieldType
)[static]

Parameters

TStorageType aType
TFieldType aFieldType

NewLC(const CContactItemField &)

IMPORT_C CContactItemField *NewLC(const CContactItemField &aField)[static]

Parameters

const CContactItemField & aField

NewLC(TStorageType, const CContentType &)

IMPORT_C CContactItemField *NewLC(TStorageTypeaType,
const CContentType &aContentType
)[static]

Parameters

TStorageType aType
const CContentType & aContentType

OverRidesLabel()

TBool OverRidesLabel()const [inline]

Tests whether the field's label (as set by SetLabel()) overrides the label specified in the field's template.

True if the field's label overrides the label specified in the template; false if not.

PopulateStoreL(RStoreWriteStream &, TInt, CArrayFix< TFieldHeader > &)

voidPopulateStoreL(RStoreWriteStream &aRootStream,
TIntaCount,
CArrayFix< TFieldHeader > &aFieldHeaderArray
)const

Parameters

RStoreWriteStream & aRootStream
TInt aCount
CArrayFix< TFieldHeader > & aFieldHeaderArray

PrepareFieldAsTemplateL(CContactItemFieldSet &)

voidPrepareFieldAsTemplateL(CContactItemFieldSet &aSystemTemplateFieldSet)

Parameters

CContactItemFieldSet & aSystemTemplateFieldSet

RemoveFieldType(TFieldType)

IMPORT_C voidRemoveFieldType(TFieldTypeaFieldType)

Parameters

TFieldType aFieldType

Reset()

IMPORT_C voidReset()

ResetStore()

IMPORT_C voidResetStore()

RestoreDataL(CStreamStore &, TStreamId)

voidRestoreDataL(CStreamStore &aStore,
TStreamIdaId
)[private]

Parameters

CStreamStore & aStore
TStreamId aId

RestoreFieldTypesL(RReadStream &, const CContactItemFieldSet *)

IMPORT_C TStreamIdRestoreFieldTypesL(RReadStream &aRootStream,
const CContactItemFieldSet *aSystemTemplateFields
)

Parameters

RReadStream & aRootStream
const CContactItemFieldSet * aSystemTemplateFields

RestoreHeaderL(RReadStream &, const CContactItemFieldSet *)

IMPORT_C voidRestoreHeaderL(RReadStream &aStream,
const CContactItemFieldSet *aSystemTemplateFields
)

Parameters

RReadStream & aStream
const CContactItemFieldSet * aSystemTemplateFields

RestoreHintL(CStreamStore &, RReadStream &)

TStreamId RestoreHintL(CStreamStore &aStore,
RReadStream &aStream
)[private]

Parameters

CStreamStore & aStore
RReadStream & aStream

RestoreIfMatchL(RReadStream &, const CContactItemFieldDef *, const CContactItemFieldSet *, HBufC *, TInt)

IMPORT_C TBoolRestoreIfMatchL(RReadStream &aStream,
const CContactItemFieldDef *aFieldDef,
const CContactItemFieldSet *aSystemTemplateFields,
HBufC *aTextStream,
TIntaTextIndex
)

Parameters

RReadStream & aStream
const CContactItemFieldDef * aFieldDef
const CContactItemFieldSet * aSystemTemplateFields
HBufC * aTextStream
TInt aTextIndex

RestoreIfMatchL(RReadStream &, TFieldType, const CContactItemFieldSet *, HBufC *, TInt)

TBool RestoreIfMatchL(RReadStream &aStream,
TFieldTypeaFieldType,
const CContactItemFieldSet *aSystemTemplateFields,
HBufC *aTextStream,
TIntaTextIndex
)

Parameters

RReadStream & aStream
TFieldType aFieldType
const CContactItemFieldSet * aSystemTemplateFields
HBufC * aTextStream
TInt aTextIndex

RestoreL(CStreamStore &, RReadStream &)

voidRestoreL(CStreamStore &aStore,
RReadStream &aStream
)[private]

Parameters

CStreamStore & aStore
RReadStream & aStream

RestoreTextL(HBufC *, TInt)

IMPORT_C voidRestoreTextL(HBufC *aTextStream,
TIntaTextFieldIndex
)

Parameters

HBufC * aTextStream
TInt aTextFieldIndex

SetCustomFilterable(EContactFieldFlags)

IMPORT_C voidSetCustomFilterable(EContactFieldFlagsaContactFilterType)

Parameters

EContactFieldFlags aContactFilterType

SetDeleted(TBool)

voidSetDeleted(TBoolaDeleted)

Parameters

TBool aDeleted

SetDisabled(TBool)

IMPORT_C voidSetDisabled(TBoolaDisabled)

Parameters

TBool aDisabled

SetHidden(TBool)

IMPORT_C voidSetHidden(TBoolaHidden)

Parameters

TBool aHidden

SetHintType(TInt)

IMPORT_C voidSetHintType(TIntaType)

Parameters

TInt aType

SetId(TInt)

IMPORT_C voidSetId(TIntaId)

Parameters

TInt aId

SetLabel(HBufC *)

IMPORT_C voidSetLabel(HBufC *aLabel)

Parameters

HBufC * aLabel

SetLabelL(const TDesC &)

IMPORT_C voidSetLabelL(const TDesC &aLabel)

Parameters

const TDesC & aLabel

SetLabelUnspecified(TBool)

voidSetLabelUnspecified(TBoolaUnspecified)[private]

Parameters

TBool aUnspecified

SetMapping(TUid)

IMPORT_C voidSetMapping(TUidaMapping)

Parameters

TUid aMapping

SetOverRidesLabel(TBool)

voidSetOverRidesLabel(TBoolaValue)

Parameters

TBool aValue

SetPrivate(TBool)

IMPORT_C voidSetPrivate(TBoolaTemplateField)

Parameters

TBool aTemplateField

SetReadOnly(TBool)

IMPORT_C voidSetReadOnly(TBoolaReadOnly)

Parameters

TBool aReadOnly

SetSpeedDial(TBool)

IMPORT_C voidSetSpeedDial(TBoolaSpeedDialField)

Parameters

TBool aSpeedDialField

SetSynchronize(TBool)

IMPORT_C voidSetSynchronize(TBoolaSynchronize)

Parameters

TBool aSynchronize

SetTemplateField(TBool)

IMPORT_C voidSetTemplateField(TBoolaTemplateField)

Parameters

TBool aTemplateField

SetUserAddedField(TBool)

IMPORT_C voidSetUserAddedField(TBoolaUserAddedField)

Parameters

TBool aUserAddedField

SetUserFlags(TUint)

IMPORT_C voidSetUserFlags(TUintaFlags)

Parameters

TUint aFlags

SetUsesTemplateTypes(TBool)

voidSetUsesTemplateTypes(TBoolaUsesTemplateTypes)

Parameters

TBool aUsesTemplateTypes

Storage()

IMPORT_C CContactFieldStorage *Storage()const

StorageType()

IMPORT_C TStorageTypeStorageType()const

StoreAdditionalUidsL(CStreamStore &, TStreamId, CArrayFixFlat< TUid > *)

TStreamId StoreAdditionalUidsL(CStreamStore &aStore,
TStreamIdaId,
CArrayFixFlat< TUid > *aAdditionalFields
)[private]

Parameters

CStreamStore & aStore
TStreamId aId
CArrayFixFlat< TUid > * aAdditionalFields

StoreDataL(CStreamStore &)

TStreamId StoreDataL(CStreamStore &aStore)[private]

Parameters

CStreamStore & aStore

StoreL(RWriteStream &, CStreamStore &, TInt)

TFieldHeader StoreL(RWriteStream &aTextStream,
CStreamStore &aBlobStore,
TIntaTextFieldIndex
)[private]

Parameters

RWriteStream & aTextStream
CStreamStore & aBlobStore
TInt aTextFieldIndex

StoreStorage()

IMPORT_C CContactStoreField *StoreStorage()const

TemplateContentType(const CContactItemFieldSet &)

const CContentType &TemplateContentType(const CContactItemFieldSet &aSystemTemplateFields)const [private]

Parameters

const CContactItemFieldSet & aSystemTemplateFields

TemplateFieldId()

TInt TemplateFieldId()const

TextStorage()

IMPORT_C CContactTextField *TextStorage()const

UpdateFieldFlags(const CContactItemFieldSet &)

voidUpdateFieldFlags(const CContactItemFieldSet &aTemplateFieldSet)

Parameters

const CContactItemFieldSet & aTemplateFieldSet

UserAddedField()

TBool UserAddedField()const [inline]

Gets the value of the user added field attribute.

ETrue if the user added attribute is set, EFalse if not.

UserFlags()

IMPORT_C TUintUserFlags()const

UsesTemplateData(TInt)

voidUsesTemplateData(TIntaTemplateFieldId)[protected]

Parameters

TInt aTemplateFieldId

UsesTemplateLabel()

voidUsesTemplateLabel()[private]

UsesTemplateTypes()

TBool UsesTemplateTypes()const [inline]

Tests whether or not the field's content type is based on a template.

True if the field's content type is based on a template; false if not.

Member Enumerations Documentation

Enum anonymous

Enumerators

EHidden = 0x00000001
EReadOnly = 0x00000002
ESynchronize = 0x00000004
EDisabled = 0x00000008
EUserMask = 0x000000F0
ETemplateMask = EUserMask|ESynchronize|EReadOnly|EHidden
EOverRidesLabel = 0x00000100
EUsesTemplateData = 0x00000200
EUserAddedField = 0x00000400
ETemplate = 0x00000800
ELabelUnspecified = 0x40000000
EDeleted = 0x80000000

Enum anonymous

Enumerators

EPrivate = 0x00000001
ESpeedDial = 0x00000002
EUserDefinedFilter = 0x00000004
EUserDefinedFilter1 = 0x00000008
EUserDefinedFilter2 = 0x00000010
EUserDefinedFilter3 = 0x00000020
EUserDefinedFilter4 = 0x00000040

Member Data Documentation

TUint32 iAttributes

TUint32 iAttributes[private]

CContentType * iContentType

CContentType *iContentType[private]

TUint32 iExtendedAttributes

TUint32 iExtendedAttributes[private]

TInt iId

TInt iId[private]

HBufC * iLabel

HBufC *iLabel[private]

CContactFieldStorage * iStorage

CContactFieldStorage *iStorage[private]

TStorageType iStorageType

TStorageType iStorageType[private]

TInt iTemplateFieldId

TInt iTemplateFieldId[private]