CPbapContactDbViews Class Reference

class CPbapContactDbViews : public CBase

Provides API to search database and sort the results into name or pronunciation field order using contact database views

Inherits from

Public Member Functions
~CPbapContactDbViews()
voidCancelSearchAndSortRequest()
voidCloseAllViews()
voidGetContactIdsMatchingCriteriaL(SymbianPBAP::TOrder, SymbianPBAP::TSearchAttribute, const TDesC &, CContactIdArray &, MPbapContactDbViewsCallback &)
HBufC *GetContactNameFromIdL(TContactItemId)
CPbapContactDbViews *NewL(CContactDatabase &)
Private Member Functions
CPbapContactDbViews(CContactDatabase &)
voidAppendField(HBufC *, TUid, const CContactItemFieldSet &, TBool)
voidCancelAndCleanup()
voidCopyToResultsArrayL(const CContactIdArray &)
voidCreateNameViewL()
voidCreatePhoneticViewL()
voidDoSearchAndSortCallback()
voidDoSearchAndSortL()
voidDoSortL()
voidDoSortSearchResultsL(CContactIdArray &)
voidFindInPhoneFieldsL()
voidFindInViewL(CContactViewBase &)
CContactIdArray *GetContactIdsInViewL(CContactViewBase &)
voidHandleContactViewEvent(const CContactViewBase &, const TContactViewEvent &)
voidHandleFindInViewCompleteL()
voidHandleIdleFindCompleteL()
voidIdleFindCallback()
TBool IsPhoneticViewRequired()
voidNotifySearchAndSortComplete(TInt)
voidResortIdsInViewOrderL(CContactIdArray &, CContactViewBase &)
TInt SearchAndSortCallback(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()
Private Member Enumerations
enumTSearchAndSortOpState { EIdle, EPendingSearch, ESearching, ESorting }
Private Attributes
CAsyncCallBack *iAsyncCallback
MPbapContactDbViewsCallback *iCallback
CContactDatabase &iDatabase
CContactItemFieldDef *iFindFieldDef
CContactFindView *iFindView
CIdleFinder *iIdleFinder
CContactLocalView *iNameView
TBool iNameViewReady
TSearchAndSortOpState iOpState
SymbianPBAP::TOrder iOrder
CContactLocalView *iPhoneticView
TBool iPhoneticViewReady
CContactIdArray *iResults
SymbianPBAP::TSearchAttribute iSearchAttribute
HBufC *iSearchValue
CPtrCArray *iSearchValueArray

Constructor & Destructor Documentation

CPbapContactDbViews(CContactDatabase &)

CPbapContactDbViews(CContactDatabase &aDatabase)[private]

Parameters

CContactDatabase & aDatabase

~CPbapContactDbViews()

~CPbapContactDbViews()

Member Functions Documentation

AppendField(HBufC *, TUid, const CContactItemFieldSet &, TBool)

voidAppendField(HBufC *aBuf,
TUidaUid,
const CContactItemFieldSet &aFieldSet,
TBoolaLast = EFalse
)const [private]

Parameters

HBufC * aBuf
TUid aUid
const CContactItemFieldSet & aFieldSet
TBool aLast = EFalse

CancelAndCleanup()

voidCancelAndCleanup()[private]

CancelSearchAndSortRequest()

voidCancelSearchAndSortRequest()

CloseAllViews()

voidCloseAllViews()

Close all currently open views and abort current asynchronous search and sort request. This function should be called when the PBAP session ends (gracefully or otherwise) to save memory while there is no PBAP session open

CopyToResultsArrayL(const CContactIdArray &)

voidCopyToResultsArrayL(const CContactIdArray &aContactIds)[private]

Parameters

const CContactIdArray & aContactIds

CreateNameViewL()

voidCreateNameViewL()[private]

CreatePhoneticViewL()

voidCreatePhoneticViewL()[private]

DoSearchAndSortCallback()

voidDoSearchAndSortCallback()[private]

DoSearchAndSortL()

voidDoSearchAndSortL()[private]

DoSortL()

voidDoSortL()[private]

DoSortSearchResultsL(CContactIdArray &)

voidDoSortSearchResultsL(CContactIdArray &aContactIds)[private]

Parameters

CContactIdArray & aContactIds

FindInPhoneFieldsL()

voidFindInPhoneFieldsL()[private]

FindInViewL(CContactViewBase &)

voidFindInViewL(CContactViewBase &aView)[private]

Parameters

CContactViewBase & aView

GetContactIdsInViewL(CContactViewBase &)

CContactIdArray *GetContactIdsInViewL(CContactViewBase &aView)[private]

Parameters

CContactViewBase & aView

GetContactIdsMatchingCriteriaL(SymbianPBAP::TOrder, SymbianPBAP::TSearchAttribute, const TDesC &, CContactIdArray &, MPbapContactDbViewsCallback &)

voidGetContactIdsMatchingCriteriaL(SymbianPBAP::TOrderaOrder,
SymbianPBAP::TSearchAttributeaSearchAttribute,
const TDesC &aSearchValue,
CContactIdArray &aResults,
MPbapContactDbViewsCallback &aCallback
)

Finds contacts matching search parameters and returns the ids sorted in the requested order

Parameters

SymbianPBAP::TOrder aOrder
SymbianPBAP::TSearchAttribute aSearchAttribute
const TDesC & aSearchValue
CContactIdArray & aResults
MPbapContactDbViewsCallback & aCallback

GetContactNameFromIdL(TContactItemId)

HBufC *GetContactNameFromIdL(TContactItemIdaContactId)const

Get contact name string with fields separated by a semi-colon. The fields are read from the name view when it is ready, otherwise they are read from the database

Parameters

TContactItemId aContactId

HandleContactViewEvent(const CContactViewBase &, const TContactViewEvent &)

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

this function is part of MContactViewObserver and is called back as a result of an event occurring on a specific view, in our case iNameView or iPhoneticView

Parameters

const CContactViewBase & aView
const TContactViewEvent & aEvent

HandleFindInViewCompleteL()

voidHandleFindInViewCompleteL()[private]

HandleIdleFindCompleteL()

voidHandleIdleFindCompleteL()[private]

IdleFindCallback()

voidIdleFindCallback()[private]

IsPhoneticViewRequired()

TBool IsPhoneticViewRequired()const [private]

NewL(CContactDatabase &)

CPbapContactDbViews *NewL(CContactDatabase &aDatabase)[static]

Parameters

CContactDatabase & aDatabase

NotifySearchAndSortComplete(TInt)

voidNotifySearchAndSortComplete(TIntaError)[private]

Parameters

TInt aError

ResortIdsInViewOrderL(CContactIdArray &, CContactViewBase &)

voidResortIdsInViewOrderL(CContactIdArray &aContactIds,
CContactViewBase &aView
)[private]

aView will be sorted in a specific order and this function re-orders the contact ids in aContectIds to be in the same order

Parameters

CContactIdArray & aContactIds
CContactViewBase & aView

SearchAndSortCallback(TAny *)

TInt SearchAndSortCallback(TAny *aAny)[private, static]

Parameters

TAny * aAny

Member Enumerations Documentation

Enum TSearchAndSortOpState

Enumerators

EIdle
EPendingSearch
ESearching
ESorting

Member Data Documentation

CAsyncCallBack * iAsyncCallback

CAsyncCallBack *iAsyncCallback[private]

MPbapContactDbViewsCallback * iCallback

MPbapContactDbViewsCallback *iCallback[private]

CContactDatabase & iDatabase

CContactDatabase &iDatabase[private]

CContactItemFieldDef * iFindFieldDef

CContactItemFieldDef *iFindFieldDef[private]

CContactFindView * iFindView

CContactFindView *iFindView[private]

CIdleFinder * iIdleFinder

CIdleFinder *iIdleFinder[private]

CContactLocalView * iNameView

CContactLocalView *iNameView[private]

TBool iNameViewReady

TBool iNameViewReady[private]

TSearchAndSortOpState iOpState

TSearchAndSortOpState iOpState[private]

SymbianPBAP::TOrder iOrder

SymbianPBAP::TOrder iOrder[private]

CContactLocalView * iPhoneticView

CContactLocalView *iPhoneticView[private]

TBool iPhoneticViewReady

TBool iPhoneticViewReady[private]

CContactIdArray * iResults

CContactIdArray *iResults[private]

SymbianPBAP::TSearchAttribute iSearchAttribute

SymbianPBAP::TSearchAttribute iSearchAttribute[private]

HBufC * iSearchValue

HBufC *iSearchValue[private]

CPtrCArray * iSearchValueArray

CPtrCArray *iSearchValueArray[private]