CContactFilteredView Class Reference

class CContactFilteredView : public CContactViewBase

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.

Inherits from

Public Member Functions
~CContactFilteredView()
HBufC *AllFieldsLC(TInt, const TDesC &)
TContactItemId AtL(TInt)
TAny *CContactViewBase_Reserved_1(TFunction, TAny *)
const CViewContact &ContactAtL(TInt)
TContactViewPreferences ContactViewPreferences()
voidContactsMatchingCriteriaL(const MDesCArray &, RPointerArray< CViewContact > &)
voidContactsMatchingPrefixL(const MDesCArray &, RPointerArray< CViewContact > &)
TInt CountL()
TInt FindL(TContactItemId)
IMPORT_C CContactFilteredView *NewL(MContactViewObserver &, const CContactDatabase &, CContactViewBase &, TInt)
IMPORT_C CContactFilteredView *NewL(CContactViewBase &, const CContactDatabase &, MContactViewObserver &, TInt)
const RContactViewSortOrder &SortOrderL()
Private Member Functions
CContactFilteredView(const CContactDatabase &, TInt, CContactViewBase &)
TInt BinaryInsertL(TContactIdWithMapping)
TBool CompareMappings(const TContactIdWithMapping &, const TContactIdWithMapping &)
voidConstructL(MContactViewObserver &)
voidCreateFilteredIdArray()
TInt DoFilterIncrementL()
TInt FilterCallBack(TAny *)
voidFilterResultsArray(RPointerArray< CViewContact > &)
voidHandleAddEventL(TContactViewEvent &, TBool &)
voidHandleContactViewEvent(const CContactViewBase &, const TContactViewEvent &)
voidHandleRemoveEventL(TContactViewEvent &, TBool &)
voidUpdateFilteredIdArrayL(TContactViewEvent &, TBool &)
voidUpdateMappingsL()
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::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()
Inherited Enumerations
CContactViewBase:TFunction
CContactViewBase:TSearchType
CContactViewBase:TState
Private Attributes
TUint iClassVersion
const TIntiFilter
RArray< TContactIdWithMapping >iFilteredIdArray
CContactViewBase &iView
Inherited Attributes
CContactViewBase::iDb
CContactViewBase::iExtension
CContactViewBase::iState

Constructor & Destructor Documentation

CContactFilteredView(const CContactDatabase &, TInt, CContactViewBase &)

CContactFilteredView(const CContactDatabase &aDb,
TIntaFilter,
CContactViewBase &aView
)[private]

Parameters

const CContactDatabase & aDb
TInt aFilter
CContactViewBase & aView

~CContactFilteredView()

~CContactFilteredView()

Member Functions Documentation

AllFieldsLC(TInt, const TDesC &)

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

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

The fields are separated by aSeparator.

Parameters

TInt aIndexThe index into the filtered view of the contact item.
const TDesC & aSeparatorThe string to use to separate the fields.

AtL(TInt)

TContactItemId AtL(TIntaIndex)const [virtual]

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

leave
KErrNotReady The view is not ready for use.
leave
KErrNotFound aIndex is outside the bounds of the filtered view.

Parameters

TInt aIndexIndex of the contact item ID into the filtered view.

BinaryInsertL(TContactIdWithMapping)

TInt BinaryInsertL(TContactIdWithMappingaId)[private]

Parameters

TContactIdWithMapping aId

CContactViewBase_Reserved_1(TFunction, TAny *)

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

Parameters

TFunction aFunction
TAny * aParams

CompareMappings(const TContactIdWithMapping &, const TContactIdWithMapping &)

TBool CompareMappings(const TContactIdWithMapping &aFirst,
const TContactIdWithMapping &aSecond
)[private, static]

Parameters

const TContactIdWithMapping & aFirst
const TContactIdWithMapping & aSecond

ConstructL(MContactViewObserver &)

voidConstructL(MContactViewObserver &aObserver)[private]

Parameters

MContactViewObserver & aObserver

ContactAtL(TInt)

const CViewContact &ContactAtL(TIntaIndex)const [virtual]

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

leave
KErrNotReady The view is not ready for use.
leave
KErrNotFound aIndex is outside the bounds of the filtered ID array.

Parameters

TInt aIndexIndex into the view of the required item.

ContactViewPreferences()

TContactViewPreferences ContactViewPreferences()[virtual]

Gets the underlying view's view preferences.

ContactsMatchingCriteriaL(const MDesCArray &, RPointerArray< CViewContact > &)

voidContactsMatchingCriteriaL(const MDesCArray &aFindWords,
RPointerArray< CViewContact > &aMatchedContacts
)[virtual]

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 MDesCArray & aFindWordsA descriptor array containing one or more search strings.
RPointerArray< CViewContact > & aMatchedContactsOn return, an array of matching contact items.

ContactsMatchingPrefixL(const MDesCArray &, RPointerArray< CViewContact > &)

voidContactsMatchingPrefixL(const MDesCArray &aFindWords,
RPointerArray< CViewContact > &aMatchedContacts
)[virtual]

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 MDesCArray & aFindWordsA descriptor array containing one or more search strings.
RPointerArray< CViewContact > & aMatchedContactsOn return, an array of matching contact items.

CountL()

TInt CountL()const [virtual]
Gets the number of contact item IDs in the filtered view.
leave
KErrNotReady The view is not ready for use.

CreateFilteredIdArray()

voidCreateFilteredIdArray()[private]

DoFilterIncrementL()

TInt DoFilterIncrementL()[private]

FilterCallBack(TAny *)

TInt FilterCallBack(TAny *aSelf)[private, static]

Parameters

TAny * aSelf

FilterResultsArray(RPointerArray< CViewContact > &)

voidFilterResultsArray(RPointerArray< CViewContact > &aMatchedContacts)[private]

Parameters

RPointerArray< CViewContact > & aMatchedContacts

FindL(TContactItemId)

TInt FindL(TContactItemIdaId)const [virtual]

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

leave
KErrNotReady The view is not ready for use.

Parameters

TContactItemId aIdThe contact item ID to search for.

HandleAddEventL(TContactViewEvent &, TBool &)

voidHandleAddEventL(TContactViewEvent &aEvent,
TBool &aViewModified
)[private]

Parameters

TContactViewEvent & aEvent
TBool & aViewModified

HandleContactViewEvent(const CContactViewBase &, const TContactViewEvent &)

voidHandleContactViewEvent(const CContactViewBase &aView,
const TContactViewEvent &aEvent
)[private, virtual]

Parameters

const CContactViewBase & aView
const TContactViewEvent & aEvent

HandleRemoveEventL(TContactViewEvent &, TBool &)

voidHandleRemoveEventL(TContactViewEvent &aEvent,
TBool &aViewModified
)[private]

Parameters

TContactViewEvent & aEvent
TBool & aViewModified

NewL(MContactViewObserver &, const CContactDatabase &, CContactViewBase &, TInt)

IMPORT_C CContactFilteredView *NewL(MContactViewObserver &aObserver,
const CContactDatabase &aDb,
CContactViewBase &aView,
TIntaFilter
)[static]

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 & 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.
const CContactDatabase & aDbThe database containing the contact items.
CContactViewBase & aViewThe underlying contact view over which this view provides a filter.
TInt aFilterThe filter to use. For possible values, see CContactDatabase::TContactViewFilter.

NewL(CContactViewBase &, const CContactDatabase &, MContactViewObserver &, TInt)

IMPORT_C CContactFilteredView *NewL(CContactViewBase &aView,
const CContactDatabase &aDb,
MContactViewObserver &aObserver,
TIntaFilter
)[static]

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 & aViewThe underlying contact view over which this view provides a filter.
const CContactDatabase & aDbThe database containing the contact items.
MContactViewObserver & 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.
TInt aFilterThe filter to use. For possible values, see CContactDatabase::TContactViewFilter.

SortOrderL()

const RContactViewSortOrder &SortOrderL()const [virtual]

Gets the underlying view's sort order.

UpdateFilteredIdArrayL(TContactViewEvent &, TBool &)

voidUpdateFilteredIdArrayL(TContactViewEvent &aEvent,
TBool &aViewModified
)[private]

Parameters

TContactViewEvent & aEvent
TBool & aViewModified

UpdateMappingsL()

voidUpdateMappingsL()[private]

Member Data Documentation

TUint iClassVersion

TUint iClassVersion[private]

const TInt iFilter

const TIntiFilter[private]

RArray< TContactIdWithMapping > iFilteredIdArray

RArray< TContactIdWithMapping >iFilteredIdArray[private]

CContactViewBase & iView

CContactViewBase &iView[private]