CPbkContactSubView Class Reference

class CPbkContactSubView : public CContactViewBase

Inherits from

Nested Classes and Structures

Public Member Functions
IMPORT_C void AddBaseViewPreEventHandlerL ( MContactViewObserver &)
IMPORT_C void AddContactL ( 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 void Refresh ()
IMPORT_C void RemoveBaseViewPreEventHandler ( MContactViewObserver &)
IMPORT_C void RemoveContact ( TContactItemId )
IMPORT_C void SetContactSelector ( MPbkContactSelector &)
const RContactViewSortOrder & SortOrderL ()
Protected Member Functions
CPbkContactSubView (const CContactDatabase &, MPbkContactSelector &)
~CPbkContactSubView ()
void ConstructL ( MContactViewObserver &, CContactViewBase &)
Private Member Functions
void AddMappingL (const TIdWithMapping &)
TInt CompareIndexes (const TIdWithMapping &, const TIdWithMapping &)
TInt DoFind ( TContactItemId )
void HandleContactViewEvent (const CContactViewBase &, const TContactViewEvent &)
TBool HandleItemAdded ( TContactViewEvent &)
TBool HandleItemAddedL ( TContactViewEvent &)
TBool HandleItemRemoved ( TContactViewEvent &)
TBool HandleItemRemovedL ( TContactViewEvent &)
TBool IdsEqual (const TIdWithMapping &, const TIdWithMapping &)
void MappingComplete ()
void MappingError ( TInt )
void ResetMapping ()
void SetStateInitializing ()
void SetStateNotReady (const TContactViewEvent &)
void SetStateReady (const TContactViewEvent &)
void StartMapping (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 & aDb an open contact db
MPbkContactSelector & aContactSelector contact selector used to filter this view's contents

~CPbkContactSubView()

~CPbkContactSubView ( ) [protected]

Destructor.

Member Functions Documentation

AddBaseViewPreEventHandlerL(MContactViewObserver &)

IMPORT_C void AddBaseViewPreEventHandlerL ( 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 & aObserver contact view observer

AddContactL(TContactItemId)

IMPORT_C void AddContactL ( TContactItemId aContactId )

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

Parameters

TContactItemId aContactId id of the contact to add.

AddMappingL(const TIdWithMapping &)

void AddMappingL ( const TIdWithMapping & aMapping ) [private]

Called by CMapper.

Parameters

const TIdWithMapping & aMapping

AllFieldsLC(TInt, const TDesC &)

HBufC * AllFieldsLC ( TInt aIndex,
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 aIndex The index of the contact item into the view.
const TDesC & aSeparator The string to use to separate the fields.

AtL(TInt)

TContactItemId AtL ( TInt aIndex ) const [virtual]

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

capability
ReadUserData

Parameters

TInt aIndex Index of the contact item ID into the view.

CContactViewBase_Reserved_1(TFunction, TAny *)

TAny * CContactViewBase_Reserved_1 ( TFunction aFunction,
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 &)

void ConstructL ( MContactViewObserver & aObserver,
CContactViewBase & aBaseView
) [protected]

Second phase constructor.

Parameters

MContactViewObserver & aObserver mandatory observer for this view
CContactViewBase & aBaseView a contact view this view's contents is filtered from

ContactAtL(TInt)

const CViewContact & ContactAtL ( TInt aIndex ) const [virtual]

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

capability
ReadUserData

Parameters

TInt aIndex Index 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 ( TContactItemId aId ) const [private, inline]

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

Parameters

TContactItemId aId

FindL(TContactItemId)

TInt FindL ( TContactItemId aId ) const [virtual]

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

capability
ReadUserData

Parameters

TContactItemId aId The contact item ID to search for.

HandleContactViewEvent(const CContactViewBase &, const TContactViewEvent &)

void HandleContactViewEvent ( 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()

void MappingComplete ( ) [private, inline]

Called by CMapper.

MappingError(TInt)

void MappingError ( TInt aError ) [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 & aObserver observer for this contact view
const CContactDatabase & aDb contact database reference
CContactViewBase & aBaseView the view this view is based on
MPbkContactSelector & aContactSelector contact selector used to filter this view's contents

Refresh()

IMPORT_C void Refresh ( )

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 void RemoveBaseViewPreEventHandler ( MContactViewObserver & aObserver )

Removes a pre event handler registered with AddBaseViewPreEventHandlerL() .

Parameters

MContactViewObserver & aObserver contact view observer

RemoveContact(TContactItemId)

IMPORT_C void RemoveContact ( TContactItemId aContactId )

Removes a contact from this sub view's set.

Parameters

TContactItemId aContactId id of the contact to remove.

ResetMapping()

void ResetMapping ( ) [private]

Resets any mapping currently in progress.

SetContactSelector(MPbkContactSelector &)

IMPORT_C void SetContactSelector ( 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 & aContactSelector contact selector used to filter this view's contents

SetStateInitializing()

void SetStateInitializing ( ) [private]

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

SetStateNotReady(const TContactViewEvent &)

void SetStateNotReady ( const TContactViewEvent & aEvent ) [private]

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

Parameters

const TContactViewEvent & aEvent

SetStateReady(const TContactViewEvent &)

void SetStateReady ( 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 &)

void StartMapping ( 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]