|
||
class CContactViewBase : public CBase;
The abstract base class for all contact view classes.
All contact views operate asynchronously, so users of the view must observe it, by implementing the MContactViewObserver
interface. Immediately after construction, views are not in a usable state (the underlying data may be being sorted, for
instance). Only after the user has received a TContactViewEvent::EReady
event may the view be used.
View observers are also notified when changes occur, for instance when the view's state changes (see TState), when an error occurs, or when an item is added or removed.
CBase
- Base class for all classes to be instantiated on the heap
CContactViewBase
- The abstract base class for all contact view classes
Defined in CContactViewBase
:
AllFieldsLC()
Returns a descriptor containing the contents of all fields for an item in the viewAtL()
Returns the contact item ID at the specified index into the viewCContactViewBase()
Protected C++ constructorCContactViewBase_Reserved_1()
This is a reserved virtual exported function that is used for BC proofing against addition of new exported virtual functionsClose()
Removes an observer from the view's observer arrayCompareFieldsL()
Collates two contact items' field contentsConstructL()
Protected second phase constructorContactAtL()
Returns the contact item at the specified index into the viewContactViewPreferences()
Gets the view preferencesContactsMatchingCriteriaL()
Searches all contact items in the view for fields that contain all of the search strings specifiedContactsMatchingPrefixL()
Searches all contact items in the view for fields that contain all of the search strings specifiedCountL()
Returns the number of contact items in the viewECContactViewBaseVirtualFunction1
Identifies the function CContactViewBase::GetContactIdsL()ECContactViewBaseVirtualFunction2
Identifies the function CContactViewBase::GetContactsMatchingFilterL()ECContactViewBaseVirtualFunction3
Identifies the function CContactViewBase::InsertContactInView()EFullSearch
The search uses full wildcard matching so that the search string can occur anywhere in the item's fieldsEInitializing
The view is initialisingENotReady
The view is not ready to be used, for instance immediately after the sort order has changed, or after an error has occurredEPrefixSearch
The search uses partial wildcard matching so that the search string can only occur at the beginning of the item's fieldsEReady
The view is ready to be usedError()
Gets the recorded error valueFieldsWithSeparatorLC()
Allocates and returns a descriptor filled with the contents of all the fields in a contact itemFindL()
Returns the index into the view of the specified contact itemGetContactIdsL()
Gets an array containing the IDs of the contact items at the specified view indexesGetViewFindConfigPlugin()
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 sameIdsMatch()
Tests whether the IDs of two contact items are the sameIndexesEqual()
Tests whether the view indexes of two contact items are the sameMatchesCriteriaL()
Searches a single contact item for fields that contain one or more search stringsMatchesCriteriaL()
Searches a single contact item for fields that contain one or more search stringsMatchesCriteriaL()
Searches a single contact item for fields that contain one or more search stringsNotifyObserverAsync()
Called to notify a single view observer asynchronously of an eventNotifyObservers()
Called by derived view classes to notify their observers synchronously of an event, by calling their HandleContactViewEvent()
functionOpen()
Appends an observer to the view's observer arrayOpenL()
Appends an observer to the view's observer arraySetViewFindConfigPlugin()
Sets the UID of the view's find configuration plug-in to use in calls to ContactsMatchingCriteriaL(), ContactsMatchingPrefixL()
and MatchesCriteriaL()SortOrderL()
Gets the view's sort orderTFunction
Identifies the functions that have been added to CContactViewBase, or that may be added in the futureTSearchType
Search typeTState
Defines the contact view statesTVirtualFunction1Params
Holds the two parameters passed to the helper method GetContactIdsL() from the reserved function CContactViewBase_Reserved_1()TVirtualFunction2Params
Holds the two parameters passed to the method GetContactsMatchingFilterL() from the reserved function CContactViewBase_Reserved_1()iDb
iExtension
iState
~CContactViewBase()
DestructorInherited from CBase
:
Delete()
Deletes the specified objectExtension_()
Extension functionoperator new()
Initialises the object to binary zeroesprotected: IMPORT_C ~CContactViewBase();
Destructor.
Cancels all outstanding notifications and deletes all resources owned by the object.
protected: IMPORT_C void ConstructL();
Protected second phase constructor.
Called from a derived class's ConstructL()
. Creates the view's asynchronous notifier and adds it to the active scheduler.
protected: IMPORT_C CContactViewBase(const CContactDatabase &aDb);
Protected C++ constructor.
Initialises the view's state to EInitializing.
|
IMPORT_C void OpenL(MContactViewObserver &aObserver);
Appends an observer to the view's observer array.
If the view's state is EReady, the observer is notified asynchronously that the view is ready.
An error causes the function to leave.
|
IMPORT_C TInt Open(MContactViewObserver &aObserver);
Appends an observer to the view's observer array.
If the view's state is EReady, the observer is notified asynchronously that the view is ready.
This function does not leave; an error code is returned instead.
|
|
Capability: | Illegal |
IMPORT_C TBool Close(const MContactViewObserver &aObserver);
Removes an observer from the view's observer array.
Any outstanding notifications for aObserver are first cancelled.
|
|
Capability: | ReadUserData |
virtual TContactItemId AtL(TInt aIndex) const=0;
Returns the contact item ID at the specified index into the view.
|
|
Capability: | ReadUserData |
virtual const CViewContact &ContactAtL(TInt aIndex) const=0;
Returns the contact item at the specified index into the view.
|
|
Capability: | ReadUserData |
virtual TInt CountL() const=0;
Returns the number of contact items in the view.
|
Capability: | ReadUserData |
virtual TInt FindL(TContactItemId aId) const=0;
Returns the index into the view of the specified contact item.
|
|
Capability: | ReadUserData |
virtual HBufC *AllFieldsLC(TInt aIndex, const TDesC &aSeparator) const=0;
Returns a descriptor containing the contents of all fields for an item in the view.
The field separator is used to separate the contents of each field. It is not appended to the last field.
|
|
Capability: | ReadUserData |
virtual IMPORT_C void ContactsMatchingCriteriaL(const MDesC16Array &aFindWords, RPointerArray< CViewContact > &aMatchedContacts);
Searches all contact items in the 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 the item's fields. For a match to occur, all of the search strings must be found in a contact item.
|
Capability: | ReadUserData |
virtual TContactViewPreferences ContactViewPreferences()=0;
Gets the view preferences.
|
Capability: | ReadUserData |
virtual const RContactViewSortOrder &SortOrderL() const=0;
Gets the view's sort order.
|
Capability: | ReadUserData |
virtual IMPORT_C void ContactsMatchingPrefixL(const MDesC16Array &aFindWords, RPointerArray< CViewContact > &aMatchedContacts);
Searches all contact items in the 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.
|
Capability: | ReadUserData |
virtual IMPORT_C TAny *CContactViewBase_Reserved_1(TFunction aFunction, TAny *aParams);
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.
|
|
IMPORT_C void SetViewFindConfigPlugin(TUid aUid);
Sets the UID of the view's find configuration plug-in to use in calls to ContactsMatchingCriteriaL()
, ContactsMatchingPrefixL()
and MatchesCriteriaL()
.
|
IMPORT_C TUid GetViewFindConfigPlugin();
Gets the UID of the view's find configuration plug-in, as set by SetViewFindConfigPlugin()
.
|
Capability: | ReadUserData |
virtual IMPORT_C void GetContactIdsL(const CArrayFix< TInt > &aIndexes, CContactIdArray &aContactIds);
Gets an array containing the IDs of the contact items at the specified view indexes.
The IDs are appended to the array.
|
IMPORT_C TInt Error() const;
Gets the recorded error value. If an error occurs within the view, before each of the views observers are notified, then the view records the error code internally. This function provides access to a copy of that error code.
|
protected: IMPORT_C void NotifyObservers(const TContactViewEvent &aEvent);
Called by derived view classes to notify their observers synchronously of an event, by calling their HandleContactViewEvent() function.
|
protected: IMPORT_C TInt NotifyObserverAsync(MContactViewObserver &aObserver, const TContactViewEvent &aEvent);
Called to notify a single view observer asynchronously of an event.
If other notifications are outstanding, this notification is appended to the queue.
If the view's asynchronous notifier is not active, it is started as a background task.
This function is called by OpenL()
and Open()
to notify the observer that the view is ready.
|
|
protected: static IMPORT_C TBool IdsMatch(const CViewContact &aFirst, const CViewContact &aSecond);
Tests whether the IDs of two contact items are the same.
|
|
protected: IMPORT_C HBufC *FieldsWithSeparatorLC(const RPointerArray< CViewContact > &aContacts, TInt aIndex, const TDesC
&aSeparator) const;
Allocates and returns a descriptor filled with the contents of all the fields in a contact item.
The fields are separated by the specified separator.
|
|
protected: virtual IMPORT_C TBool MatchesCriteriaL(const CViewContact &aContact, const MDesC16Array &aFindWords);
Searches a single contact item for fields that contain one or more search strings.
The search uses wildcard matching so that the search strings can occur anywhere in any of the item's fields. For a match to occur, all of the search strings must be found in the contact item.
Any find configuration plug-in that has been set (by calling SetViewFindConfigPlugin()
) will be used.
|
|
protected: static IMPORT_C TBool MatchesCriteriaL(const CViewContact &aContact, const MDesC16Array &aFindWords, TSearchType
aSearchType);
Searches a single contact item for fields that contain one or more search strings.
The search type indicates whether the search strings can occur anywhere in a field, or must occur at the start of a field only. For a match to occur, all of the search strings must be found in the contact item.
This function does not use any find configuration plug-in that has been set (by calling SetViewFindConfigPlugin()
), so new code should use one of the other overloads instead. This function has been maintained for binary compatibility with
previous OS versions.
|
|
protected: static IMPORT_C TBool MatchesCriteriaL(const CViewContact &aContact, const MDesC16Array &aFindWords, TSearchType
aSearchType, CContactViewBase::CContactViewBaseExtension *aExtension);
Searches a single contact item for fields that contain one or more search strings.
The search type indicates whether the search strings can occur anywhere in a field, or must occur at the start of a field only. For a match to occur, all of the search strings must be found in the contact item.
If a find configuration plug-in UID is specified in the fourth parameter, this overload uses it, loading it first if necessary.
This overrides any plug-in that had previously been set by a call to SetViewFindConfigPlugin()
.
|
|
protected: static IMPORT_C TBool IdsEqual(const TContactIdWithMapping &aFirst, const TContactIdWithMapping &aSecond);
Tests whether the IDs of two contact items are the same.
|
|
protected: static IMPORT_C TBool IndexesEqual(const TContactIdWithMapping &aFirst, const TContactIdWithMapping &aSecond);
Tests whether the view indexes of two contact items are the same.
|
|
protected: static IMPORT_C TInt CompareFieldsL(const CViewContact &aFirst, const CViewContact &aSecond);
Collates two contact items' field contents.
This is done by comparing each contact item on a field by field basis starting with the loosest collation level initially, and then progressing to tighter collation levels only if the items are considered the same at the looser level. This is required so that items differing by case only are sorted correctly. If a field isn't present, then the comparison is done using the first field that is present.
|
|
class TVirtualFunction1Params;
Holds the two parameters passed to the helper method GetContactIdsL()
from the reserved function CContactViewBase_Reserved_1()
. It has an inline constructor to initialise the data members.
Defined in CContactViewBase::TVirtualFunction1Params
:
TVirtualFunction1Params()
Inline constructor to initialize member dataiIdArray
Pointer to array of contact IDsiIndexes
Pointer to an array of indexes in a viewTVirtualFunction1Params()
inline TVirtualFunction1Params(const CArrayFix< TInt > *aIndexes, CContactIdArray *aIdArray);
Inline constructor to initialize member data
|
iIndexes
const CArrayFix< TInt > * iIndexes;
Pointer to an array of indexes in a view
iIdArray
CContactIdArray * iIdArray;
Pointer to array of contact IDs
class TVirtualFunction2Params;
Holds the two parameters passed to the method GetContactsMatchingFilterL()
from the reserved function CContactViewBase_Reserved_1()
. It has an inline constructor to initialise the data members.
Defined in CContactViewBase::TVirtualFunction2Params
:
TVirtualFunction2Params()
Inline constructor to initialize member dataiFilter
Filter for the contactsiMatchingContacts
List of contacts matching the criteriaTVirtualFunction2Params()
inline TVirtualFunction2Params(TInt aFilter, RArray< TContactIdWithMapping > &aMatchingContacts);
Inline constructor to initialize member data.
|
iFilter
TInt iFilter;
Filter for the contacts.
iMatchingContacts
RArray< TContactIdWithMapping > & iMatchingContacts;
List of contacts matching the criteria.
TSearchType
Search type.
This controls whether a search term can occur anywhere in a contact item field, or just at the beginning of the field.
|
TFunction
Identifies the functions that have been added to CContactViewBase, or that may be added in the future. This identifier is
passed to the reserved virtual function CContactViewBase_Reserved_1()
and enables the addition of new virtual methods without breaking binary compatibility.
|
protected: TState
Defines the contact view states.
|
protected: CContactViewBaseExtension * iExtension;