#include <app/cntviewbase.h>
class CContactLocalView : public CContactViewBase |
Protected Attributes | |
---|---|
RContactViewSortOrder | iSortOrder |
Public Member Functions | |
---|---|
virtual HBufC * | AllFieldsLC(TInt, const TDesC &) |
virtual TContactItemId | AtL(TInt) |
virtual IMPORT_C TAny * | CContactViewBase_Reserved_1(TFunction, TAny *) |
virtual const CViewContact & | ContactAtL(TInt) |
virtual TContactViewPreferences | ContactViewPreferences() |
virtual TInt | CountL() |
virtual 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() |
virtual const RContactViewSortOrder & | SortOrderL() |
Protected Member Functions | |
---|---|
CContactLocalView(const CContactDatabase &, TContactViewPreferences) | |
CContactLocalView(const CContactDatabase &, TContactViewPreferences, MLplPersistenceLayerFactory *) | |
~CContactLocalView() | |
IMPORT_C void | ConstructL(MContactViewObserver &, const RContactViewSortOrder &) |
void | ConstructL(MContactViewObserver &, const RContactViewSortOrder &, const TBool, const TDesC8 &) |
virtual IMPORT_C TInt | InsertL(TContactItemId) |
virtual IMPORT_C TInt | RemoveL(TContactItemId) |
void | SetState(TState) |
virtual IMPORT_C void | SortL(const RContactViewSortOrder &) |
Inherited Attributes | |
---|---|
CContactViewBase::iDb | |
CContactViewBase::iExtension | |
CContactViewBase::iState |
Inherited Enumerations | |
---|---|
CContactViewBase:TFunction | |
CContactViewBase:TSearchType | |
CContactViewBase:TState |
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.
RContactViewSortOrder | iSortOrder | [protected] |
The sort order. This is set during construction or when SortL() is called.
IMPORT_C | CContactLocalView | ( | const CContactDatabase & | aDb, |
TContactViewPreferences | aContactTypes | |||
) | [protected] |
Protected C++ constructor.
Called by NewL().
Parameter | Description |
---|---|
aDb | The underlying database that contains the contact items. |
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 & | aDb, |
TContactViewPreferences | aContactTypes, | ||
MLplPersistenceLayerFactory * | aIterFactory | ||
) | [protected] |
IMPORT_C | ~CContactLocalView | ( | ) | [protected] |
Destructor.
Deletes all resources owned by the object, and removes itself as the contact database observer.
Reimplemented from CContactViewBase::AllFieldsLC(TInt,const TDesC &)const
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.
Parameter | Description |
---|---|
aIndex | The index of the contact item into the view. |
aSeparator | The string to use to separate the fields. |
Returns: Pointer to the contact item descriptor.
TContactItemId | AtL | ( | TInt | aIndex | ) | const [virtual] |
Reimplemented from CContactViewBase::AtL(TInt)const
Returns the ID of the contact item at a specified index into the view.
Parameter | Description |
---|---|
aIndex | An index into the view. |
Returns: The ID of the contact item at the specified index.
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.
IMPORT_C void | ConstructL | ( | MContactViewObserver & | aObserver, |
const RContactViewSortOrder & | aSortOrder | |||
) | [protected] |
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().
Parameter | Description |
---|---|
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. |
aSortOrder | Specifies the fields to use to sort the items in the view. |
void | ConstructL | ( | MContactViewObserver & | aObserver, |
const RContactViewSortOrder & | aSortOrder, | |||
const TBool | aUseNamedPlugin, | |||
const TDesC8 & | aSortPluginName | |||
) | [protected] |
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().
Parameter | Description |
---|---|
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. |
aSortOrder | Specifies the fields to use to sort the items in the view. |
aUseNamedPlugin | A flag indicates whether the aSortPluginName parameter is valid. |
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. |
const CViewContact & | ContactAtL | ( | TInt | aIndex | ) | const [virtual] |
Reimplemented from CContactViewBase::ContactAtL(TInt)const
Returns the contact item at a specified index into the view.
Parameter | Description |
---|---|
aIndex | An index into the view. |
Returns: The reference to the copy of contact item at the specified index.
TContactViewPreferences | ContactViewPreferences | ( | ) | [virtual] |
Reimplemented from CContactViewBase::ContactViewPreferences()
Gets the view preferences, as set during construction.
Returns: The view preferences.
TInt | CountL | ( | ) | const [virtual] |
Reimplemented from CContactViewBase::CountL()const
Gets the total number of contact items in the view.
Returns: The number of contact items in the view. This includes both sorted and unsorted items.
TInt | FindL | ( | TContactItemId | aId | ) | const [virtual] |
Reimplemented from CContactViewBase::FindL(TContactItemId)const
Searches for a contact item in the view with the specified ID.
Parameter | Description |
---|---|
aId | The ID of the contact item to search for. |
Returns: If found, the index into the view of the matching item. Otherwise, KErrNotFound.
IMPORT_C TInt | InsertL | ( | TContactItemId | aId | ) | [protected, virtual] |
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.
Parameter | Description |
---|---|
aId | The ID of a contact item that exists in the underlying database. |
Returns: The index at which the item was inserted into the view, or KErrNotFound if the contact item was not found in the underlying database, or it already exists in the view.
IMPORT_C CContactLocalView * | NewL | ( | MContactViewObserver & | aObserver, |
const CContactDatabase & | aDb, | |||
const RContactViewSortOrder & | aSortOrder, | |||
TContactViewPreferences | aContactTypes | |||
) | [static] |
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.
Parameter | Description |
---|---|
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 |
aDb | The underlying database that contains the contact items. The view observes the database, so that it handles change events sent from the database. |
aSortOrder | Specifies the fields to use to sort the items in the view. |
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. |
Returns: The newly constructed local view object.
IMPORT_C CContactLocalView * | NewL | ( | MContactViewObserver & | aObserver, |
const CContactDatabase & | aDb, | |||
const RContactViewSortOrder & | aSortOrder, | |||
TContactViewPreferences | aContactTypes, | |||
const TDesC8 & | aSortPluginName | |||
) | [static] |
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.
Parameter | Description |
---|---|
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 |
aDb | The underlying database that contains the contact items. The view observes the database, so that it handles change events sent from the database. |
aSortOrder | Specifies the fields to use to sort the items in the view. |
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. |
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. |
Returns: The newly constructed local view object.
IMPORT_C CContactLocalView * | NewL | ( | MContactViewObserver & | aObserver, |
const CContactDatabase & | aDb, | |||
const RContactViewSortOrder & | aSortOrder, | |||
TContactViewPreferences | aContactTypes, | |||
MLplPersistenceLayerFactory * | aFactory, | |||
const TDesC8 & | aSortPluginName | |||
) | [static] |
CContactLocalView contructor, used in the server
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.
Parameter | Description |
---|---|
aError | Leave code from CIdleContactSorter::RunL |
IMPORT_C TInt | RemoveL | ( | TContactItemId | aId | ) | [protected, virtual] |
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.
Parameter | Description |
---|---|
aId | The ID of the contact item to remove from the view. |
Returns: The index of the removed item into the view's list of sorted or unsorted contact items, or KErrNotFound if the item was not found in the view.
void | SetState | ( | TState | aState | ) | [protected] |
Set database state
Parameter | Description |
---|---|
aState | database state to set. |
IMPORT_C void | SortL | ( | const RContactViewSortOrder & | aSortOrder | ) | [protected, virtual] |
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.
Parameter | Description |
---|---|
aSortOrder | Specifies the fields to use to sort the items in the view. |
IMPORT_C const RContactViewSortOrder & | SortOrder | ( | ) | const |
Gets the sort order, as set during construction.
Returns: The sort order.
const RContactViewSortOrder & | SortOrderL | ( | ) | const [virtual] |
Reimplemented from CContactViewBase::SortOrderL()const
Gets the sort order, as set during construction.
This function cannot leave.
Returns: The sort order.