class CContactGroup : public CContactItemPlusGroup |
A contact group.
A contact group is a contact item which holds a set of associated contact item IDs. The members of the group may be contact cards, own cards, or even other groups. The group has a label which identifies the group to users, e.g. "family", or "colleagues". The type of a contact group is KUidContactGroup, as returned by Type() .
Objects of this class are constructed using CContactDatabase::CreateContactGroupL() or CreateContactGroupLC(). These functions create the group, optionally with a label, add it to the database, and return a pointer to it.
To create an association between a card and a group, use CContactDatabase::AddContactToGroupL() and to remove the association, use RemoveContactFromGroupL(). To find out which groups a card belongs to, use CContactCard::GroupsJoinedLC() or CContactOwnCard::GroupsJoinedLC() .
The function CContactDatabase::GetGroupIdListL() may be used to retrieve a list of IDs for all groups in the database.
Public Member Functions | |
---|---|
~CContactGroup () | |
IMPORT_C void | AddContactL ( TContactItemId ) |
IMPORT_C TBool | ContainsItem ( TContactItemId ) |
void | ExternalizeL ( RWriteStream &) |
IMPORT_C TPtrC | GetGroupLabelL () |
IMPORT_C CContactIdArray * | GroupsJoinedLC () |
IMPORT_C TBool | HasItemLabelField () |
void | InternalizeL ( RReadStream &) |
IMPORT_C TBool | IsSystem () |
IMPORT_C const CContactIdArray * | ItemsContained () |
IMPORT_C CContactIdArray * | ItemsContainedLC () |
IMPORT_C CContactGroup * | NewL () |
IMPORT_C CContactGroup * | NewLC () |
IMPORT_C void | RemoveContactL ( TContactItemId ) |
IMPORT_C void | ResetItems () |
IMPORT_C void | SetGroupLabelL (const TDesC &) |
IMPORT_C void | SetItems ( CContactIdArray *) |
IMPORT_C void | SetSystem ( TBool ) |
IMPORT_C TUid | Type () |
Private Member Functions | |
---|---|
CContactGroup () |
Inherited Enumerations | |
---|---|
CContactItem:@64 |
Private Attributes | |
---|---|
CContactIdArray * | iItems |
IMPORT_C | ~CContactGroup | ( | ) |
The destructor frees all resources owned by the contact group, prior to its destruction.
IMPORT_C void | AddContactL | ( | TContactItemId | aContactId | ) |
Adds a contact with the given Id to the group. This method doesn't make any changes to the database. The change should be persisted by means of CContactDatabase::CommitContactL() API.
TContactItemId aContactId | The Id of the contact being added to the group. |
IMPORT_C TBool | ContainsItem | ( | TContactItemId | aContactId | ) |
Tests whether a contact item is a member of the group.
TContactItemId aContactId | The ID of the contact item to test. |
void | ExternalizeL | ( | RWriteStream & | aStream | ) | const [virtual] |
Externalises a CContactGroup object to a write stream.
RWriteStream & aStream | Stream to which the object should be externalised. |
IMPORT_C TPtrC | GetGroupLabelL | ( | ) |
Gets the group label.
IMPORT_C CContactIdArray * | GroupsJoinedLC | ( | ) | const |
Returns a pointer to a list of contact groups to which the current group belongs (a contact group can belong to other groups).
IMPORT_C TBool | HasItemLabelField | ( | ) |
Tests whether the group has a label field (of type KUidContactFieldTemplateLabel).
void | InternalizeL | ( | RReadStream & | aStream | ) | [virtual] |
Internalises a CContactGroup object from a read stream.
RReadStream & aStream | Stream from which the object should be internalised. |
IMPORT_C TBool | IsSystem | ( | ) | const |
Tests the value of the group's system attribute.
The system attribute is not currently used in the Contacts Model API.
IMPORT_C const CContactIdArray * | ItemsContained | ( | ) | const |
Returns a constant pointer to the group's list of members.
IMPORT_C CContactIdArray * | ItemsContainedLC | ( | ) | const |
Returns a pointer to a copy of the group's list of members.
IMPORT_C CContactGroup * | NewL | ( | ) | [static] |
Allocates and constructs a new default contact card group. The group has no label and its list of members is NULL.
Contact groups should be constructed using the factory functions provided in class CContactDatabase , for example CreateContactGroupL().
IMPORT_C CContactGroup * | NewLC | ( | ) | [static] |
Allocates and constructs a new default contact card group.
The group has no label and its list of members is NULL.
Contact groups should be constructed using the factory functions provided in class CContactDatabase , for example CreateContactGroupLC().
IMPORT_C void | RemoveContactL | ( | TContactItemId | aContactId | ) |
Removes a contact with the given Id from the group. This method doesn't make any changes to the database. The change should be persisted by means of CContactDatabase::CommitContactL() API.
TContactItemId aContactId | The Id of the contact being removed from the group. |
IMPORT_C void | SetGroupLabelL | ( | const TDesC & | aLabel | ) |
Sets the group label, replacing any existing one.
const TDesC & aLabel | The new group label. |
IMPORT_C void | SetItems | ( | CContactIdArray * | aItems | ) |
Sets groups.
CContactIdArray * aItems |
IMPORT_C void | SetSystem | ( | TBool | aSystem | ) |
Sets the value of the group's system attribute.
The system attribute is not currently used in the Contacts Model API.
TBool aSystem | ETrue to set the system attribute, EFalse to unset it. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.