CContactItem Class Reference

class CContactItem : public CBase

The abstract base class for contact cards, templates and groups. All contact items are identified by a contact ID, (TContactItemId), have a last modified date/time and own one or more fields (the field set). Contact items also have an access count and attributes (e.g. hidden). Note that fields in a contact item also have attributes. Attribute values specified in the contact item override those in the contained fields. The access count is a record of the number of objects referencing a contact item. A contact item cannot be fully deleted until its access count is zero.

Inherits from

Public Member Functions
~CContactItem()
TInt AccessCount()
IMPORT_C voidAddFieldL(CContactItemField &)
voidAddLabelFieldL()
TContactItemId Agent()
IMPORT_C TUint32Attributes()
IMPORT_C CContactItemFieldSet &CardFields()
voidClearFieldContent()
voidDecAccessCount()
voidExternalizeL(RWriteStream &)
TPtrC Guid()
IMPORT_C TContactItemIdId()
voidIncAccessCount()
IMPORT_C voidInsertFieldL(CContactItemField &, TInt)
voidInternalizeL(RReadStream &)
TBool IsDeletable()
IMPORT_C TBoolIsDeleted()
IMPORT_C TBoolIsHidden()
IMPORT_C TBoolIsSystem()
IMPORT_C TTimeLastModified()
CContactItem *NewLC(RReadStream &)
IMPORT_C CContactItem *NewLC(TUid)
TStreamId PopulateStoreL(CStreamStore &, CArrayFix< TFieldHeader > &)
IMPORT_C voidRemoveField(TInt)
IMPORT_C voidRestoreTemplateFieldsL(const CContactItemFieldSet &, const CContactItemFieldSet &, const CContactItemViewDef &)
IMPORT_C voidSetAccessCount(TUint32)
IMPORT_C voidSetAttributes(TUint32)
IMPORT_C voidSetCreationDate(const TTime &)
IMPORT_C voidSetDeleted(TBool)
IMPORT_C voidSetHidden(TBool)
IMPORT_C voidSetId(TContactItemId)
IMPORT_C voidSetLastModified(const TTime &)
IMPORT_C voidSetSystem(TBool)
IMPORT_C voidSetTemplateRefId(TContactItemId)
IMPORT_C voidSetUidStringL(TDesC &)
IMPORT_C TContactItemIdTemplateRefId()
TUid Type()
IMPORT_C TPtrCUidStringL(TInt64)
IMPORT_C voidUpdateFieldSet(CContactItemFieldSet *)
Private Member Functions
CContactItem()
voidConstructL()
voidConstructL(const CContactItem *)
TBool GuidIsCompressed()
voidMakeUidStringL(TInt64)
TInt NumberOfFieldsToStore()
IMPORT_C voidSetHasCompressedGuid(TBool)
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()
Public Member Enumerations
enumanonymous { ESystem = 0x01, EHidden = 0x02, ECompressedGuid = 0x04, EDeleted = 0x08 }
Private Attributes
TUint32 iAccessCount
TUint32 iAttributes
TTime iCreationDate
CContactItemFieldSet *iFieldSet
HBufC *iGuid
TContactItemId iId
TTime iLastModified
TContactItemId iTemplateRefId

Constructor & Destructor Documentation

CContactItem()

CContactItem()[private]

~CContactItem()

IMPORT_C~CContactItem()

Member Functions Documentation

AccessCount()

TInt AccessCount()const [inline]

Gets the contact item's access count.

The item's access count.

AddFieldL(CContactItemField &)

IMPORT_C voidAddFieldL(CContactItemField &aField)

Parameters

CContactItemField & aField

AddLabelFieldL()

voidAddLabelFieldL()

Agent()

TContactItemId Agent()

Attributes()

IMPORT_C TUint32Attributes()const

CardFields()

IMPORT_C CContactItemFieldSet &CardFields()const

ClearFieldContent()

voidClearFieldContent()

ConstructL()

voidConstructL()[private]

ConstructL(const CContactItem *)

voidConstructL(const CContactItem *aTemplate)[private]

Parameters

const CContactItem * aTemplate

DecAccessCount()

voidDecAccessCount()[inline]

Decrements the contact item's access count.

ExternalizeL(RWriteStream &)

voidExternalizeL(RWriteStream &aStream)const [virtual]

Parameters

RWriteStream & aStream

Guid()

TPtrC Guid()[inline]

Accessor function for Contact Guid. This is used to cache contact items that are added during a sync. Guid

GuidIsCompressed()

TBool GuidIsCompressed()const [private]

Id()

IMPORT_C TContactItemIdId()const

IncAccessCount()

voidIncAccessCount()[inline]

Increments the contact item's access count.

InsertFieldL(CContactItemField &, TInt)

IMPORT_C voidInsertFieldL(CContactItemField &aField,
TIntaFieldPos
)

Parameters

CContactItemField & aField
TInt aFieldPos

InternalizeL(RReadStream &)

voidInternalizeL(RReadStream &aStream)[virtual]

Parameters

RReadStream & aStream

IsDeletable()

TBool IsDeletable()[inline]

Tests whether the contact item is deletable.

This is true if the item's access count is zero.

ETrue if deletable, EFalse if not deletable.

IsDeleted()

IMPORT_C TBoolIsDeleted()const

IsHidden()

IMPORT_C TBoolIsHidden()

IsSystem()

IMPORT_C TBoolIsSystem()

LastModified()

IMPORT_C TTimeLastModified()const

MakeUidStringL(TInt64)

voidMakeUidStringL(TInt64aMachineUniqueId)[private]

Parameters

TInt64 aMachineUniqueId

NewLC(RReadStream &)

CContactItem *NewLC(RReadStream &aStream)[static]

Parameters

RReadStream & aStream

NewLC(TUid)

IMPORT_C CContactItem *NewLC(TUidaType)[static]

Parameters

TUid aType

NumberOfFieldsToStore()

TInt NumberOfFieldsToStore()const [private]

PopulateStoreL(CStreamStore &, CArrayFix< TFieldHeader > &)

TStreamId PopulateStoreL(CStreamStore &aStore,
CArrayFix< TFieldHeader > &aFieldHeaderArray
)const

Parameters

CStreamStore & aStore
CArrayFix< TFieldHeader > & aFieldHeaderArray

RemoveField(TInt)

IMPORT_C voidRemoveField(TIntaFieldPos)

Parameters

TInt aFieldPos

RestoreTemplateFieldsL(const CContactItemFieldSet &, const CContactItemFieldSet &, const CContactItemViewDef &)

IMPORT_C voidRestoreTemplateFieldsL(const CContactItemFieldSet &aSystemTemplateFields,
const CContactItemFieldSet &aTemplateFields,
const CContactItemViewDef &aViewDef
)

Parameters

const CContactItemFieldSet & aSystemTemplateFields
const CContactItemFieldSet & aTemplateFields
const CContactItemViewDef & aViewDef

SetAccessCount(TUint32)

IMPORT_C voidSetAccessCount(TUint32aAccessCount)

Parameters

TUint32 aAccessCount

SetAttributes(TUint32)

IMPORT_C voidSetAttributes(TUint32aAttributes)

Parameters

TUint32 aAttributes

SetCreationDate(const TTime &)

IMPORT_C voidSetCreationDate(const TTime &aTime)

Parameters

const TTime & aTime

SetDeleted(TBool)

IMPORT_C voidSetDeleted(TBoolaDeleted)

Parameters

TBool aDeleted

SetHasCompressedGuid(TBool)

IMPORT_C voidSetHasCompressedGuid(TBoolaCompressed)[private]

Parameters

TBool aCompressed

SetHidden(TBool)

IMPORT_C voidSetHidden(TBoolaHidden)

Parameters

TBool aHidden

SetId(TContactItemId)

IMPORT_C voidSetId(TContactItemIdaId)

Parameters

TContactItemId aId

SetLastModified(const TTime &)

IMPORT_C voidSetLastModified(const TTime &aLastModified)

Parameters

const TTime & aLastModified

SetSystem(TBool)

IMPORT_C voidSetSystem(TBoolaSystem)

Parameters

TBool aSystem

SetTemplateRefId(TContactItemId)

IMPORT_C voidSetTemplateRefId(TContactItemIdaUid)

Parameters

TContactItemId aUid

SetUidStringL(TDesC &)

IMPORT_C voidSetUidStringL(TDesC &aString)

Parameters

TDesC & aString

TemplateRefId()

IMPORT_C TContactItemIdTemplateRefId()const

Type()

TUid Type()const [pure virtual]

Gets the contact item's type.

The contact item's type.

UidStringL(TInt64)

IMPORT_C TPtrCUidStringL(TInt64aMachineUniqueId)const

Parameters

TInt64 aMachineUniqueId

UpdateFieldSet(CContactItemFieldSet *)

IMPORT_C voidUpdateFieldSet(CContactItemFieldSet *aNewFieldSet)

Parameters

CContactItemFieldSet * aNewFieldSet

Member Enumerations Documentation

Enum anonymous

Contact item's attribute flags

These flags can be used to set the various attributes of a contact item.

Enumerators

ESystem = 0x01

To set the contact item's system attribute.

EHidden = 0x02

To set the contact item's hidden attribute.

ECompressedGuid = 0x04

To set the contact item's hidden attribute.

EDeleted = 0x08

To set the contact item's Is deleted attribute.

Member Data Documentation

TUint32 iAccessCount

TUint32 iAccessCount[private]

TUint32 iAttributes

TUint32 iAttributes[private]

TTime iCreationDate

TTime iCreationDate[private]

CContactItemFieldSet * iFieldSet

CContactItemFieldSet *iFieldSet[private]

HBufC * iGuid

HBufC *iGuid[private]

TContactItemId iId

TContactItemId iId[private]

TTime iLastModified

TTime iLastModified[private]

TContactItemId iTemplateRefId

TContactItemId iTemplateRefId[private]