CContactGroupView Class Reference

#include <app/cntview.h>

Link against: cntview.lib

class CContactGroupView : public CContactViewBase

Inherits from

Public Member Enumerations
enumTGroupType { 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 voidUpdateGroupViewL()
Inherited Attributes
CContactViewBase::iDb
CContactViewBase::iExtension
CContactViewBase::iState
Inherited Enumerations
CContactViewBase:TFunction
CContactViewBase:TSearchType
CContactViewBase:TState
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CContactViewBase::CContactViewBase(const CContactDatabase &)
CContactViewBase::Close(const MContactViewObserver &)
CContactViewBase::CompareContactIds(const CViewContact &,const CViewContact &)
CContactViewBase::CompareContactsAndIdsL(const CViewContact &,const CViewContact &)const
CContactViewBase::CompareFieldsL(const CViewContact &,const CViewContact &)
CContactViewBase::ConstructL()
CContactViewBase::ContactIsSortable(const CViewContact &)
CContactViewBase::ContactsMatchingCriteriaL(const MDesCArray &,RPointerArray< CViewContact > &)
CContactViewBase::ContactsMatchingPrefixL(const MDesCArray &,RPointerArray< CViewContact > &)
CContactViewBase::Error()const
CContactViewBase::FieldsWithSeparatorLC(const RPointerArray< CViewContact > &,TInt,const TDesC &)const
CContactViewBase::FindDefaultViewSortPluginImplL()const
CContactViewBase::FindSortPluginImplL(const TDesC8 &,TBool)const
CContactViewBase::GetContactIdsL(const CArrayFix< TInt > &,CContactIdArray &)
CContactViewBase::GetViewFindConfigPlugin()
CContactViewBase::GetViewSortPluginImplUid()const
CContactViewBase::IdsEqual(const TContactIdWithMapping &,const TContactIdWithMapping &)
CContactViewBase::IdsMatch(const CViewContact &,const CViewContact &)
CContactViewBase::IndexesEqual(const TContactIdWithMapping &,const TContactIdWithMapping &)
CContactViewBase::InsertContactInView(RPointerArray< CViewContact > &,const CViewContact *,TBool,TInt *)const
CContactViewBase::IsContactSortable(const CViewContact &,TContactViewPreferences &)const
CContactViewBase::LoadViewSortPluginL(TUid,TContactViewPreferences &)
CContactViewBase::MatchesCriteriaL(const CViewContact &,const MDesCArray &)
CContactViewBase::MatchesCriteriaL(const CViewContact &,const MDesCArray &,TSearchType)
CContactViewBase::MatchesCriteriaL(const CViewContact &,const MDesCArray &,TSearchType,CContactViewBase::CContactViewBaseExtension *)
CContactViewBase::NotifyObserverAsync(MContactViewObserver &,const TContactViewEvent &)
CContactViewBase::NotifyObservers(const TContactViewEvent &)
CContactViewBase::Open(MContactViewObserver &)
CContactViewBase::OpenL(MContactViewObserver &)
CContactViewBase::SetViewFindConfigPlugin(TUid)
CContactViewBase::SortPluginImpl()const
CContactViewBase::~CContactViewBase()

Detailed Description

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

Member Enumeration Documentation

Enum TGroupType

Defines the types of contact group view.

EnumeratorValueDescription
EShowContactsInGroup

The view contains contact items in the group.

EShowContactsNotInGroup

The view contains contact items not in the group.

EShowContactsNotInAnyGroup

The view contains contact items not in any group.

Constructor & Destructor Documentation

~CContactGroupView ( )

~CContactGroupView()

Destructor

Member Function Documentation

AllFieldsLC ( TInt, const TDesC & )

HBufC *AllFieldsLC(TIntaIndex,
const TDesC &aSeparator
)const [virtual]

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.

ParameterDescription
aIndexThe index into the view of the contact item.
aSeparatorThe string to use to separate the fields.

Returns: Pointer to the contact item descriptor.

AtL ( TInt )

TContactItemId AtL(TIntaIndex)const [virtual]

Reimplemented from CContactViewBase::AtL(TInt)const

Gets the contact item ID at the specified view index.

leave
KErrNotFound aIndex is outside the bounds of the array.
ParameterDescription
aIndexIndex into the group view.

Returns: The contact item ID.

CContactViewBase_Reserved_1 ( TFunction, TAny * )

TAny *CContactViewBase_Reserved_1(TFunctionaFunction,
TAny *aParams
)[virtual]

Reimplemented from CContactViewBase::CContactViewBase_Reserved_1(TFunction,TAny *)

ContactAtL ( TInt )

const CViewContact &ContactAtL(TIntaIndex)const [virtual]

Gets the contact item at the specified view index.

leave
KErrNotFound aIndex is outside the bounds of the array.
ParameterDescription
aIndexIndex into the view of the required item.

Returns: The contact item.

ContactViewPreferences ( )

TContactViewPreferences ContactViewPreferences()[virtual]

Gets the underlying view's view preferences.

Returns: The view preferences.

CountL ( )

TInt CountL()const [virtual]

Gets the number of contact item IDs in the group view.

Returns: The number of contact items in the group view.

FindL ( TContactItemId )

TInt FindL(TContactItemIdaId)const [virtual]

Finds the index into the group view of the specified contact item.

leave
KErrNotReady The view is not ready for use.
ParameterDescription
aIdThe 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.

NewL ( const CContactDatabase &, CContactViewBase &, MContactViewObserver &, const TContactItemId, const TGroupType )

IMPORT_C CContactGroupView *NewL(const CContactDatabase &aDb,
CContactViewBase &aView,
MContactViewObserver &aObserver,
const TContactItemIdaGroupId,
const TGroupTypeaGroupType
)[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

ParameterDescription
aDbThe database containing the contact group.
aViewThe underlying view.
aObserverAn 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.
aGroupIdThe ID of the contact group.
aGroupTypeControls 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.

NewL ( const CContactDatabase &, CContactViewBase &, MContactViewObserver &, const TDesC &, const TGroupType )

IMPORT_C CContactGroupView *NewL(const CContactDatabase &aDb,
CContactViewBase &aView,
MContactViewObserver &aObserver,
const TDesC &aGroupName,
const TGroupTypeaGroupType
)[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

ParameterDescription
aDbThe database containing the contact group.
aViewThe underlying view.
aObserverAn 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.
aGroupNameThe group label.
aGroupTypeControls 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.

NewL ( CContactViewBase &, const CContactDatabase &, MContactViewObserver &, const TContactItemId, const TGroupType )

IMPORT_C CContactGroupView *NewL(CContactViewBase &aView,
const CContactDatabase &aDb,
MContactViewObserver &aObserver,
const TContactItemIdaGroupId,
const TGroupTypeaGroupType
)[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

ParameterDescription
aViewThe underlying view.
aDbThe database containing the contact group.
aObserverAn 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.
aGroupIdThe ID of the contact group.
aGroupTypeControls 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.

NewL ( CContactViewBase &, const CContactDatabase &, MContactViewObserver &, const TDesC &, const TGroupType )

IMPORT_C CContactGroupView *NewL(CContactViewBase &aView,
const CContactDatabase &aDb,
MContactViewObserver &aObserver,
const TDesC &aGroupName,
const TGroupTypeaGroupType
)[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

ParameterDescription
aViewThe underlying view.
aDbThe database containing the contact group.
aObserverAn 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.
aGroupNameThe group label.
aGroupTypeControls 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.

SortOrderL ( )

const RContactViewSortOrder &SortOrderL()const [virtual]

Gets the underlying view's sort order.

Returns: The sort order.

UpdateGroupViewL ( )

IMPORT_C voidUpdateGroupViewL()[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.

leave
KErrNotFound The group, identified by the label or ID specified during construction, does not exist in the database.