CPbkContactSubView Class Reference

class CPbkContactSubView : public CContactViewBase

Inherits from

Nested Classes and Structures

Public Member Functions
IMPORT_C voidAddBaseViewPreEventHandlerL(MContactViewObserver &)
IMPORT_C voidAddContactL(TContactItemId)
HBufC *AllFieldsLC(TInt, const TDesC &)
TContactItemId AtL(TInt)
TAny *CContactViewBase_Reserved_1(TFunction, TAny *)
const CViewContact &ContactAtL(TInt)
IMPORT_C MPbkContactSelector &ContactSelector()
TContactViewPreferences ContactViewPreferences()
TInt CountL()
TInt FindL(TContactItemId)
IMPORT_C CPbkContactSubView *NewL(MContactViewObserver &, const CContactDatabase &, CContactViewBase &, MPbkContactSelector &)
IMPORT_C voidRefresh()
IMPORT_C voidRemoveBaseViewPreEventHandler(MContactViewObserver &)
IMPORT_C voidRemoveContact(TContactItemId)
IMPORT_C voidSetContactSelector(MPbkContactSelector &)
const RContactViewSortOrder &SortOrderL()
Protected Member Functions
CPbkContactSubView(const CContactDatabase &, MPbkContactSelector &)
~CPbkContactSubView()
voidConstructL(MContactViewObserver &, CContactViewBase &)
Private Member Functions
voidAddMappingL(const TIdWithMapping &)
TInt CompareIndexes(const TIdWithMapping &, const TIdWithMapping &)
TInt DoFind(TContactItemId)
voidHandleContactViewEvent(const CContactViewBase &, const TContactViewEvent &)
TBool HandleItemAdded(TContactViewEvent &)
TBool HandleItemAddedL(TContactViewEvent &)
TBool HandleItemRemoved(TContactViewEvent &)
TBool HandleItemRemovedL(TContactViewEvent &)
TBool IdsEqual(const TIdWithMapping &, const TIdWithMapping &)
voidMappingComplete()
voidMappingError(TInt)
voidResetMapping()
voidSetStateInitializing()
voidSetStateNotReady(const TContactViewEvent &)
voidSetStateReady(const TContactViewEvent &)
voidStartMapping(const TContactViewEvent &)
TInt UpdateMappingsL()
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()
Inherited Enumerations
CContactViewBase:TFunction
CContactViewBase:TSearchType
CContactViewBase:TState
Private Attributes
CContactViewBase *iBaseView
MPbkContactSelector *iContactSelector
RArray< TIdWithMapping >iFilteredIdArray
CMapper *iMapper
TContactViewEvent iMappingCompleteEvent
RPointerArray< MContactViewObserver >iPreBaseViewObservers
Inherited Attributes
CContactViewBase::iDb
CContactViewBase::iExtension
CContactViewBase::iState

Constructor & Destructor Documentation

CPbkContactSubView(const CContactDatabase &, MPbkContactSelector &)

CPbkContactSubView(const CContactDatabase &aDb,
MPbkContactSelector &aContactSelector
)[protected, inline]

C++ constructor.

Parameters

const CContactDatabase & aDban open contact db
MPbkContactSelector & aContactSelectorcontact selector used to filter this view's contents

~CPbkContactSubView()

~CPbkContactSubView()[protected]

Destructor.

Member Functions Documentation

AddBaseViewPreEventHandlerL(MContactViewObserver &)

IMPORT_C voidAddBaseViewPreEventHandlerL(MContactViewObserver &aObserver)

Adds an event handler which sees all underlying view's events before this view handles the event. Use to update any data structure used in MPbkContactSelector::IsContactIncluded().

Parameters

MContactViewObserver & aObservercontact view observer

AddContactL(TContactItemId)

IMPORT_C voidAddContactL(TContactItemIdaContactId)

Adds a contact to this sub view's set. Leaves with KErrNotFound if the contact id is not found from the db.

Parameters

TContactItemId aContactIdid of the contact to add.

AddMappingL(const TIdWithMapping &)

voidAddMappingL(const TIdWithMapping &aMapping)[private]

Called by CMapper.

Parameters

const TIdWithMapping & aMapping

AllFieldsLC(TInt, const TDesC &)

HBufC *AllFieldsLC(TIntaIndex,
const TDesC &aSeparator
)const [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

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 contact item ID at the specified index into the view.

capability
ReadUserData

Parameters

TInt aIndexIndex of the contact item ID into the view.

CContactViewBase_Reserved_1(TFunction, TAny *)

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

Parameters

TFunction aFunction
TAny * aParams

CompareIndexes(const TIdWithMapping &, const TIdWithMapping &)

TInt CompareIndexes(const TIdWithMapping &aLhs,
const TIdWithMapping &aRhs
)[private, static]

Parameters

const TIdWithMapping & aLhs
const TIdWithMapping & aRhs

ConstructL(MContactViewObserver &, CContactViewBase &)

voidConstructL(MContactViewObserver &aObserver,
CContactViewBase &aBaseView
)[protected]

Second phase constructor.

Parameters

MContactViewObserver & aObservermandatory observer for this view
CContactViewBase & aBaseViewa contact view this view's contents is filtered from

ContactAtL(TInt)

const CViewContact &ContactAtL(TIntaIndex)const [virtual]

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

capability
ReadUserData

Parameters

TInt aIndexIndex of the contact item into the view.

ContactSelector()

IMPORT_C MPbkContactSelector &ContactSelector()const

Returns the current contact selector.

ContactViewPreferences()

TContactViewPreferences ContactViewPreferences()[virtual]

Gets the view preferences.

capability
ReadUserData

CountL()

TInt CountL()const [virtual]

Returns the number of contact items in the view.

capability
ReadUserData

DoFind(TContactItemId)

TInt DoFind(TContactItemIdaId)const [private, inline]

Searches this view for the index of aId. If not found returns KErrNotFound.

Parameters

TContactItemId aId

FindL(TContactItemId)

TInt FindL(TContactItemIdaId)const [virtual]

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

capability
ReadUserData

Parameters

TContactItemId aIdThe contact item ID to search for.

HandleContactViewEvent(const CContactViewBase &, const TContactViewEvent &)

voidHandleContactViewEvent(const CContactViewBase &aView,
const TContactViewEvent &aEvent
)[private]

Handles an event from iBaseView and synchronizes this view's state accordingly.

Parameters

const CContactViewBase & aView
const TContactViewEvent & aEvent

HandleItemAdded(TContactViewEvent &)

TBool HandleItemAdded(TContactViewEvent &aEvent)[private]

Parameters

TContactViewEvent & aEvent

HandleItemAddedL(TContactViewEvent &)

TBool HandleItemAddedL(TContactViewEvent &aEvent)[private]

Handles item added event from iBaseView.

Parameters

TContactViewEvent & aEvent

HandleItemRemoved(TContactViewEvent &)

TBool HandleItemRemoved(TContactViewEvent &aEvent)[private]

Parameters

TContactViewEvent & aEvent

HandleItemRemovedL(TContactViewEvent &)

TBool HandleItemRemovedL(TContactViewEvent &aEvent)[private]

Handles item removed event from iBaseView.

Parameters

TContactViewEvent & aEvent

IdsEqual(const TIdWithMapping &, const TIdWithMapping &)

TBool IdsEqual(const TIdWithMapping &aLhs,
const TIdWithMapping &aRhs
)[private, static]

Parameters

const TIdWithMapping & aLhs
const TIdWithMapping & aRhs

MappingComplete()

voidMappingComplete()[private, inline]

Called by CMapper.

MappingError(TInt)

voidMappingError(TIntaError)[private, inline]

Called by CMapper.

Parameters

TInt aError

NewL(MContactViewObserver &, const CContactDatabase &, CContactViewBase &, MPbkContactSelector &)

IMPORT_C CPbkContactSubView *NewL(MContactViewObserver &aObserver,
const CContactDatabase &aDb,
CContactViewBase &aBaseView,
MPbkContactSelector &aContactSelector
)[static]

Creates a new instance of this class.

Parameters

MContactViewObserver & aObserverobserver for this contact view
const CContactDatabase & aDbcontact database reference
CContactViewBase & aBaseViewthe view this view is based on
MPbkContactSelector & aContactSelectorcontact selector used to filter this view's contents

Refresh()

IMPORT_C voidRefresh()

Refreshes the contents of this sub view by querying each contact again from the selector. Sends TContactViewEvent::EReady when this view is again ready for use. TContactViewEvent::ESortError is sent if there is an error.

RemoveBaseViewPreEventHandler(MContactViewObserver &)

IMPORT_C voidRemoveBaseViewPreEventHandler(MContactViewObserver &aObserver)

Removes a pre event handler registered with AddBaseViewPreEventHandlerL().

Parameters

MContactViewObserver & aObservercontact view observer

RemoveContact(TContactItemId)

IMPORT_C voidRemoveContact(TContactItemIdaContactId)

Removes a contact from this sub view's set.

Parameters

TContactItemId aContactIdid of the contact to remove.

ResetMapping()

voidResetMapping()[private]

Resets any mapping currently in progress.

SetContactSelector(MPbkContactSelector &)

IMPORT_C voidSetContactSelector(MPbkContactSelector &aContactSelector)

Changes the contacts included in this sub view. Sends TContactViewEvent::EUnavailable. TContactViewEvent::EReady is sent when this view is again ready for use. TContactViewEvent::ESortError is sent if there is an error.

Parameters

MPbkContactSelector & aContactSelectorcontact selector used to filter this view's contents

SetStateInitializing()

voidSetStateInitializing()[private]

Switches this view to EInitializing state and notifies observers with TContactViewEvent::EUnavailable if the current state is EReady.

SetStateNotReady(const TContactViewEvent &)

voidSetStateNotReady(const TContactViewEvent &aEvent)[private]

Switches this view to ENotReady state and notifies observers with aEvent.

Parameters

const TContactViewEvent & aEvent

SetStateReady(const TContactViewEvent &)

voidSetStateReady(const TContactViewEvent &aEvent)[private]

Switches this view to EReady state and notifies observers with aEvent.

Parameters

const TContactViewEvent & aEvent

SortOrderL()

const RContactViewSortOrder &SortOrderL()const [virtual]

Gets the view's sort order.

capability
ReadUserData

StartMapping(const TContactViewEvent &)

voidStartMapping(const TContactViewEvent &aCompleteEvent)[private]

Starts mapping contacts from iBaseView to this view.

Parameters

const TContactViewEvent & aCompleteEvent

UpdateMappingsL()

TInt UpdateMappingsL()[private]

Updates all this view's index mappings.

Member Data Documentation

CContactViewBase * iBaseView

CContactViewBase *iBaseView[private]

MPbkContactSelector * iContactSelector

MPbkContactSelector *iContactSelector[private]

RArray< TIdWithMapping > iFilteredIdArray

RArray< TIdWithMapping >iFilteredIdArray[private]

CMapper * iMapper

CMapper *iMapper[private]

TContactViewEvent iMappingCompleteEvent

TContactViewEvent iMappingCompleteEvent[private]

RPointerArray< MContactViewObserver > iPreBaseViewObservers

RPointerArray< MContactViewObserver >iPreBaseViewObservers[private]