#include <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
CBase - Base class for all classes to be instantiated on the heap
CContactFilteredView - Provides a filtered view over an existing CContactViewBase derived object
Members
Defined in CContactFilteredView:
AllFieldsLC()Returns a descriptor containing the contents of all fields for an item in the view
AtL()Gets the contact item ID at the specified index into the filtered view
CContactViewBase_Reserved_1()This is a reserved virtual exported function that is used for BC proofing against addition of new exported virtual functions
ContactAtL()Gets the contact item at the specified index into the view
ContactViewPreferences()Gets the underlying view's view preferences
ContactsMatchingCriteriaL()Searches all contact items in the filtered view for fields that contain all of the search strings specified
ContactsMatchingPrefixL()Searches all contact items in the filtered view for fields that contain all of the search strings specified
CountL()Gets the number of contact item IDs in the filtered view
FindL()Finds the index into the filtered view of the specified contact item
HandleContactViewEvent()Handles an event in an observed contact view
NewL()Allocates and constructs a CContactFilteredView version 1 object
NewL()Allocates and constructs a CContactFilteredView version 2 object
SortOrderL()Gets the underlying view's sort order
Inherited from CBase:
Inherited from CContactViewBase:
Close()Removes an observer from the view's observer array
CompareFieldsL()Collates two contact items' field contents
ConstructL()Protected second phase constructor
ECContactViewBaseVirtualFunction1Identifies the function CContactViewBase::GetContactIdsL()
ECContactViewBaseVirtualFunction2Identifies the function CContactViewBase::GetContactsMatchingFilterL()
ECContactViewBaseVirtualFunction3Identifies the function CContactViewBase::InsertContactInView()
EFullSearchThe search uses full wildcard matching so that the search string can occur anywhere in the item's fields
EInitializingThe view is initialising
ENotReadyThe view is not ready to be used, for instance immediately after the sort order has changed, or after an error has occurred
EPrefixSearchThe search uses partial wildcard matching so that the search string can only occur at the beginning of the item's fields
EReadyThe view is ready to be used
Error()Gets the recorded error value
FieldsWithSeparatorLC()Allocates and returns a descriptor filled with the contents of all the fields in a contact item
GetContactIdsL()Gets an array containing the IDs of the contact items at the specified view indexes
GetViewFindConfigPlugin()Gets the UID of the view's find configuration plug-in, as set by SetViewFindConfigPlugin()
IdsEqual()Tests whether the IDs of two contact items are the same
IdsMatch()Tests whether the IDs of two contact items are the same
IndexesEqual()Tests whether the view indexes of two contact items are the same
MatchesCriteriaL()Searches a single contact item for fields that contain one or more search strings
NotifyObserverAsync()Called to notify a single view observer asynchronously of an event
NotifyObservers()Called by derived view classes to notify their observers synchronously of an event, by calling their HandleContactViewEvent()
function
Open()Appends an observer to the view's observer array
OpenL()Appends an observer to the view's observer array
SetViewFindConfigPlugin()Sets the UID of the view's find configuration plug-in to use in calls to ContactsMatchingCriteriaL(), ContactsMatchingPrefixL()
and MatchesCriteriaL()
TFunctionIdentifies the functions that have been added to CContactViewBase, or that may be added in the future
TSearchTypeSearch type
TStateDefines the contact view states
TVirtualFunction1ParamsHolds the two parameters passed to the helper method GetContactIdsL() from the reserved function CContactViewBase_Reserved_1()
TVirtualFunction2ParamsHolds the two parameters passed to the method GetContactsMatchingFilterL() from the reserved function CContactViewBase_Reserved_1()
iDb
iExtension
iState
Related Topics
»
Symbian OS v9.4 »
Examples »
Application Engines example code »
ContactViews: Using Contact Database views
Construction and destruction
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
Return value
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
Return value
CContactViewBase_Reserved_1()
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.
|
|
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
Leave codes
KErrNotReady |
The view is not ready for use.
|
KErrNotFound |
aIndex is outside the bounds of the filtered view.
|
|
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.
|
|
virtual TInt FindL(TContactItemId aId) const;
Description
Finds the index into the filtered view of the specified contact item.
Parameters
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.
|
|
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.
|
|
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
Leave codes
KErrNotReady |
The view is not ready for use.
|
KErrNotFound |
aIndex is outside the bounds of the filtered ID array.
|
|
virtual TContactViewPreferences ContactViewPreferences();
Description
Gets the underlying view's view preferences.
Return value
virtual const RContactViewSortOrder &SortOrderL() const;
Description
Gets the underlying view's sort order.
Return value
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
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
private: virtual void HandleContactViewEvent(const CContactViewBase &aView, const TContactViewEvent &aEvent);
Description
Handles an event in an observed contact view.
Parameters