#include <app/cntitem.h>
class CContactGroup : 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:@64 |
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.
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aContactId | The ID of the contact item to test. |
Returns: ETrue if the item is a member of the group, EFalse if not.
void | ExternalizeL | ( | RWriteStream & | aStream | ) | const [virtual] |
Reimplemented from CContactItemPlusGroup::ExternalizeL(RWriteStream &)const
Externalises a CContactGroup object to a write stream.
Parameter | Description |
---|---|
aStream | Stream to which the object should be externalised. |
IMPORT_C TPtrC | GetGroupLabelL | ( | ) |
Gets the group label.
Returns: The new group label.
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).
Returns: A pointer to a copy of the array of groups IDs to which this group belongs. This array is empty if the group is not a member of any other groups. The caller takes ownership of this object, so is responsible for its deletion.
IMPORT_C TBool | HasItemLabelField | ( | ) |
Tests whether the group has a label field (of type KUidContactFieldTemplateLabel).
Returns: ETrue if the group has a label field. EFalse if not.
void | InternalizeL | ( | RReadStream & | aStream | ) | [virtual] |
Reimplemented from CContactItemPlusGroup::InternalizeL(RReadStream &)
Internalises a CContactGroup object from a read stream.
Parameter | Description |
---|---|
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.
Returns: ETrue if system, EFalse if not.
IMPORT_C const CContactIdArray * | ItemsContained | ( | ) | const |
Returns a constant pointer to the group's list of members.
Returns: 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.
Returns: Pointer to a copy of the group's list of members. This is left on the cleanup stack.
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().
Returns: Pointer to the new contact card group.
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().
Returns: Pointer to the new contact card group. This is left on the cleanup stack.
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.
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aLabel | The new group label. |
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.
Parameter | Description |
---|---|
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().
Returns: KUidContactGroup.