Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <CNTITEM.H>
Link against: cntmodel.lib

Class CContactCardTemplate

class CContactCardTemplate : public CContactItem;

Description

A contact card template.

This is a contact item containing a set of fields on which new contact items can be based. Templates have a label which is a string which identifies the template to a user. For instance, 'work template' could indicate a template used to create contact cards in the style of a work colleague. Contact card templates have a type of KUidContactCardTemplate, as returned by Type().

Objects of this class cannot be constructed directly because its constructors are protected. Instead, use either CContactDatabase::CreateContactCardTemplateL() or CreateContactCardTemplateLC(). These functions create a contact card template, add it to the database, and return a pointer to it.

The function CContactDatabase::GetCardTemplateIdListL() gets a list of the IDs of all contact card templates in the database.

Derivation

Members

Defined in CContactCardTemplate:

Inherited from CBase:

Inherited from CContactItem:


Construction and destruction


NewL()

protected: static IMPORT_C CContactCardTemplate *NewL();

Description

Allocates and constructs a new Contact Card Template .

Return value

CContactCardTemplate *

Pointer to the newly created Contact Card Template.


NewLC()

protected: static IMPORT_C CContactCardTemplate *NewLC();

Description

Allocates and constructs a new Contact Card Template .

Return value

CContactCardTemplate *

Pointer to the newly created Contact Card Template. This is left on the cleanup stack.


NewL()

protected: static IMPORT_C CContactCardTemplate *NewL(const CContactItem *aTemplate);

Description

Allocates and constructs a new Contact Card Template .

Parameters

const CContactItem *aTemplate

Pointer to the template whose field set and field data are copied into the new contact card template

Return value

CContactCardTemplate *

Pointer to the newly created Contact Card Template.


NewLC()

protected: static IMPORT_C CContactCardTemplate *NewLC(const CContactItem *aTemplate);

Description

Allocates and constructs a new Contact Card Template .

Parameters

const CContactItem *aTemplate

Pointer to the template whose field set and field data are copied into the new contact card template

Return value

CContactCardTemplate *

Pointer to the newly created Contact Card Template. This is left on the cleanup stack.

[Top]


Member functions


SetTemplateLabelL()

IMPORT_C void SetTemplateLabelL(const TDesC &aLabel);

Description

Changes the label for a contact card template. The label is initialised when the template is created. The template label is stored in a text field in the template. This field has a unique content type mapping of KUidContactFieldTemplateLabel. By default, this field is the first field in the field set; it must not be moved from this position.

Parameters

const TDesC &aLabel

The new template label.

Leave codes

KErrNotFound

Indicates there is no template label field in the template.


GetTemplateLabelL()

IMPORT_C TPtrC GetTemplateLabelL();

Description

Gets the label for a contact card template.

Return value

TPtrC

The template label.

Leave codes

KErrNotFound

Indicates there is no template label field in the template.


HasItemLabelField()

protected: IMPORT_C TBool HasItemLabelField();

Description

Tests whether a Template label field is present.

Return value

TBool

ETrue if Template Label Field is present, EFalse otherwise.


ReservedFunction1()

protected: IMPORT_C void ReservedFunction1();

Description

Intended usage: Reserved to preserve future BC


ReservedFunction2()

protected: IMPORT_C void ReservedFunction2();

Description

Intended usage: Reserved to preserve future BC


Type()

protected: virtual IMPORT_C TUid Type() const;

Description

Gets the contact item's type.

Return value

TUid

The contact item's type.