EPOC   SDK Home Glossary Indexes Previous Next Up

CContactItem class


Contents


CContactItem class — Details for a single contact

Section Contents


Overview

Compatibility

Applications that use this class will not work correctly on a version of EPOC earlier than ER5.

Derivation

CBase

Abstract: CBase behaviour.

Defined in

cntitem.h

Link against

cntmodel.lib

Description

The abstract base class for CContactCard and for CContactTemplate. Each contact item is identified by a contact ID, (TContactItemId), has a last modified date and time, and owns one or more fields (the field set). Contact items also have an access count and can have attributes (e.g. hidden). Note that fields within a contact item also have attributes. Attribute values specified in the contact item override those in the fields.


Type and ID


Type() — Get contact type

virtual TUid Type() const=0;

Description

Implemented by the derived class to indicate the contact item type.

Return value

TUid

The contact type.


Id() — Get contact item's ID

TContactItemId Id() const;

Description

Retrieve the contact item ID.

Return value

TContactItemId

The contact item ID.


Last modified date/time


LastModified() — Get contact item's last modified date/time

TTime LastModified() const;

Description

Returns the contact item's last modified date/time.

Return value

TTime

The contact item's last modified date/time.


SetLastModified() — Set contact item's last modified date/time

void SetLastModified(const TTime& aLastModified);

Description

This function sets the last modified date/time value stored in the local copy of the contact item and will affect the value 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 synchronizing contact items.

Arguments

const TTime& aLastModified

The contact item's last modified date/time.


Fields


AddFieldL() — Append field

void AddFieldL(CContactItemField& aField);

Description

Appends a field to the contact item's field set. The contact item takes ownership of the field.

Arguments

CContactItemField& aField

The field to append to the contact item's field set.


RemoveField() — Remove field

void RemoveField(TInt aFieldPos);

Description

Removes a field from the contact item's field set. A panic occurs if the specified field does not exist in the field set.

Arguments

TInt aFieldPos

Index within the field set of the field to remove.


InsertFieldL() — Insert field

void InsertFieldL(CContactItemField& aField,TInt aFieldPos);

Description

Inserts a field into the contact item's field set. The contact item takes ownership of the field.

Arguments

CContactItemField& aField

The field to insert into the contact item's field set.

TInt 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.


CardFields() — Get field set

CContactItemFieldSet& CardFields() const;

Description

Returns a reference to the contact item's field set.

Return value

CContactItemFieldSet&

A reference to the contact item's field set.


UpdateFieldSet() — Replace field set

void UpdateFieldSet(CContactItemFieldSet* aNewFieldSet);

Description

Replaces the contact item's field set. The previous field set is deleted.

Arguments

CContactItemFieldSet* aNewFieldSet

The new field set with which to replace the existing one.


Item attributes


SetHidden() — Set hidden attribute

void SetHidden(TBool aHidden);

Description

Sets the contact item's hidden attribute.

Arguments

TBool aHidden

ETrue to set the hidden attribute for the item, EFalse to unset it.


SetSystem() — Set system attribute

void SetSystem(TBool aSystem);

Description

Sets the contact item's system attribute.

Arguments

TBool aSystem

ETrue to set the system attribute, EFalse to unset it.


IsHidden() — Get hidden attribute

TBool IsHidden();

Description

Retrieves the value of the contact item's hidden attribute.

Return value

TBool

ETrue if hidden, EFalse if not.


IsSystem() — Get system attribute

TBool IsSystem();

Description

Retrieves the value of the contact item's system attribute.

Return value

TBool

ETrue if system, EFalse if not.


Deletion

Note: the functions in this section are provided for use by Connectivity applications.


IsDeletable() — Is item deletable ?

TBool IsDeletable();

Description

Returns ETrue if the contact item's access count is zero; this means that it is deletable.

Return value

TBool

ETrue if deletable, EFalse if not deletable.


SetDeleteFlag() — Set delete flag

void SetDeleteFlag(TBool aValue);

Description

Sets the contact item's delete flag.

The delete 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.

Arguments

TBool aValue

ETrue to set the delete flag. EFalse to unset it.


IsDeleted() — Is delete flag set ?

TBool IsDeleted();

Description

Retrieves the value of the delete flag, as set by SetDeleteFlag().

Return value

TBool

ETrue if the delete flag is set, EFalse if not.


Access count

Note: the functions in this section are provided for use by Connectivity applications.


IncAccessCount() — Increase access count

void IncAccessCount();

Description

Increment the contact item's access count.


DecAccessCount() — Decrease access count

void DecAccessCount();

Description

Decrements the contact item's access count. If the access count is already zero, it is not decremented any further.


AccessCount() — Get access count

TInt AccessCount() const;

Description

Returns the contact item's access count.

Return value

TInt

The contact item's access count.

EPOC       SDK Home Glossary Indexes Previous Next Up