Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <cntview.h>
Link against: cntview.lib

Class CContactConcatenatedView

class CContactConcatenatedView : public CContactViewBase, public MContactViewObserver;

Description

Concatenates multiple contact views into a single contiguous view.

The component views are ordered according to their order in the array passed into the NewL().

Derivation

Members

Defined in CContactConcatenatedView:

Inherited from CBase:

Inherited from CContactViewBase:


Construction and destruction


NewL()

static IMPORT_C CContactConcatenatedView *NewL(MContactViewObserver &aObserver, const CContactDatabase &aDb, RPointerArray< CContactViewBase > &aComponentViews);

Description

Allocates and constructs a new CContactConcatenatedView object,

Parameters

MContactViewObserver &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.

const CContactDatabase &aDb

The database that contains the contact items.

RPointerArray< CContactViewBase > &aComponentViews

An array of pointers to the component views to append to this view. The concatenated view creates its own copy of this array and sets itself to be the observer of each of the component views, unless an error occurs, in which case the function leaves.

Return value

CContactConcatenatedView *

The newly constructed concatenated view object.

[Top]


Member functions


CContactViewBase_Reserved_1()

Capability: ReadUserData

virtual TAny *CContactViewBase_Reserved_1(TFunction aFunction, TAny *aParams);

Description

This is a reserved virtual exported function that is used for BC proofing against addition of new exported virtual functions. This function now aids addition of new exported virtual methods without having to break BC,by simply having those virtual methods as non-virtual and helper methods, called from this one and only reserved virtual exported method.A public enumeration type that is defined in the base class CContactViewBase identifies which of the helper 'virtual' methods are being called. All derived classes of CContactViewBase that are public should mandatorily implement this method.

Returns any return values of the helper methods called from this function.

Parameters

TFunction aFunction

an enum value that identifies which helper method is called.

TAny *aParams

parameters to the helper method being called.

Return value

TAny *

Any return values of the helper methods called from this function or NULL.


AtL()

virtual TContactItemId AtL(TInt aIndex) const;

Description

Gets the contact item ID at the specified index into the concatenated view.

Parameters

TInt aIndex

Index into the concatenated view.

Return value

TContactItemId

The contact item ID.

Leave codes

KErrNotReady

The view is not ready for use.

KErrNotFound

The index is out of bounds. It must be less than the total number of items in all component views.


CountL()

virtual TInt CountL() const;

Description

Gets the number of contact items in the concatenated view.

This is the total number of items in all component views.

Return value

TInt

The number of items in the concatenated view.

Leave codes

KErrNotReady

The view is not ready for use.


FindL()

virtual TInt FindL(TContactItemId aId) const;

Description

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

Parameters

TContactItemId aId

The contact item ID to search for.

Return value

TInt

The index of the first matching item in the concatenated view or KErrNotFound if no matching item can be found.

Leave codes

KErrNotReady

The view is not ready for use.


AllFieldsLC()

virtual HBufC *AllFieldsLC(TInt aIndex, const TDesC &aSeparator) const;

Description

Returns a descriptor containing the contents of all fields in an item in the view.

The fields are separated by aSeparator.

Parameters

TInt aIndex

The index into the view of the contact item.

const TDesC &aSeparator

The string to use to separate the fields.

Return value

HBufC *

Pointer to the contact item descriptor.

Leave codes

KErrNotReady

The view is not ready for use.

Panic codes

CNTMODEL

29 In debug builds, this indicates that the index is invalid. It must be less that the total number of items in the concatenated view. In release builds, a NULL pointer is returned instead.


ContactAtL()

virtual const CViewContact &ContactAtL(TInt aIndex) const;

Description

Gets the contact item at the specified index into the view.

Parameters

TInt aIndex

Index into the view.

Return value

const CViewContact &

The contact item.

Leave codes

KErrNotReady

The view is not ready for use.

KErrNotFound

The index is invalid. It must be less that the total number of items in the concatenated view.


ContactViewPreferences()

virtual TContactViewPreferences ContactViewPreferences();

Description

Gets the view preferences for the first component view.

Return value

TContactViewPreferences

The view preferences.


SortOrderL()

virtual const RContactViewSortOrder &SortOrderL() const;

Description

Gets the sort order for the first component view.

Return value

const RContactViewSortOrder &

The sort order.


HandleContactViewEvent()

private: virtual void HandleContactViewEvent(const CContactViewBase &aView, const TContactViewEvent &aEvent);

Description

Handles an event in an observed contact view.

Parameters

const CContactViewBase &aView

The contact view causing the notification.

const TContactViewEvent &aEvent

The event.