Location:
CNTITEM.H
Link against: cntmodel.lib
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.
CBase
- Base class for all classes to be instantiated on the heap
CContactItem
- The abstract base class for contact cards, templates and groups
Defined in CContactItem
:
AccessCount()
, AddFieldL()
, CardFields()
, DecAccessCount()
, ECompressedGuid
, EDeleted
, EHidden
, ESystem
, ExternalizeL()
, Guid()
, Id()
, IncAccessCount()
, InsertFieldL()
, InternalizeL()
, IsDeletable()
, IsDeleted()
, IsHidden()
, IsSystem()
, LastModified()
, RemoveField()
, SetDeleted()
, SetHidden()
, SetLastModified()
, SetSystem()
, SetTemplateRefId()
, SetUidStringL()
, TemplateRefId()
, Type()
, UidStringL()
, UpdateFieldSet()
, anonymous
, ~CContactItem()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
IMPORT_C ~CContactItem();
The destructor frees all resources owned by the contact item, prior to its destruction.
virtual TUid Type() const=0;
Gets the contact item's type.
|
IMPORT_C TContactItemId Id() const;
Gets the contact item's ID.
|
IMPORT_C TContactItemId TemplateRefId() const;
Gets the ID of the template which was used to create this contact item.
|
IMPORT_C TTime LastModified() const;
Gets the contact item's last modified date/time.
|
IMPORT_C void SetLastModified(const TTime &aLastModified);
Sets the last modified date/time value stored in the local copy of the contact item. This value is returned by LastModified()
for this copy of the item.
This function has no effect on the item's last modified date/time which is stored in the database; this is always the date/time the contact was last committed.
This function is provided for use when synchronising contact items.
|
IMPORT_C void AddFieldL(CContactItemField &aField);
Appends a field to the contact item's field set. The contact item takes ownership of the field.
|
IMPORT_C void RemoveField(TInt aFieldPos);
Removes a field from the contact item's field set. A panic occurs if the specified field does not exist in the field set.
|
IMPORT_C void InsertFieldL(CContactItemField &aField, TInt aFieldPos);
Inserts a field into the contact item's field set. The contact item takes ownership of the field.
|
IMPORT_C CContactItemFieldSet &CardFields() const;
Gets a reference to the contact item's field set.
|
IMPORT_C void SetHidden(TBool aHidden);
Sets the contact item's hidden attribute. Hidden means that the item is not displayed if the view definition excludes hidden fields.
|
IMPORT_C void SetSystem(TBool aSystem);
Sets the contact item's system attribute. Note that the system attribute is not currently used in the contacts model.
|
IMPORT_C TBool IsHidden();
Gets the value of the contact item's hidden attribute. Hidden means that the item is not displayed if the view definition excludes hidden fields.
|
IMPORT_C TBool IsSystem();
Gets the value of the contact item's system attribute. Note that the system attribute is not currently used in the contacts model.
|
IMPORT_C void UpdateFieldSet(CContactItemFieldSet *aNewFieldSet);
Replaces the contact item's field set.
|
IMPORT_C void SetDeleted(TBool aDeleted);
Sets the value of the contact item's Is deleted attribute.
If the attribute is set, this means that an attempt has been made to delete the contact item, but because the item's access count is greater than zero, its data persists and the item is just marked as deleted.
|
IMPORT_C TBool IsDeleted() const;
Gets the value of the Is deleted attribute as set by SetDeleted()
.
|
IMPORT_C void SetTemplateRefId(TContactItemId aUid);
Sets the ID of the template on which this contact item is based.
|
inline TBool IsDeletable();
Tests whether the contact item is deletable.
This is true if the item's access count is zero.
|
inline TInt AccessCount() const;
Gets the contact item's access count.
|
IMPORT_C void SetUidStringL(TDesC &aString);
Sets the item's UID string. This replaces any existing string. Contact items have a globally unique identifier, stored as
a descriptor which is provided for vCard support. It is a combination of the database's unique identifier (see CContactDatabase::MachineId()
), the contact item ID and the date/time of the contact item's creation.
|
IMPORT_C TPtrC UidStringL(TInt64 aMachineUniqueId) const;
Returns a descriptor which contains the item's UID string. Contact items have a globally unique identifier, stored as a descriptor. This is provided for vCard support. It is a combination of the database's unique identifier, the contact item ID and the date/time of the contact item's creation.
|
|
inline TPtrC Guid();
Accessor function for Contact Guid. This is used to cache contact items that are added during a sync.
|
virtual void ExternalizeL(RWriteStream &aStream) const;
Externalises a CContactItem object to a write stream.
|
virtual void InternalizeL(RReadStream &aStream);
Internalises a CContactItem object from a read stream.
|
n/a
Contact item's attribute flags
These flags can be used to set the various attributes of a contact item.
|