#include <app/cntitem.h>
class CContactItem : public CBase |
Public Member Enumerations | |
---|---|
enum | anonymous { ESystem, EHidden, ECompressedGuid, EDeleted } |
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.
Contact item's attribute flags
These flags can be used to set the various attributes of a contact item.
IMPORT_C | ~CContactItem | ( | ) |
The destructor frees all resources owned by the contact item, prior to its destruction.
TInt | AccessCount | ( | ) | const [inline] |
Gets the contact item's access count.
Returns: The item's access count.
IMPORT_C void | AddFieldL | ( | CContactItemField & | aField | ) |
Appends a field to the contact item's field set. The contact item takes ownership of the field.
Parameter | Description |
---|---|
aField | The field to append to the contact item's field set. |
IMPORT_C TUint32 | Attributes | ( | ) | const |
Returns the contact item's attributes.
Returns: contact item's attributes
IMPORT_C CContactItemFieldSet & | CardFields | ( | ) | const |
Gets a reference to the contact item's field set.
Returns: A reference to the contact item's field set.
void | ExternalizeL | ( | RWriteStream & | aStream | ) | const [virtual] |
Externalises a CContactItem object to a write stream.
Parameter | Description |
---|---|
aStream | Stream to which the object should be externalised. |
TPtrC | Guid | ( | ) | [inline] |
Accessor function for Contact Guid. This is used to cache contact items that are added during a sync.
Returns: Guid
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.
Parameter | Description |
---|---|
aField | The field to insert into the contact item's field set. |
aFieldPos | The position in the field set at which to insert the field. If this value is greater than the total number of fields, it is appended. The position is relative to zero, i.e. zero implies that the element is inserted at the beginning of the array. |
void | InternalizeL | ( | RReadStream & | aStream | ) | [virtual] |
Internalises a CContactItem object from a read stream.
Parameter | Description |
---|---|
aStream | Stream from which the object should be internalised. |
TBool | IsDeletable | ( | ) | [inline] |
Tests whether the contact item is deletable.
This is true if the item's access count is zero.
Returns: ETrue if deletable, EFalse if not deletable.
IMPORT_C TBool | IsDeleted | ( | ) | const |
Gets the value of the Is deleted attribute as set by SetDeleted().
Returns: ETrue if deleted, EFalse if not.
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.
Returns: ETrue if hidden, EFalse if not.
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.
Returns: ETrue if system, EFalse if not.
IMPORT_C TTime | LastModified | ( | ) | const |
Gets the contact item's last modified date/time.
Returns: The contact item's last modified date/time.
CContactItem * | NewLC | ( | RReadStream & | aStream | ) | [static] |
Constructs a new contact item based on a RReadStream.
Parameter | Description |
---|---|
aStream | RReadStream containing object to internalize. |
Returns: Pointer to the newly created CContactItem. This is left on the cleanup stack.
IMPORT_C CContactItem * | NewLC | ( | TUid | aType | ) | [static] |
Constructs a new contact item.
Returns: Pointer to the newly created CContactItem. This is left on the cleanup stack.
TStreamId | PopulateStoreL | ( | CStreamStore & | aStore, |
CArrayFix< TFieldHeader > & | aFieldHeaderArray | |||
) | const |
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.
Parameter | Description |
---|---|
aFieldPos | Index within the field set of the field to remove. |
IMPORT_C void | RestoreTemplateFieldsL | ( | const CContactItemFieldSet & | aSystemTemplateFields, |
const CContactItemFieldSet & | aTemplateFields, | |||
const CContactItemViewDef & | aViewDef | |||
) |
Restore fields from the template to the contact item.
Parameter | Description |
---|---|
aTemplateFields | Fields to add |
aViewDef | View definition to use |
IMPORT_C void | SetAccessCount | ( | TUint32 | aAccessCount | ) |
Sest the contact item's access count.
IMPORT_C void | SetAttributes | ( | TUint32 | aAttributes | ) |
Sest the contact item's attributes.
IMPORT_C void | SetCreationDate | ( | const TTime & | aTime | ) |
Sest the contact item's creation time.
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.
Parameter | Description |
---|---|
aDeleted | ETrue to set the Is deleted attribute. EFalse to unset it. |
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.
Parameter | Description |
---|---|
aHidden | ETrue to set the hidden attribute for the item, EFalse to unset it. |
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.
Parameter | Description |
---|---|
aLastModified | The contact item's last modified date/time. |
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.
Parameter | Description |
---|---|
aSystem | ETrue to set the system attribute, EFalse to unset it. |
IMPORT_C void | SetTemplateRefId | ( | TContactItemId | aUid | ) |
Sets the ID of the template on which this contact item is based.
Parameter | Description |
---|---|
aUid | The ID of the template on which this item is based. |
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.
Parameter | Description |
---|---|
aString | The contact item's UID string. |
IMPORT_C TContactItemId | TemplateRefId | ( | ) | const |
Gets the ID of the template which was used to create this contact item.
Returns: The ID of the template on which this item is based. KNullContactId if the item is not based on a template.
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.
Parameter | Description |
---|---|
aMachineUniqueId | The database's unique identifier. This can be retrieved using CContactDatabase::MachineId(). |
Returns: The item's UID string.
IMPORT_C void | UpdateFieldSet | ( | CContactItemFieldSet * | aNewFieldSet | ) |
Replaces the contact item's field set.
Parameter | Description |
---|---|
aNewFieldSet | The new field set with which to replace the existing one. |