CContactLocalView Class Reference
class CContactLocalView : public CContactViewBase |
An instantiable base class for contact views.
The data associated with a local view is allocated within the client's memory space; CContactRemoteView should be used in preference if the view is likely to be shared between multiple clients. It is kept up to date by receiving change events from the underlying CContactDatabase object which it observes. The view preferences and sort order are specified on construction.
Public Member Functions |
---|
HBufC * | AllFieldsLC(TInt, const TDesC &) |
TContactItemId
| AtL(TInt) |
IMPORT_C TAny * | CContactViewBase_Reserved_1(TFunction, TAny *) |
const CViewContact & | ContactAtL(TInt) |
TContactViewPreferences
| ContactViewPreferences() |
TInt
| CountL() |
TInt
| FindL(TContactItemId) |
IMPORT_C CContactLocalView * | NewL(MContactViewObserver &, const CContactDatabase &, const RContactViewSortOrder &, TContactViewPreferences) |
IMPORT_C CContactLocalView * | NewL(MContactViewObserver &, const CContactDatabase &, const RContactViewSortOrder &, TContactViewPreferences, const TDesC8 &) |
IMPORT_C CContactLocalView * | NewL(MContactViewObserver &, const CContactDatabase &, const RContactViewSortOrder &, TContactViewPreferences, MLplPersistenceLayerFactory *, const TDesC8 &) |
void | NotifySortError(TInt) |
IMPORT_C const RContactViewSortOrder & | SortOrder() |
const RContactViewSortOrder & | SortOrderL() |
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() |
Constructor & Destructor Documentation
CContactLocalView(const CContactDatabase &, TContactViewPreferences)
Protected C++ constructor.
Called by NewL().
Parameters
const CContactDatabase & aDb | The underlying database that contains the contact items. |
TContactViewPreferences aContactTypes | Specifies which types of contact items should be included in the view and the behaviour for items that do not have content in any of the fields specified in the sort order. |
CContactLocalView(const CContactDatabase &, TContactViewPreferences, MLplPersistenceLayerFactory *)
~CContactLocalView()
IMPORT_C | ~CContactLocalView | ( | ) | [protected] |
Destructor.
Deletes all resources owned by the object, and removes itself as the contact database observer.
Member Functions Documentation
AllFieldsLC(TInt, const TDesC &)
HBufC * | AllFieldsLC | ( | TInt | aIndex, |
| const TDesC & | aSeparator |
| ) | const [virtual] |
Gets a descriptor containing the contents of all fields specified in the view's sort order 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.
Parameters
TInt aIndex | The index of the contact item into the view. |
const TDesC & aSeparator | The string to use to separate the fields. |
AtL(TInt)
Returns the ID of the contact item at a specified index into the view.
-
leave
- KErrNotFound The index is out of bounds.
-
leave
- KErrNotReady The view is not ready for use.
Parameters
TInt aIndex | An index into the view. |
CContactLocalView_Reserved_1()
IMPORT_C void | CContactLocalView_Reserved_1 | ( | ) | [private, virtual] |
CContactLocalView_Reserved_2()
IMPORT_C void | CContactLocalView_Reserved_2 | ( | ) | [private, virtual] |
CContactViewBase_Reserved_1(TFunction, TAny *)
IMPORT_C TAny * | CContactViewBase_Reserved_1 | ( | TFunction | aFunction, |
| TAny * | aParams |
| ) | [virtual] |
This is a reserved virtual exported function that is used for BC proofing against present and future additions of new exported virtual functions.
ConstructL(MContactViewObserver &, const RContactViewSortOrder &)
Protected second phase constructor.
The view is sorted according to the sort order and view preferences specified, using a low priority idle time active object. The specified view observer is notified when the view is sorted and ready for use.
Called by NewL().
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. Any attempt to use the view before this notification will Leave with KErrNotReady. |
const RContactViewSortOrder & aSortOrder | Specifies the fields to use to sort the items in the view. |
ConstructL(MContactViewObserver &, const RContactViewSortOrder &, const TBool, const TDesC8 &)
Protected second phase constructor.
The view is sorted according to the sort order and view preferences specified, using a low priority idle time active object. The specified view observer is notified when the view is sorted and ready for use.
Called by NewL().
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. Any attempt to use the view before this notification will Leave with KErrNotReady. |
const RContactViewSortOrder & aSortOrder | Specifies the fields to use to sort the items in the view. |
const TBool aUseNamedPlugin | A flag indicates whether the aSortPluginName parameter is valid. |
const TDesC8 & aSortPluginName | Specifies a plug-in that will be used to compare view contacts when the the view is sorted. This name is used by ECOM to select the plugin, and is matched with the "default_data" of all ECOM plugins that support the required interface. |
ContactAtL(TInt)
Returns the contact item at a specified index into the view.
-
leave
- KErrNotFound The index is out of bounds.
-
leave
- KErrNotReady The view is not ready for use.
Parameters
TInt aIndex | An index into the view. |
ContactViewPreferences()
Gets the view preferences, as set during construction.
CountL()
TInt
| CountL | ( | ) | const [virtual] |
Gets the total number of contact items in the view.
-
leave
- KErrNotReady The view is not ready for use.
FindL(TContactItemId)
Searches for a contact item in the view with the specified ID.
-
leave
- KErrNotReady The view is not ready for use.
HandleDatabaseEventL(TContactDbObserverEvent)
HandleOutstandingEventL()
void | HandleOutstandingEventL | ( | ) | [private] |
Handle a particular queued event
HandleOutstandingEvents()
void | HandleOutstandingEvents | ( | ) | [private] |
Handle queued events when view is ready - sorting completes
InsertL(TContactItemId)
Inserts a contact item into the view, maintaining the view's sort order.
For the item to be inserted, it must exist in the underlying database, and it must be of the correct type according to the view preferences.
This function is called when a contact item or group is added to or changed in the underlying database.
Parameters
TContactItemId aId | The ID of a contact item that exists in the underlying database. |
NewL(MContactViewObserver &, const CContactDatabase &, const RContactViewSortOrder &, TContactViewPreferences)
Allocates and constructs the local view object.
The view is sorted according to the sort order and view preferences specified, using a low priority idle time active object. The specified view observer is notified when the view is sorted and ready for use.
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. Any attempt to use the view before this notification will Leave with KErrNotReady |
const CContactDatabase & aDb | The underlying database that contains the contact items. The view observes the database, so that it handles change events sent from the database. |
const RContactViewSortOrder & aSortOrder | Specifies the fields to use to sort the items in the view. |
TContactViewPreferences aContactTypes | Specifies which types of contact items should be included in the view and the behaviour for items that do not have content in any of the fields specified in the sort order. |
NewL(MContactViewObserver &, const CContactDatabase &, const RContactViewSortOrder &, TContactViewPreferences, const TDesC8 &)
Allocates and constructs the local view object.
The view is sorted according to the sort order and view preferences specified, using a low priority idle time active object. The specified view observer is notified when the view is sorted and ready for use.
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. Any attempt to use the view before this notification will Leave with KErrNotReady |
const CContactDatabase & aDb | The underlying database that contains the contact items. The view observes the database, so that it handles change events sent from the database. |
const RContactViewSortOrder & aSortOrder | Specifies the fields to use to sort the items in the view. |
TContactViewPreferences aContactTypes | Specifies which types of contact items should be included in the view and the behaviour for items that do not have content in any of the fields specified in the sort order. |
const TDesC8 & aSortPluginName | Specifies a plug-in that will be used to compare view contacts when the the view is sorted. This name is used by ECOM to select the plugin, and is matched with the "default_data" of all ECOM plugins that support the required interface. |
NewL(MContactViewObserver &, const CContactDatabase &, const RContactViewSortOrder &, TContactViewPreferences, MLplPersistenceLayerFactory *, const TDesC8 &)
NotifySortError(TInt)
void | NotifySortError | ( | TInt | aError | ) | |
Notify observers that view construction failed. The error is stored so that if another client tries to open the view they will receive the same error.
Parameters
TInt aError | Leave code from CIdleContactSorter::RunL |
RemoveL(TContactItemId)
Removes a contact item from the view.
This function is called when a contact item or group is deleted from or changed in the underlying database.
SafeResort()
void | SafeResort | ( | ) | [private] |
Unleavable(safe) resorting
SetSortOrderL(const RContactViewSortOrder &)
Set sort order used to sorting the view contacts.
SetState(TState)
void | SetState | ( | TState | aState | ) | [protected] |
Parameters
TState aState | database state to set. |
SortComplete(TInt)
void | SortComplete | ( | TInt | aSortErr | ) | [private] |
Called from view contact item manager to notify the sorting has finished.
Parameters
TInt aSortErr | error occurs in sorting or KErrNone if sorting completes without error. |
SortL(const RContactViewSortOrder &)
Sorts the view using the specified sort order, using a low priority idle time active object.
This function is called during view construction and on receipt of certain change events from the underlying database.
SortL()
Start sorting if database is ready
SortOrder()
Gets the sort order, as set during construction.
SortOrderL()
Gets the sort order, as set during construction.
This function cannot leave.
Member Data Documentation
CIdleContactSorter * iAsyncSorter
CIdleContactSorter * | iAsyncSorter | [private] |
RPointerArray< CViewContact > iContacts
MLplPersistenceLayerFactory * iFactory
RArray< TContactDbObserverEvent > iOutstandingEvents
RContactViewSortOrder
iSortOrder
The sort order. This is set during construction or when SortL() is called.
CContactTextDef * iTextDef
RPointerArray< CViewContact > iUnSortedContacts
CViewContactManager * iViewCntMgr
CViewContactManager * | iViewCntMgr | [private] |
TContactViewPreferences
iViewPreferences
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.