Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: cntview.h
Link against: cntview.lib

Class CContactFilteredView

class CContactFilteredView : public CContactViewBase, public MContactViewObserver;

Description

Provides a filtered view over an existing CContactViewBase derived object.

For example, it might provide a view containing only contacts that have an email address. For efficiency reasons there are a limited set of filters available (defined in CContactDatabase::TContactViewFilter).

The filtered view observes its underlying view so that it is kept up to date if the contents of the underlying view change. It will, in turn, notify its observers.

Filters only apply to non-hidden contact fields with content.

Derivation

Members

Defined in CContactFilteredView:
AllFieldsLC(), AtL(), CContactViewBase_Reserved_1(), ContactAtL(), ContactViewPreferences(), ContactsMatchingCriteriaL(), ContactsMatchingPrefixL(), CountL(), FindL(), HandleContactViewEvent(), NewL(), NewL(), SortOrderL()

Inherited from CBase:
Delete(), Extension_(), operator new()

Inherited from CContactViewBase:
Close(), CompareFieldsL(), ConstructL(), ECContactViewBaseVirtualFunction1, ECContactViewBaseVirtualFunction2, ECContactViewBaseVirtualFunction3, EFullSearch, EInitializing, ENotReady, EPrefixSearch, EReady, Error(), FieldsWithSeparatorLC(), GetContactIdsL(), GetViewFindConfigPlugin(), IdsEqual(), IdsMatch(), IndexesEqual(), MatchesCriteriaL(), NotifyObserverAsync(), NotifyObservers(), Open(), OpenL(), SetViewFindConfigPlugin(), TFunction, TSearchType, TState, TVirtualFunction1Params, TVirtualFunction2Params, iDb, iExtension, iState

See also


Construction and destruction


NewL()

static IMPORT_C CContactFilteredView *NewL(MContactViewObserver &aObserver, const CContactDatabase &aDb, CContactViewBase &aView, TInt aFilter);

Description

Allocates and constructs a CContactFilteredView version 1 object.

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

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 containing the contact items.

CContactViewBase &aView

The underlying contact view over which this view provides a filter.

TInt aFilter

The filter to use. For possible values, see CContactDatabase::TContactViewFilter.

Return value

CContactFilteredView *

The newly constructed filtered view object.


NewL()

static IMPORT_C CContactFilteredView *NewL(CContactViewBase &aView, const CContactDatabase &aDb, MContactViewObserver &aObserver, TInt aFilter);

Description

Allocates and constructs a CContactFilteredView version 2 object.

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

Parameters

CContactViewBase &aView

The underlying contact view over which this view provides a filter.

const CContactDatabase &aDb

The database containing the contact items.

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.

TInt aFilter

The filter to use. For possible values, see CContactDatabase::TContactViewFilter.

Return value

CContactFilteredView *

The newly constructed filtered 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 filtered view.

Parameters

TInt aIndex

Index of the contact item ID into the filtered view.

Return value

TContactItemId

The contact item ID.

Leave codes

KErrNotReady

The view is not ready for use.

KErrNotFound

aIndex is outside the bounds of the filtered view.


CountL()

virtual TInt CountL() const;

Description

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

Return value

TInt

The number of contact items in the filtered view.

Leave codes

KErrNotReady

The view is not ready for use.


FindL()

virtual TInt FindL(TContactItemId aId) const;

Description

Finds the index into the filtered 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 array or KErrNotFound if no matching object 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 for an item in the view.

The fields are separated by aSeparator.

Parameters

TInt aIndex

The index into the filtered view of the contact item.

const TDesC &aSeparator

The string to use to separate the fields.

Return value

HBufC *

Pointer to the specified contact item descriptor.


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 of the required item.

Return value

const CViewContact &

The contact item.

Leave codes

KErrNotReady

The view is not ready for use.

KErrNotFound

aIndex is outside the bounds of the filtered ID array.


ContactViewPreferences()

virtual TContactViewPreferences ContactViewPreferences();

Description

Gets the underlying view's view preferences.

Return value

TContactViewPreferences

The view preferences.


SortOrderL()

virtual const RContactViewSortOrder &SortOrderL() const;

Description

Gets the underlying view's sort order.

Return value

const RContactViewSortOrder &

The sort order.


ContactsMatchingCriteriaL()

virtual void ContactsMatchingCriteriaL(const MDesC16Array &aFindWords, RPointerArray< CViewContact > &aMatchedContacts);

Description

Searches all contact items in the filtered view for fields that contain all of the search strings specified.

The search uses wildcard matching so that the search strings can occur anywhere in an item's fields. For a match to occur, all of the search strings must be found in the contact item.

Parameters

const MDesC16Array &aFindWords

A descriptor array containing one or more search strings.

RPointerArray< CViewContact > &aMatchedContacts

On return, an array of matching contact items.


ContactsMatchingPrefixL()

virtual void ContactsMatchingPrefixL(const MDesC16Array &aFindWords, RPointerArray< CViewContact > &aMatchedContacts);

Description

Searches all contact items in the filtered view for fields that contain all of the search strings specified.

Unlike ContactsMatchingCriteriaL(), the search term can only occur at the beginning of a field.

Parameters

const MDesC16Array &aFindWords

A descriptor array containing one or more search strings.

RPointerArray< CViewContact > &aMatchedContacts

On return, an array of matching contact items.


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.