Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: cntitem.h
Link against: cntmodel.lib

Class CContactOwnCard

CContactOwnCard

Support

Supported from 6.0

Description

Own card. An own card is a contact card which contains information about the device's owner. This can be sent to another compatible electronic device as a vCard. The contact database recognises a single own card — referred to as the current own card; its ID is returned by CContactDatabase::OwnCardId(). Like a contact card, an own card can be a member of one or more contact card groups. The own card type is identified by a UID of KUidContactOwnCard, as returned by Type().

Own cards can be constructed using either CContactDatabase::CreateOwnCardLC() or CreateOwnCardL(). These functions create an own card, based on the system template, add it to the database, set it as the database's current own card and return a pointer to it. To change the database's current own card, use CContactDatabase::SetOwnCardL().

Derivation

CBaseBase class for all classes to be instantiated on the heap
CContactItemThe abstract base class for contact cards, templates and groups
CContactItemPlusGroupAbstract base class for CContactGroup, CContactCard and CContactOwnCard
CContactOwnCardOwn card

Defined in CContactOwnCard:
GroupsJoinedLC(), NewL(), NewLC(), Type(), ~CContactOwnCard()

Inherited from CBase:
operator new()

Inherited from CContactItem:
AccessCount(), AddFieldL(), CardFields(), DecAccessCount(), Id(), IncAccessCount(), InsertFieldL(), IsDeletable(), IsDeleted(), IsHidden(), IsSystem(), LastModified(), RemoveField(), SetDeleteFlag(), SetDeleted(), SetHidden(), SetLastModified(), SetSystem(), SetTemplateRefId(), SetUidStringL(), TemplateRefId(), UidStringL(), UpdateFieldSet()

Inherited from CContactItemPlusGroup:
GroupsJoined()


Construction and destruction


NewL()

static CContactOwnCard* NewL();
static CContactOwnCard* NewL(const CContactItem *aTemplate);

Description

Allocates and constructs a new own card — overloaded function. Its field set may be seeded from a template. The second overload takes a copy of aTemplate — it does not take ownership of it.

Note

Own cards should normally be constructed using the factory functions provided in class CContactDatabase, for example CreateOwnCardL().

Parameters

const CContactItem *aTemplate

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

Return value

CContactOwnCard*

Pointer to the newly created own card.


NewLC()

static CContactOwnCard* NewLC();
static CContactOwnCard* NewLC(const CContactItem *aTemplate);

Description

Allocates and constructs a new own card — overloaded function. Its field set may be seeded from a template. The pointer to the object is left on the cleanup stack. The second overload takes a copy of aTemplate — it does not take ownership of it.

Note

Own cards should normally be constructed using the factory functions provided in class CContactDatabase, for example CreateOwnCardLC().

Parameters

const CContactItem *aTemplate

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

Return value

CContactOwnCard*

Pointer to the newly created own card.


~CContactOwnCard()

~CContactOwnCard();

Description

The destructor frees all resources owned by the own card, prior to its destruction.

[Top]


Type


Type()

TUid Type() const;

Description

Implements the pure virtual function inherited from the base class CContactItem. Returns KUidContactOwnCard.

Return value

TUid

KUidContactOwnCard.

[Top]


Contact card groups


GroupsJoinedLC()

CContactIdArray* GroupsJoinedLC() const;

Description

Returns a pointer to a list of contact item IDs which identify the groups to which the current own card belongs.

Return value

CContactIdArray*

A pointer to a copy of the array of groups IDs to which this own card belongs. This array is empty if the own card is not a member of any groups. The caller takes ownership of this object, so is responsible for its deletion.