CContactViewBase Class Reference

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.

Inherits from

Public Member Functions
HBufC *AllFieldsLC(TInt, const TDesC &)
TContactItemId AtL(TInt)
IMPORT_C TAny *CContactViewBase_Reserved_1(TFunction, TAny *)
IMPORT_C TBoolClose(const MContactViewObserver &)
const CViewContact &ContactAtL(TInt)
TContactViewPreferences ContactViewPreferences()
IMPORT_C voidContactsMatchingCriteriaL(const MDesCArray &, RPointerArray< CViewContact > &)
IMPORT_C voidContactsMatchingPrefixL(const MDesCArray &, RPointerArray< CViewContact > &)
TInt CountL()
IMPORT_C TIntError()
TInt FindL(TContactItemId)
IMPORT_C voidGetContactIdsL(const CArrayFix< TInt > &, CContactIdArray &)
IMPORT_C TUidGetViewFindConfigPlugin()
IMPORT_C TUidGetViewSortPluginImplUid()
IMPORT_C TIntOpen(MContactViewObserver &)
IMPORT_C voidOpenL(MContactViewObserver &)
IMPORT_C voidSetViewFindConfigPlugin(TUid)
const RContactViewSortOrder &SortOrderL()
Protected Member Functions
CContactViewBase(const CContactDatabase &)
~CContactViewBase()
IMPORT_C TIntCompareContactIds(const CViewContact &, const CViewContact &)
IMPORT_C TIntCompareContactsAndIdsL(const CViewContact &, const CViewContact &)
IMPORT_C TIntCompareFieldsL(const CViewContact &, const CViewContact &)
IMPORT_C voidConstructL()
IMPORT_C TBoolContactIsSortable(const CViewContact &)
IMPORT_C HBufC *FieldsWithSeparatorLC(const RPointerArray< CViewContact > &, TInt, const TDesC &)
TUid FindDefaultViewSortPluginImplL()
TUid FindSortPluginImplL(const TDesC8 &, TBool)
IMPORT_C TBoolIdsEqual(const TContactIdWithMapping &, const TContactIdWithMapping &)
IMPORT_C TBoolIdsMatch(const CViewContact &, const CViewContact &)
IMPORT_C TBoolIndexesEqual(const TContactIdWithMapping &, const TContactIdWithMapping &)
TInt InsertContactInView(RPointerArray< CViewContact > &, const CViewContact *, TBool, TInt *)
TBool IsContactSortable(const CViewContact &, TContactViewPreferences &)
voidLoadViewSortPluginL(TUid, TContactViewPreferences &)
IMPORT_C TBoolMatchesCriteriaL(const CViewContact &, const MDesCArray &)
IMPORT_C TBoolMatchesCriteriaL(const CViewContact &, const MDesCArray &, TSearchType)
IMPORT_C TBoolMatchesCriteriaL(const CViewContact &, const MDesCArray &, TSearchType, CContactViewBase::CContactViewBaseExtension *)
IMPORT_C TIntNotifyObserverAsync(MContactViewObserver &, const TContactViewEvent &)
IMPORT_C voidNotifyObservers(const TContactViewEvent &)
CViewContactSortPlugin *SortPluginImpl()
Private Member Functions
TInt AsyncNotifyCallBack(TAny *)
TInt CompareFieldsWithCollationLevel(const CViewContact &, const CViewContact &, TInt, TCollationMethod *)
TBool ContactMatchesCriteriaL(const CViewContact &, const MDesCArray &, CContactViewBase::CContactViewBaseExtension *)
CDesCArrayFlat *CreateFindWordArrayLC(const MDesCArray &, TSearchType)
voidGetContactsMatchingFilterL(TInt, RArray< TContactIdWithMapping > &)
TInt GetErrorValueFromExtensionClass()
voidMatchContactsL(const MDesCArray &, RPointerArray< CViewContact > &, TSearchType)
TInt TextCompareFieldsL(const CViewContact &, const CViewContact &)
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()
Public Member Enumerations
enumTFunction { ECContactViewBaseVirtualFunction1, ECContactViewBaseVirtualFunction2, ECContactViewBaseVirtualFunction3 }
enumTSearchType { EFullSearch, EPrefixSearch }
Protected Member Enumerations
enumTState { EInitializing, EReady, ENotReady }
Protected Attributes
const CContactDatabase &iDb
CContactViewBaseExtension *iExtension
TState iState
Private Attributes
CIdle *iAsyncNotifier
RPointerArray< MContactViewObserver >iObserverArray
RArray< TObserverAndEvent >iOutstandingNotifications

Constructor & Destructor Documentation

CContactViewBase(const CContactDatabase &)

IMPORT_CCContactViewBase(const CContactDatabase &aDb)[protected]

Parameters

const CContactDatabase & aDb

~CContactViewBase()

IMPORT_C~CContactViewBase()[protected]

Member Functions Documentation

AllFieldsLC(TInt, const TDesC &)

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

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

Pointer to the contact item descriptor.

Parameters

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

AsyncNotifyCallBack(TAny *)

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

Parameters

TAny * aSelf

AtL(TInt)

TContactItemId AtL(TIntaIndex)const [pure virtual]

Returns the contact item ID at the specified index into the view.

capability

ReadUserData

The contact item ID.

Parameters

TInt aIndexIndex of the contact item ID into the view.

CContactViewBase_Reserved_1(TFunction, TAny *)

IMPORT_C TAny *CContactViewBase_Reserved_1(TFunctionaFunction,
TAny *aParams
)[virtual]

Parameters

TFunction aFunction
TAny * aParams

Close(const MContactViewObserver &)

IMPORT_C TBoolClose(const MContactViewObserver &aObserver)

Parameters

const MContactViewObserver & aObserver

CompareContactIds(const CViewContact &, const CViewContact &)

IMPORT_C TIntCompareContactIds(const CViewContact &aFirst,
const CViewContact &aSecond
)[protected, static]

Parameters

const CViewContact & aFirst
const CViewContact & aSecond

CompareContactsAndIdsL(const CViewContact &, const CViewContact &)

IMPORT_C TIntCompareContactsAndIdsL(const CViewContact &aFirst,
const CViewContact &aSecond
)const [protected]

Parameters

const CViewContact & aFirst
const CViewContact & aSecond

CompareFieldsL(const CViewContact &, const CViewContact &)

IMPORT_C TIntCompareFieldsL(const CViewContact &aFirst,
const CViewContact &aSecond
)[protected, static]

Parameters

const CViewContact & aFirst
const CViewContact & aSecond

CompareFieldsWithCollationLevel(const CViewContact &, const CViewContact &, TInt, TCollationMethod *)

TInt CompareFieldsWithCollationLevel(const CViewContact &aFirst,
const CViewContact &aSecond,
TIntaCollationLevel,
TCollationMethod *aCollateMethod
)[private, static]

Parameters

const CViewContact & aFirst
const CViewContact & aSecond
TInt aCollationLevel
TCollationMethod * aCollateMethod

ConstructL()

IMPORT_C voidConstructL()[protected]

ContactAtL(TInt)

const CViewContact &ContactAtL(TIntaIndex)const [pure virtual]

Returns the contact item at the specified index into the view.

capability

ReadUserData

The contact item.

Parameters

TInt aIndexIndex of the contact item into the view.

ContactIsSortable(const CViewContact &)

IMPORT_C TBoolContactIsSortable(const CViewContact &aContact)[protected, static]

Parameters

const CViewContact & aContact

ContactMatchesCriteriaL(const CViewContact &, const MDesCArray &, CContactViewBase::CContactViewBaseExtension *)

TBool ContactMatchesCriteriaL(const CViewContact &aContact,
const MDesCArray &aFindWords,
CContactViewBase::CContactViewBaseExtension *aExtension
)[private, static]

Parameters

const CViewContact & aContact
const MDesCArray & aFindWords
CContactViewBase::CContactViewBaseExtension * aExtension

ContactViewPreferences()

TContactViewPreferences ContactViewPreferences()[pure virtual]

Gets the view preferences.

capability

ReadUserData

The view preferences.

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

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

Parameters

const MDesCArray & aFindWords
RPointerArray< CViewContact > & aMatchedContacts

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

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

Parameters

const MDesCArray & aFindWords
RPointerArray< CViewContact > & aMatchedContacts

CountL()

TInt CountL()const [pure virtual]

Returns the number of contact items in the view.

capability

ReadUserData

The number of contact items in the view.

CreateFindWordArrayLC(const MDesCArray &, TSearchType)

CDesCArrayFlat *CreateFindWordArrayLC(const MDesCArray &aFindWords,
TSearchTypeaSearchType
)[private, static]

Parameters

const MDesCArray & aFindWords
TSearchType aSearchType

Error()

IMPORT_C TIntError()const

FieldsWithSeparatorLC(const RPointerArray< CViewContact > &, TInt, const TDesC &)

IMPORT_C HBufC *FieldsWithSeparatorLC(const RPointerArray< CViewContact > &aContacts,
TIntaIndex,
const TDesC &aSeparator
)const [protected]

Parameters

const RPointerArray< CViewContact > & aContacts
TInt aIndex
const TDesC & aSeparator

FindDefaultViewSortPluginImplL()

TUid FindDefaultViewSortPluginImplL()const [protected]

FindL(TContactItemId)

TInt FindL(TContactItemIdaId)const [pure virtual]

Returns the index into the view of the specified contact item.

capability

ReadUserData

The index into the view of the contact item ID, or KErrNotFound if no matching ID can be found.

Parameters

TContactItemId aIdThe contact item ID to search for.

FindSortPluginImplL(const TDesC8 &, TBool)

TUid FindSortPluginImplL(const TDesC8 &aSortPluginName,
TBoolaWildCard = EFalse
)const [protected]

Parameters

const TDesC8 & aSortPluginName
TBool aWildCard = EFalse

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

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

Parameters

const CArrayFix< TInt > & aIndexes
CContactIdArray & aContactIds

GetContactsMatchingFilterL(TInt, RArray< TContactIdWithMapping > &)

voidGetContactsMatchingFilterL(TIntaFilter,
RArray< TContactIdWithMapping > &aMatchingContacts
)[private]

Parameters

TInt aFilter
RArray< TContactIdWithMapping > & aMatchingContacts

GetErrorValueFromExtensionClass()

TInt GetErrorValueFromExtensionClass()[private]

GetViewFindConfigPlugin()

IMPORT_C TUidGetViewFindConfigPlugin()

GetViewSortPluginImplUid()

IMPORT_C TUidGetViewSortPluginImplUid()const

IdsEqual(const TContactIdWithMapping &, const TContactIdWithMapping &)

IMPORT_C TBoolIdsEqual(const TContactIdWithMapping &aFirst,
const TContactIdWithMapping &aSecond
)[protected, static]

Parameters

const TContactIdWithMapping & aFirst
const TContactIdWithMapping & aSecond

IdsMatch(const CViewContact &, const CViewContact &)

IMPORT_C TBoolIdsMatch(const CViewContact &aFirst,
const CViewContact &aSecond
)[protected, static]

Parameters

const CViewContact & aFirst
const CViewContact & aSecond

IndexesEqual(const TContactIdWithMapping &, const TContactIdWithMapping &)

IMPORT_C TBoolIndexesEqual(const TContactIdWithMapping &aFirst,
const TContactIdWithMapping &aSecond
)[protected, static]

Parameters

const TContactIdWithMapping & aFirst
const TContactIdWithMapping & aSecond

InsertContactInView(RPointerArray< CViewContact > &, const CViewContact *, TBool, TInt *)

TInt InsertContactInView(RPointerArray< CViewContact > &aContacts,
const CViewContact *aNewContact,
TBoolaSortByIdOnly,
TInt *aIndex
)const [protected]

Parameters

RPointerArray< CViewContact > & aContacts
const CViewContact * aNewContact
TBool aSortByIdOnly
TInt * aIndex

IsContactSortable(const CViewContact &, TContactViewPreferences &)

TBool IsContactSortable(const CViewContact &aContact,
TContactViewPreferences &aViewPreferences
)const [protected]

Parameters

const CViewContact & aContact
TContactViewPreferences & aViewPreferences

LoadViewSortPluginL(TUid, TContactViewPreferences &)

voidLoadViewSortPluginL(TUidaSortPluginUid,
TContactViewPreferences &aViewPreferences
)[protected]

Parameters

TUid aSortPluginUid
TContactViewPreferences & aViewPreferences

MatchContactsL(const MDesCArray &, RPointerArray< CViewContact > &, TSearchType)

voidMatchContactsL(const MDesCArray &aFindWords,
RPointerArray< CViewContact > &aMatchedContacts,
TSearchTypeaSearchType
)[private]

Parameters

const MDesCArray & aFindWords
RPointerArray< CViewContact > & aMatchedContacts
TSearchType aSearchType

MatchesCriteriaL(const CViewContact &, const MDesCArray &)

IMPORT_C TBoolMatchesCriteriaL(const CViewContact &aContact,
const MDesCArray &aFindWords
)[protected, virtual]

Parameters

const CViewContact & aContact
const MDesCArray & aFindWords

MatchesCriteriaL(const CViewContact &, const MDesCArray &, TSearchType)

IMPORT_C TBoolMatchesCriteriaL(const CViewContact &aContact,
const MDesCArray &aFindWords,
TSearchTypeaSearchType
)[protected, static]

Parameters

const CViewContact & aContact
const MDesCArray & aFindWords
TSearchType aSearchType

MatchesCriteriaL(const CViewContact &, const MDesCArray &, TSearchType, CContactViewBase::CContactViewBaseExtension *)

IMPORT_C TBoolMatchesCriteriaL(const CViewContact &aContact,
const MDesCArray &aFindWords,
TSearchTypeaSearchType,
CContactViewBase::CContactViewBaseExtension *aExtension
)[protected, static]

Parameters

const CViewContact & aContact
const MDesCArray & aFindWords
TSearchType aSearchType
CContactViewBase::CContactViewBaseExtension * aExtension

NotifyObserverAsync(MContactViewObserver &, const TContactViewEvent &)

IMPORT_C TIntNotifyObserverAsync(MContactViewObserver &aObserver,
const TContactViewEvent &aEvent
)[protected]

Parameters

MContactViewObserver & aObserver
const TContactViewEvent & aEvent

NotifyObservers(const TContactViewEvent &)

IMPORT_C voidNotifyObservers(const TContactViewEvent &aEvent)[protected]

Parameters

const TContactViewEvent & aEvent

Open(MContactViewObserver &)

IMPORT_C TIntOpen(MContactViewObserver &aObserver)

Parameters

MContactViewObserver & aObserver

OpenL(MContactViewObserver &)

IMPORT_C voidOpenL(MContactViewObserver &aObserver)

Parameters

MContactViewObserver & aObserver

SetViewFindConfigPlugin(TUid)

IMPORT_C voidSetViewFindConfigPlugin(TUidaUid)

Parameters

TUid aUid

SortOrderL()

const RContactViewSortOrder &SortOrderL()const [pure virtual]

Gets the view's sort order.

capability

ReadUserData

The sort order.

SortPluginImpl()

CViewContactSortPlugin *SortPluginImpl()const [protected]

TextCompareFieldsL(const CViewContact &, const CViewContact &)

TInt TextCompareFieldsL(const CViewContact &aFirst,
const CViewContact &aSecond
)const [private]

Parameters

const CViewContact & aFirst
const CViewContact & aSecond

Member Enumerations Documentation

Enum 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.

Enumerators

ECContactViewBaseVirtualFunction1

Identifies the function CContactViewBase::GetContactIdsL().

ECContactViewBaseVirtualFunction2

Identifies the function CContactViewBase::GetContactsMatchingFilterL().

ECContactViewBaseVirtualFunction3

Identifies the function CContactViewBase::InsertContactInView().

Enum 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.

Enumerators

EFullSearch

The search uses full wildcard matching so that the search string can occur anywhere in the item's fields.

EPrefixSearch

The search uses partial wildcard matching so that the search string can only occur at the beginning of the item's fields.

Enum TState

Defines the contact view states.

Enumerators

EInitializing

The view is initialising.

This is the view's state immediately after construction or after a significant change (e.g CurrentDatabaseChanged or UnknownChanges), indicating that it can't be used yet.

EReady

The view is ready to be used.

ENotReady

The view is not ready to be used, for instance immediately after the sort order has changed, or after an error has occurred.

Member Data Documentation

CIdle * iAsyncNotifier

CIdle *iAsyncNotifier[private]

const CContactDatabase & iDb

const CContactDatabase &iDb[protected]

CContactViewBaseExtension * iExtension

CContactViewBaseExtension *iExtension[protected]

RPointerArray< MContactViewObserver > iObserverArray

RPointerArray< MContactViewObserver >iObserverArray[private]

RArray< TObserverAndEvent > iOutstandingNotifications

RArray< TObserverAndEvent >iOutstandingNotifications[private]

TState iState

TState iState[protected]