CContactFindView Class Reference

#include <app/cntview.h>

Link against: cntview.lib

class CContactFindView : public CContactViewBase

Inherits from

Public Member Functions
~CContactFindView()
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 CContactFindView *NewL(const CContactDatabase &, CContactViewBase &, MContactViewObserver &, MDesCArray *)
IMPORT_C CContactFindView *NewL(const CContactDatabase &, CContactViewBase &, MContactViewObserver &, MDesCArray *, TSearchType)
IMPORT_C CContactFindView *NewL(CContactViewBase &, const CContactDatabase &, MContactViewObserver &, MDesCArray *)
IMPORT_C CContactFindView *NewL(CContactViewBase &, const CContactDatabase &, MContactViewObserver &, MDesCArray *, TSearchType)
IMPORT_C voidRefineFindViewL(MDesCArray *)
virtual const RContactViewSortOrder &SortOrderL()
Protected Member Functions
virtual IMPORT_C voidUpdateFindViewL()
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 an existing CContactViewBase-derived object, populated using search criteria.

The find view only contains contact items from the underlying view that match the search criteria.

The find view observes its underlying view so that it is kept up to date if the contents of the underlying view change.

The search criteria (one or more words) are held in an MDesCArray object. The fields involved in the search are those that have been used to sort the underlying view.

Constructor & Destructor Documentation

~CContactFindView ( )

~CContactFindView()

Destructor

Member Function Documentation

AllFieldsLC ( TInt, const TDesC & )

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

Reimplemented from CContactViewBase::AllFieldsLC(TInt,const TDesC &)const

Returns 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 index into the find view.

leave
KErrNotFound aIndex is outside the bounds of the array.
ParameterDescription
aIndexIndex of the contact item ID into the find 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 *)

This is a reserved virtual exported function that is used for BC proofing against present and future additions of new exported virtual functions.

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

ContactAtL ( TInt )

const CViewContact &ContactAtL(TIntaIndex)const [virtual]

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

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 find view.

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

FindL ( TContactItemId )

TInt FindL(TContactItemIdaId)const [virtual]

Finds the index into the array 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 find view or KErrNotFound if no matching item can be found.

NewL ( const CContactDatabase &, CContactViewBase &, MContactViewObserver &, MDesCArray * )

IMPORT_C CContactFindView *NewL(const CContactDatabase &aDb,
CContactViewBase &aView,
MContactViewObserver &aObserver,
MDesCArray *aFindWords
)[static]

Allocates and constructs a new CContactFindView version 1 object, using a default search type of CContactViewBase::EFullSearch.

When adding/deleting contacts in the view, MContactViewObserver observer will receive TContactViewEvent events with iInt parameter set to KErrNone.

ParameterDescription
aDbThe database containing the contact items.
aViewThe underlying contact 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.
aFindWordsThe array of search terms. The view does not take ownership of this - it makes its own copy of it to prevent it from going out of scope.

Returns: The newly constructed find view object.

NewL ( const CContactDatabase &, CContactViewBase &, MContactViewObserver &, MDesCArray *, TSearchType )

IMPORT_C CContactFindView *NewL(const CContactDatabase &aDb,
CContactViewBase &aView,
MContactViewObserver &aObserver,
MDesCArray *aFindWords,
TSearchTypeaSearchType
)[static]

Allocates and constructs a new CContactFindView version 1 object, specifying a search type.

When adding/deleting contacts in the view, MContactViewObserver observer will receive TContactViewEvent events with iInt parameter set to KErrNone.

ParameterDescription
aDbThe database containing the contact items.
aViewThe underlying contact 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.
aFindWordsThe array of search terms. The view does not take ownership of this - it makes its own copy of it to prevent it from going out of scope.
aSearchTypeThe search type. This controls whether a search term can occur anywhere in a contact item field, or just at the beginning of the field.

Returns: The newly constructed find view object.

NewL ( CContactViewBase &, const CContactDatabase &, MContactViewObserver &, MDesCArray * )

IMPORT_C CContactFindView *NewL(CContactViewBase &aView,
const CContactDatabase &aDb,
MContactViewObserver &aObserver,
MDesCArray *aFindWords
)[static]

Allocates and constructs a new CContactFindView version 2 object, using a default search type of CContactViewBase::EFullSearch.

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 contact view.
aDbThe database containing the contact items.
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.
aFindWordsThe array of search terms. The view does not take ownership of this - it makes its own copy of it to prevent it from going out of scope.

Returns: The newly constructed find view object.

NewL ( CContactViewBase &, const CContactDatabase &, MContactViewObserver &, MDesCArray *, TSearchType )

IMPORT_C CContactFindView *NewL(CContactViewBase &aView,
const CContactDatabase &aDb,
MContactViewObserver &aObserver,
MDesCArray *aFindWords,
TSearchTypeaSearchType
)[static]

Allocates and constructs a new CContactFindView version 2 object, specifying a search type.

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 contact view.
aDbThe database containing the contact items.
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.
aFindWordsThe array of search terms. The view does not take ownership of this - it makes its own copy of it to prevent it from going out of scope.
aSearchTypeThe search type. This controls whether a search term can occur anywhere in a contact item field, or just at the beginning of the field.

Returns: The newly constructed find view object.

RefineFindViewL ( MDesCArray * )

IMPORT_C voidRefineFindViewL(MDesCArray *aFindWords)

Refines the search criteria and updates the find view.

This may involve either narrowing or replacing the search criteria.

This function can be used to narrow the existing search criteria, by specifying an array of search terms that consists of the existing search terms (as passed to the NewL()) with additional terms appended to it. In this case, the function searches the existing list of matching contact items only. This assumes that UpdateFindViewL() has previously been called.

It can alternatively be used to replace entirely the existing search criteria. In this case, the whole underlying view is searched again.

ParameterDescription
aFindWordsThe new search criteria. This can be a superset of the existing search criteria, i.e. the existing criteria with additional terms appended to it; otherwise it replaces the existing search criteria entirely.

SortOrderL ( )

const RContactViewSortOrder &SortOrderL()const [virtual]

Gets the underlying view's sort order.

Returns: The sort order.

UpdateFindViewL ( )

IMPORT_C voidUpdateFindViewL()[protected, virtual]

Populates the view.

This deletes any existing matching contacts list and searches the underlying view for items matching the search criteria.