#include <app/cntview.h>
class CContactGroupView : public CContactViewBase |
Public Member Enumerations | |
---|---|
enum | TGroupType { EShowContactsInGroup, EShowContactsNotInGroup, EShowContactsNotInAnyGroup } |
Public Member Functions | |
---|---|
~CContactGroupView() | |
virtual HBufC * | AllFieldsLC(TInt, const TDesC &) |
virtual TContactItemId | AtL(TInt) |
virtual TAny * | CContactViewBase_Reserved_1(TFunction, TAny *) |
virtual const CViewContact & | ContactAtL(TInt) |
virtual TContactViewPreferences | ContactViewPreferences() |
virtual TInt | CountL() |
virtual TInt | FindL(TContactItemId) |
IMPORT_C CContactGroupView * | NewL(const CContactDatabase &, CContactViewBase &, MContactViewObserver &, const TContactItemId, const TGroupType) |
IMPORT_C CContactGroupView * | NewL(const CContactDatabase &, CContactViewBase &, MContactViewObserver &, const TDesC &, const TGroupType) |
IMPORT_C CContactGroupView * | NewL(CContactViewBase &, const CContactDatabase &, MContactViewObserver &, const TContactItemId, const TGroupType) |
IMPORT_C CContactGroupView * | NewL(CContactViewBase &, const CContactDatabase &, MContactViewObserver &, const TDesC &, const TGroupType) |
virtual const RContactViewSortOrder & | SortOrderL() |
Protected Member Functions | |
---|---|
virtual IMPORT_C void | UpdateGroupViewL() |
Inherited Attributes | |
---|---|
CContactViewBase::iDb | |
CContactViewBase::iExtension | |
CContactViewBase::iState |
Inherited Enumerations | |
---|---|
CContactViewBase:TFunction | |
CContactViewBase:TSearchType | |
CContactViewBase:TState |
Provides a view of a group of contact items.
The view uses an underlying view. For items to appear in the group view, they must exist in the underlying view.
The TGroupType enumeration defines whether the view displays items that belong to the group, items that do not belong to the group, or items that do not belong to any group.
The group view observes its underlying view so that it is kept up to date if the contents of the underlying view change.
The group can be identified by a contact item ID or by a label, e.g. "family", or "colleagues".
See also: CContactGroup
Reimplemented from CContactViewBase::AllFieldsLC(TInt,const TDesC &)const
Gets a descriptor containing the contents of all fields in an item in the view.
The fields are separated by aSeparator.
Parameter | Description |
---|---|
aIndex | The index into the view of the contact item. |
aSeparator | The string to use to separate the fields. |
Returns: Pointer to the contact item descriptor.
TContactItemId | AtL | ( | TInt | aIndex | ) | const [virtual] |
Reimplemented from CContactViewBase::AtL(TInt)const
Gets the contact item ID at the specified view index.
Parameter | Description |
---|---|
aIndex | Index into the group view. |
Returns: The contact item ID.
Reimplemented from CContactViewBase::CContactViewBase_Reserved_1(TFunction,TAny *)
const CViewContact & | ContactAtL | ( | TInt | aIndex | ) | const [virtual] |
Reimplemented from CContactViewBase::ContactAtL(TInt)const
Gets the contact item at the specified view index.
Parameter | Description |
---|---|
aIndex | Index into the view of the required item. |
Returns: The contact item.
TContactViewPreferences | ContactViewPreferences | ( | ) | [virtual] |
Reimplemented from CContactViewBase::ContactViewPreferences()
Gets the underlying view's view preferences.
Returns: The view preferences.
TInt | CountL | ( | ) | const [virtual] |
Reimplemented from CContactViewBase::CountL()const
Gets the number of contact item IDs in the group view.
Returns: The number of contact items in the group view.
TInt | FindL | ( | TContactItemId | aId | ) | const [virtual] |
Reimplemented from CContactViewBase::FindL(TContactItemId)const
Finds the index into the group view of the specified contact item.
Parameter | Description |
---|---|
aId | The contact item ID to search for. |
Returns: The index of the first matching item in the view or KErrNotFound if no matching item can be found.
IMPORT_C CContactGroupView * | NewL | ( | const CContactDatabase & | aDb, |
CContactViewBase & | aView, | |||
MContactViewObserver & | aObserver, | |||
const TContactItemId | aGroupId, | |||
const TGroupType | aGroupType | |||
) | [static] |
Allocates and constructs a CContactGroupView version 1 object, identifying the group by its ID.
A group with the specified ID must exist in the database, otherwise when an attempt is made to update the view, a leave will occur with KErrNotFound. To create an unfiled view, the group id must be KNullContactId and the group type 'EShowContactsNotInAnyGroup'. In this case the group id isn't used and no leave will occur.
When adding contacts in the view, MContactViewObserver observer will receive TContactViewEvent events with iInt parameter set to KErrNone. When deleting contacts in the view, MContactViewObserver observer will receive TContactViewEvent events with iInt parameter set to index into the observed view of the deleted item
Parameter | Description |
---|---|
aDb | The database containing the contact group. |
aView | The underlying view. |
aObserver | An observer that receives notifications when this view is ready for use and when changes take place in it. The observer receives a TContactViewEvent::EReady event when the view is ready. An attempt to use the view before this notification causes a panic. |
aGroupId | The ID of the contact group. |
aGroupType | Controls whether the view displays items belonging to the group, items that do not belong to the group or items that do not belong to any group. |
Returns: The newly constructed group view object.
IMPORT_C CContactGroupView * | NewL | ( | const CContactDatabase & | aDb, |
CContactViewBase & | aView, | |||
MContactViewObserver & | aObserver, | |||
const TDesC & | aGroupName, | |||
const TGroupType | aGroupType | |||
) | [static] |
Allocates and constructs a CContactGroupView version 1 object, identifying the group by its label.
A group with the specified label must exist in the database, otherwise when an attempt is made to update the view, a leave will occur with KErrNotFound.
When adding contacts in the view, MContactViewObserver observer will receive TContactViewEvent events with iInt parameter set to KErrNone. When deleting contacts in the view, MContactViewObserver observer will receive TContactViewEvent events with iInt parameter set to index into the observed view of the deleted item
Parameter | Description |
---|---|
aDb | The database containing the contact group. |
aView | The underlying view. |
aObserver | An observer that receives notifications when this view is ready for use and when changes take place in it. The observer receives a TContactViewEvent::EReady event when the view is ready. An attempt to use the view before this notification causes a panic. |
aGroupName | The group label. |
aGroupType | Controls whether the view displays items belonging to the group, items that do not belong to the group or items that do not belong to any group. |
Returns: The newly constructed group view object.
IMPORT_C CContactGroupView * | NewL | ( | CContactViewBase & | aView, |
const CContactDatabase & | aDb, | |||
MContactViewObserver & | aObserver, | |||
const TContactItemId | aGroupId, | |||
const TGroupType | aGroupType | |||
) | [static] |
Allocates and constructs a CContactGroupView version 2 object, identifying the group by its ID.
A group with the specified ID must exist in the database, otherwise when an attempt is made to update the view, a leave will occur with KErrNotFound. To create an unfiled view, the group id must be KNullContactId and the group type 'EShowContactsNotInAnyGroup'. In this case the group id isn't used and no leave will occur.
When adding/deleting contacts in the view, MContactViewObserver observer will receive TContactViewEvent events with iInt parameter set to index into the observed view of the added/deleted item
Parameter | Description |
---|---|
aView | The underlying view. |
aDb | The database containing the contact group. |
aObserver | An observer that receives notifications when this view is ready for use and when changes take place in it. The observer receives a TContactViewEvent::EReady event when the view is ready. An attempt to use the view before this notification causes a panic. |
aGroupId | The ID of the contact group. |
aGroupType | Controls whether the view displays items belonging to the group, items that do not belong to the group or items that do not belong to any group. |
Returns: The newly constructed group view object.
IMPORT_C CContactGroupView * | NewL | ( | CContactViewBase & | aView, |
const CContactDatabase & | aDb, | |||
MContactViewObserver & | aObserver, | |||
const TDesC & | aGroupName, | |||
const TGroupType | aGroupType | |||
) | [static] |
Allocates and constructs a CContactGroupView version 2 object, identifying the group by its label.
A group with the specified label must exist in the database, otherwise when an attempt is made to update the view, a leave will occur with KErrNotFound.
When adding/deleting contacts in the view, MContactViewObserver observer will receive TContactViewEvent events with iInt parameter set to index into the observed view of the added/deleted item
Parameter | Description |
---|---|
aView | The underlying view. |
aDb | The database containing the contact group. |
aObserver | An observer that receives notifications when this view is ready for use and when changes take place in it. The observer receives a TContactViewEvent::EReady event when the view is ready. An attempt to use the view before this notification causes a panic. |
aGroupName | The group label. |
aGroupType | Controls whether the view displays items belonging to the group, items that do not belong to the group or items that do not belong to any group. |
Returns: The newly constructed group view object.
const RContactViewSortOrder & | SortOrderL | ( | ) | const [virtual] |
Reimplemented from CContactViewBase::SortOrderL()const
Gets the underlying view's sort order.
Returns: The sort order.
IMPORT_C void | UpdateGroupViewL | ( | ) | [protected, virtual] |
Populates the group view.
Removes any existing items from the group view then searches the underlying view. The group view is repopulated with those items, maintaining the order in which they occur in the underlying view.