#include <app/cntitem.h>
class CContactGroup : public CContactItemPlusGroup, public CContactItemPlusGroup |
Public Member Functions | |
---|---|
~CContactGroup() | |
IMPORT_C void | AddContactL(TContactItemId) |
IMPORT_C TBool | ContainsItem(TContactItemId) |
virtual void | ExternalizeL(RWriteStream &) |
IMPORT_C TPtrC | GetGroupLabelL() |
IMPORT_C CContactIdArray * | GroupsJoinedLC() |
IMPORT_C TBool | HasItemLabelField() |
virtual 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) |
virtual IMPORT_C TUid | Type() |
Inherited Enumerations | |
---|---|
CContactItem:@19 | |
CContactItem:@3 |
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.
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.
Parameters | |
---|---|
aContactId | The Id of the contact being added to the group. |
Leave Codes | |
---|---|
KErrAlreadyExists | The contact is already a member of this group. |
IMPORT_C TBool | ContainsItem | ( | TContactItemId | aContactId | ) |
Tests whether a contact item is a member of the group.
Parameters | |
---|---|
aContactId | The ID of the contact item to test. |
void | ExternalizeL | ( | RWriteStream & | aStream | ) | const [virtual] |
Reimplemented from CContactItemPlusGroup::ExternalizeL(RWriteStream &)const
Externalises a CContactGroup object to a write stream.
Parameters | |
---|---|
aStream | Stream to which the object should be externalised. |
IMPORT_C TPtrC | GetGroupLabelL | ( | ) |
Gets the group label.
Leave Codes | |
---|---|
KErrNotFound | The group has no label field (of type KUidContactFieldTemplateLabel). |
IMPORT_C CContactIdArray * | GroupsJoinedLC | ( | ) | const |
Reimplemented from CContactItemPlusGroup::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] |
Reimplemented from CContactItemPlusGroup::InternalizeL(RReadStream &)
Internalises a CContactGroup object from a read stream.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aContactId | The Id of the contact being removed from the group. |
Leave Codes | |
---|---|
KErrNotFound | The contact is not a member of this group. |
IMPORT_C void | SetGroupLabelL | ( | const TDesC & | aLabel | ) |
Sets the group label, replacing any existing one.
Parameters | |
---|---|
aLabel | The new group label. |
Leave Codes | |
---|---|
KErrNotFound | The group has no label field (of type KUidContactFieldTemplateLabel). |
IMPORT_C void | SetSystem | ( | TBool | aSystem | ) |
Reimplemented from CContactItem::SetSystem(TBool)
Sets the value of the group's system attribute.
The system attribute is not currently used in the Contacts Model API.
Parameters | |
---|---|
aSystem | ETrue to set the system attribute, EFalse to unset it. |
IMPORT_C TUid | Type | ( | ) | const [virtual] |
Reimplemented from CContactItem::Type()const
Implements CContactItem::Type().