Location:
cntitem.h
Link against: cntmodel.lib
CContactItem
Supported from 5.0
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 and 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.
|
Defined in CContactItem
:
AccessCount()
, AddFieldL()
, CardFields()
, DecAccessCount()
, Id()
, IncAccessCount()
, InsertFieldL()
, IsDeletable()
, IsDeleted()
, IsHidden()
, IsSystem()
, LastModified()
, RemoveField()
, SetDeleteFlag()
, SetDeleted()
, SetHidden()
, SetLastModified()
, SetSystem()
, SetTemplateRefId()
, SetUidStringL()
, TemplateRefId()
, Type()
, UidStringL()
, UpdateFieldSet()
, ~CContactItem()
Inherited from CBase
:
operator new()
~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.
|
TContactItemId Id() const;
Gets the contact item's ID.
|
TContactItemId TemplateRefId() const;
Supported from 6.0
Gets the ID of the template which was used to create this contact item.
|
void SetTemplateRefId(TContactItemId aUid);
Supported from 6.0
Sets the ID of the template on which this contact item is based.
|
void SetUidStringL(TDesC& aString);
Supported from 5.1
Sets the item's UID string. 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.
|
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.
|
|
TTime LastModified() const;
Gets the contact item's last modified date/time.
|
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 by connectivity, e.g. when synchronising contact items.
|
void AddFieldL(CContactItemField& aField);
Appends a field to the contact item's field set. The contact item takes ownership of the field.
|
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.
|
void InsertFieldL(CContactItemField& aField,TInt aFieldPos);
Inserts a field into the contact item's field set. The contact item takes ownership of the field.
|
CContactItemFieldSet& CardFields() const;
Gets a reference to the contact item's field set.
|
void UpdateFieldSet(CContactItemFieldSet* aNewFieldSet);
Replaces the contact item's field set.
|
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.
|
void SetSystem(TBool aSystem);
Sets the contact item's system attribute. Note that the system attribute is not currently used in the contacts model.
|
TBool IsHidden();
Tests the value of the contact item's hidden attribute. Hidden means that the item is not displayed if the view definition excludes hidden fields.
|
TBool IsSystem();
Tests the value of the contact item's system attribute. Note that the system attribute is not currently used in the contacts model.
|
TBool IsDeletable();
Tests whether the contact item is deletable. This is true if the contact item's access count is zero.
|
void SetDeleteFlag(TBool aValue);
Withdrawn in 5.1
Sets the value of the contact item's delete flag.
This flag indicates whether 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 should just be marked as deleted.
|
void SetDeleted(TBool aDeleted);
Supported from 5.1
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.
|
TBool IsDeleted();
Supported from 5.1
Tests the value of the Is deleted attribute/flag as set by
SetDeleted()
(or SetDeleteFlag()
in EPOC Release
5).
|
TInt AccessCount() const;
Gets the contact item's access count.
|