CContactRemoteViewBase Class Reference

class CContactRemoteViewBase : public CContactViewBase

Base class for all remote contact view classes.

It implements all the pure virtual functions in CContactViewBase and additionally it handles remote view notifications. The data associated with remote views is allocated within the memory space of the contacts server. This means that multiple clients can share the same server side view object, thereby reducing the overhead associated with initial sorting of the view data and keeping it in sync with the underlying data. Remote views should therefore be used when the same view is likely to be needed by more than one client.

Inherits from

Public Member Functions
HBufC *AllFieldsLC(TInt, const TDesC &)
TContactItemId AtL(TInt)
TAny *CContactViewBase_Reserved_1(TFunction, TAny *)
const CViewContact &ContactAtL(TInt)
TContactViewPreferences ContactViewPreferences()
voidContactsMatchingCriteriaL(const MDesCArray &, RPointerArray< CViewContact > &)
voidContactsMatchingPrefixL(const MDesCArray &, RPointerArray< CViewContact > &)
TInt CountL()
TInt FindL(TContactItemId)
voidGetContactIdsL(const CArrayFix< TInt > &, CContactIdArray &)
voidGetContactsMatchingFilterL(TInt, RArray< TContactIdWithMapping > &)
const RContactViewSortOrder &SortOrderL()
Protected Member Functions
CContactRemoteViewBase(const CContactDatabase &)
~CContactRemoteViewBase()
voidConstructL(MContactViewObserver &)
Private Member Functions
voidHandleContactViewEvent(const TContactViewEvent &)
TInt NotifierCallBack(TAny *)
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::Error()const
CContactViewBase::FieldsWithSeparatorLC(const RPointerArray< CViewContact > &,TInt,const TDesC &)const
CContactViewBase::FindDefaultViewSortPluginImplL()const
CContactViewBase::FindSortPluginImplL(const TDesC8 &,TBool)const
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()
Inherited Enumerations
CContactViewBase:TFunction
CContactViewBase:TSearchType
CContactViewBase:TState
Protected Attributes
RContactRemoteView iView
Private Attributes
TInt iCount
CContactRemoteViewNotifier *iNotifier
Inherited Attributes
CContactViewBase::iDb
CContactViewBase::iExtension
CContactViewBase::iState

Constructor & Destructor Documentation

CContactRemoteViewBase(const CContactDatabase &)

CContactRemoteViewBase(const CContactDatabase &aDb)[protected]

Protected C++ constructor.

Parameters

const CContactDatabase & aDbThe underlying database containing the contact items.

~CContactRemoteViewBase()

~CContactRemoteViewBase()[protected]
Cancels the active notifier and closes the session with the contacts server.
capability
None

Member Functions Documentation

AllFieldsLC(TInt, const TDesC &)

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

Gets a descriptor containing the contents of all fields specified in the server side 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.

capability
ReadUserData
leave
KErrNotFound The index is greater than or equal to the number of items in the view.
leave
KErrNotReady The view is not ready for use.
panic
CntLock 6 The index is less than zero.

Parameters

TInt aIndexThe index of the contact item into the view.
const TDesC & aSeparatorThe string to use to separate the fields.

AtL(TInt)

TContactItemId AtL(TIntaIndex)const [virtual]

Returns the ID of the contact item at a specified index into the the server side view.

capability
ReadUserData
leave
KErrNotFound The index is greater than or equal to the number of items in the view.
leave
KErrNotReady The view is not ready for use.
panic
CntLock 6 The index is less than zero.

Parameters

TInt aIndexAn index into the server side view.

CContactViewBase_Reserved_1(TFunction, TAny *)

TAny *CContactViewBase_Reserved_1(TFunctionaFunction,
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.

capability
ReadUserData

Parameters

TFunction aFunction
TAny * aParams

ConstructL(MContactViewObserver &)

voidConstructL(MContactViewObserver &aObserver)[protected]

Protected second phase constructor.

Starts an active object which notifies this view (by calling its HandleContactViewEvent() function) when view events occur in the server side view. This remote view in turn passes the events to its observers.

capability
ReadUserData

Parameters

MContactViewObserver & 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.

ContactAtL(TInt)

const CViewContact &ContactAtL(TIntaIndex)const [virtual]

Returns the contact item at a specified index into the server side view.

capability
ReadUserData
leave
KErrNotFound The index is greater than or equal to the number of items in the view.
leave
KErrNotReady The view is not ready for use.
panic
CntLock 6 The index is less than zero.

Parameters

TInt aIndexAn index into the server side view.

ContactViewPreferences()

TContactViewPreferences ContactViewPreferences()[virtual]

Gets the server side view's view preferences.

capability
ReadUserData

ContactsMatchingCriteriaL(const MDesCArray &, RPointerArray< CViewContact > &)

voidContactsMatchingCriteriaL(const MDesCArray &aFindWords,
RPointerArray< CViewContact > &aMatchedContacts
)[virtual]

Searches all contact items in the server side 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

Parameters

const MDesCArray & aFindWordsA descriptor array containing one or more search strings.
RPointerArray< CViewContact > & aMatchedContactsOn return, an array of matching contact items.

ContactsMatchingPrefixL(const MDesCArray &, RPointerArray< CViewContact > &)

voidContactsMatchingPrefixL(const MDesCArray &aFindWords,
RPointerArray< CViewContact > &aMatchedContacts
)[virtual]

Searches all contact items in the server side 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

Parameters

const MDesCArray & aFindWordsA descriptor array containing one or more search strings.
RPointerArray< CViewContact > & aMatchedContactsOn return, an array of matching contact items.

CountL()

TInt CountL()const [virtual]

Gets the total number of contact items in the server side view.

capability
ReadUserData
leave
KErrNotReady The view is not ready for use.

FindL(TContactItemId)

TInt FindL(TContactItemIdaId)const [virtual]

Searches for a contact item in the server side view with the specified ID.

capability
ReadUserData
leave
KErrNotReady The view is not ready for use.

Parameters

TContactItemId aIdThe ID of the contact item to search for.

GetContactIdsL(const CArrayFix< TInt > &, CContactIdArray &)

voidGetContactIdsL(const CArrayFix< TInt > &aIndexes,
CContactIdArray &aContactIds
)[virtual]

Gets an array containing the IDs of the contact items at the specified indexes into the server side view.

The IDs are appended to the array.

capability
ReadUserData

Parameters

const CArrayFix< TInt > & aIndexesAn array of indexes into the server side view.
CContactIdArray & aContactIdsOn return, an array to which the contact item IDs of each of the indexed items are appended.

GetContactsMatchingFilterL(TInt, RArray< TContactIdWithMapping > &)

voidGetContactsMatchingFilterL(TIntaFilter,
RArray< TContactIdWithMapping > &aMatchingContacts
)

Requests an array of contact IDs from the server-side view which match the filter provided by the client.

capability
ReadUserData

Parameters

TInt aFilter
RArray< TContactIdWithMapping > & aMatchingContacts

HandleContactViewEvent(const TContactViewEvent &)

voidHandleContactViewEvent(const TContactViewEvent &aEvent)[private]

Parameters

const TContactViewEvent & aEvent

NotifierCallBack(TAny *)

TInt NotifierCallBack(TAny *aSelf)[private, static]

Parameters

TAny * aSelf

SortOrderL()

const RContactViewSortOrder &SortOrderL()const [virtual]

Gets the server side view's sort order.

capability
ReadUserData

Member Data Documentation

TInt iCount

TInt iCount[private]

Cached copy of the count of the local view in the contacts server. If this is KCachedItemCountInvalid then next time CountL is called the current count is retrieved from the contacts server.

CContactRemoteViewNotifier * iNotifier

CContactRemoteViewNotifier *iNotifier[private]

RContactRemoteView iView

RContactRemoteView iView[protected]

A handle to the server side view.