CVPbkContactManager Class Reference

class CVPbkContactManager : public CBase

Virtual Phonebook Contact Manager. Contact Manager is the root access point to Virtual Phonebook engine functionality. The client can specify the list of stores in the constructor he/she is interested in or load additional plug-ins later on. In addition to loading the implementing plug-ins the client must open the stores. Clients should share the contact manager instance within their context, otherwise e.g. field types from two different instances will not produce the matches as the matching is based on pointer comparison.

Examples of absolute URI stores: Default contact database: "cntdb://contacts.cdb" LDAP store: "ldap://www.telnumbers.com/" The URI scheme name is used to resolve a store capable of supporting this type of store. The actual store implementations are ECom plugins.

VPbkEng.lib

Inherits from

Nested Classes and Structures

Public Member Functions
~CVPbkContactManager ()
IMPORT_C MVPbkContactOperationBase * CommitContactsL (const TArray < MVPbkStoreContact * > &, MVPbkBatchOperationObserver &)
IMPORT_C MVPbkContactOperationBase * CompressStoresL ( MVPbkBatchOperationObserver &)
IMPORT_C MVPbkContactAttributeManager & ContactAttributeManagerL ()
IMPORT_C MVPbkContactStoreList & ContactStoresL ()
IMPORT_C MVPbkContactOperationBase * CopyContactsL (const MVPbkContactLinkArray &, MVPbkContactStore *, MVPbkBatchOperationObserver &)
IMPORT_C MVPbkContactViewBase * CreateContactViewLC ( MVPbkContactViewObserver &, const CVPbkContactViewDefinition &, const MVPbkFieldTypeList &)
IMPORT_C MVPbkContactLinkArray * CreateLinksLC (const TDesC8 &)
IMPORT_C MVPbkContactLinkArray * CreateLinksLC ( RReadStream &)
IMPORT_C MVPbkContactOperationBase * DeleteContactsL (const MVPbkContactLinkArray &, MVPbkBatchOperationObserver &)
IMPORT_C const MVPbkFieldTypeList & FieldTypes ()
IMPORT_C MVPbkContactOperationBase * FindL (const TDesC &, const MVPbkFieldTypeList &, MVPbkContactFindObserver &)
IMPORT_C MVPbkContactOperationBase * FindL (const MDesC16Array &, const MVPbkFieldTypeList &, MVPbkContactFindFromStoresObserver &, const TCallBack &)
IMPORT_C MVPbkContactOperationBase * FindL (const MDesC16Array &, const MVPbkFieldTypeList &, MVPbkContactFindFromStoresObserver &, const TCallBack &, const CDesC16ArrayFlat &)
IMPORT_C RFs & FsSession ()
IMPORT_C void LoadContactStoreL (const TVPbkContactStoreUriPtr &)
IMPORT_C MVPbkContactOperationBase * MatchPhoneNumberL (const TDesC &, TInt , MVPbkContactFindObserver &)
IMPORT_C CVPbkContactManager * NewL (const CVPbkContactStoreUriArray &, RFs *)
IMPORT_C CVPbkContactManager * NewL ( TSecurityInfo , const CVPbkContactStoreUriArray &, RFs *)
IMPORT_C MVPbkContactOperationBase * RetrieveContactL (const MVPbkContactLink &, MVPbkSingleContactOperationObserver &)
Private Member Functions
CVPbkContactManager ( TSecurityInfo , RFs *)
void ConstructL (const CVPbkContactStoreUriArray &)
MVPbkContactViewBase * CreateCompositeViewLC ( MVPbkContactViewObserver &, const CVPbkContactViewDefinition &, const MVPbkFieldTypeList &)
MVPbkContactViewBase * CreateOptimizedCompositeViewLC ( MVPbkContactViewObserver &, const CVPbkContactViewDefinition &, const MVPbkFieldTypeList &)
MVPbkContactStore * FindStore (const TVPbkContactStoreUriPtr &)
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 Attributes
MVPbkContactAttributeManager * iAttributeManager
CVPbkContactStoreDomainList * iContactStoreDomains
MVPbkFieldTypeList * iFieldTypes
RFs iFs
RFs iOwnFs
TSecurityInfo iSecurityInfo
CContactStoreLoader * iStoreLoader

Constructor & Destructor Documentation

CVPbkContactManager(TSecurityInfo, RFs *)

CVPbkContactManager ( TSecurityInfo aSecurityInfo,
RFs * aFs
) [private, inline]

Parameters

TSecurityInfo aSecurityInfo
RFs * aFs

~CVPbkContactManager()

~CVPbkContactManager ( )

Destructor.

Member Functions Documentation

CommitContactsL(const TArray< MVPbkStoreContact * > &, MVPbkBatchOperationObserver &)

IMPORT_C MVPbkContactOperationBase * CommitContactsL ( const TArray < MVPbkStoreContact * > & aContacts,
MVPbkBatchOperationObserver & aObserver
)

Commits all contacts in aContacts asynchronously.

MVPbkStoreContact::CommitL

Parameters

const TArray < MVPbkStoreContact * > & aContacts Contacts to commit.
MVPbkBatchOperationObserver & aObserver Operation observer.

CompressStoresL(MVPbkBatchOperationObserver &)

IMPORT_C MVPbkContactOperationBase * CompressStoresL ( MVPbkBatchOperationObserver & aObserver )

Compresses all stores asynchronously. NOTE: Not all stores are able to implement compression to their repositories.

Parameters

MVPbkBatchOperationObserver & aObserver Operation observer.

ConstructL(const CVPbkContactStoreUriArray &)

void ConstructL ( const CVPbkContactStoreUriArray & aURIList ) [private, inline]

Parameters

const CVPbkContactStoreUriArray & aURIList

ContactAttributeManagerL()

IMPORT_C MVPbkContactAttributeManager & ContactAttributeManagerL ( )

Attribute manager is used for handling contact attributes like speed dialing or defaults.

ContactStoresL()

IMPORT_C MVPbkContactStoreList & ContactStoresL ( )

The contact store list is used to handle a set of stores. After creation of manager the client can use the list to open all stores.

CopyContactsL(const MVPbkContactLinkArray &, MVPbkContactStore *, MVPbkBatchOperationObserver &)

IMPORT_C MVPbkContactOperationBase * CopyContactsL ( const MVPbkContactLinkArray & aContactLinks,
MVPbkContactStore * aTargetStore,
MVPbkBatchOperationObserver & aObserver
)

Copies all contacts in aContactLinks to aTargetStore asynchronously. If aTargetStore is NULL, contacts are copied to the store where they already are, ie. the contacts are duplicated.

Parameters

const MVPbkContactLinkArray & aContactLinks Array of contact links to duplicate.
MVPbkContactStore * aTargetStore Target store to copy contacts to. If NULL this behaves like duplicate.
MVPbkBatchOperationObserver & aObserver Observer for the copying process.

CreateCompositeViewLC(MVPbkContactViewObserver &, const CVPbkContactViewDefinition &, const MVPbkFieldTypeList &)

MVPbkContactViewBase * CreateCompositeViewLC ( MVPbkContactViewObserver & aObserver,
const CVPbkContactViewDefinition & aViewDefinition,
const MVPbkFieldTypeList & aSortOrder
) const [private]

Parameters

MVPbkContactViewObserver & aObserver
const CVPbkContactViewDefinition & aViewDefinition
const MVPbkFieldTypeList & aSortOrder

CreateContactViewLC(MVPbkContactViewObserver &, const CVPbkContactViewDefinition &, const MVPbkFieldTypeList &)

IMPORT_C MVPbkContactViewBase * CreateContactViewLC ( MVPbkContactViewObserver & aObserver,
const CVPbkContactViewDefinition & aViewDefinition,
const MVPbkFieldTypeList & aSortOrder
) const

Creates a new contact view specified by the view definition. The view can not be used before it has notified the observer that it is ready.

CVPbkSortOrder

Parameters

MVPbkContactViewObserver & aObserver the observer for view events.
const CVPbkContactViewDefinition & aViewDefinition Definition of the view to create
const MVPbkFieldTypeList & aSortOrder a list of field types that defines fields that are used in sorting. View contacts have these fields. However, the store can have restrictions for types that can be used in the sort order. The sort order has no effect for shared views that have already been created.

CreateLinksLC(const TDesC8 &)

IMPORT_C MVPbkContactLinkArray * CreateLinksLC ( const TDesC8 & aPackedLinks ) const

Creates an array of links corresponding to a packaged link or links. Packed links have been obtained by packing a link or a link array and they can be used for example for IPC but not for saving links. Loads the store plug-ins that are capable of creating the appropriate links.

MVPbkContactLink::PackLC MVPbkContactLinkArray::PackLC

Parameters

const TDesC8 & aPackedLinks packed links

CreateLinksLC(RReadStream &)

IMPORT_C MVPbkContactLinkArray * CreateLinksLC ( RReadStream & aStream ) const

Internalizes a permanent link or links. An externalized link has been created using MVPbkStreamable interface from MVPbkContactLink . Loads the store plug-ins that are capable of creating the appropriate links.

MVPbkContactLink::Streamable

Parameters

RReadStream & aStream a stream that contains a link or links.

CreateOptimizedCompositeViewLC(MVPbkContactViewObserver &, const CVPbkContactViewDefinition &, const MVPbkFieldTypeList &)

MVPbkContactViewBase * CreateOptimizedCompositeViewLC ( MVPbkContactViewObserver & aObserver,
const CVPbkContactViewDefinition & aViewDefinition,
const MVPbkFieldTypeList & aSortOrder
) const [private]

Parameters

MVPbkContactViewObserver & aObserver
const CVPbkContactViewDefinition & aViewDefinition
const MVPbkFieldTypeList & aSortOrder

DeleteContactsL(const MVPbkContactLinkArray &, MVPbkBatchOperationObserver &)

IMPORT_C MVPbkContactOperationBase * DeleteContactsL ( const MVPbkContactLinkArray & aContactLinks,
MVPbkBatchOperationObserver & aObserver
)

Deletes contacts defined in link array asynchronously.

Parameters

const MVPbkContactLinkArray & aContactLinks Contacts to delete
MVPbkBatchOperationObserver & aObserver Operation observer

FieldTypes()

IMPORT_C const MVPbkFieldTypeList & FieldTypes ( ) const

The contact manager owns a master list of field types that clients use. The store implementation then maps their native types to Virtual Phonebook types. Clients don't create field type objects themselves but use always references to types offered by this function.

FindL(const TDesC &, const MVPbkFieldTypeList &, MVPbkContactFindObserver &)

IMPORT_C MVPbkContactOperationBase * FindL ( const TDesC & aSearchString,
const MVPbkFieldTypeList & aFieldTypes,
MVPbkContactFindObserver & aObserver
)

Searches the contact stores for a contact that contains the given string in one of the field defined by given field type list asynchronously. NOTE: In some cases the find matches also other fields than those specified in aFieldTypes. Always loop through the results to check match in the required fields.

Parameters

const TDesC & aSearchString String to search for.
const MVPbkFieldTypeList & aFieldTypes List of field types that the search will include. a field type list: use CVPbkFieldTypeRefsList and append the types that are needed from the master field type list (FieldTypes()) to the reference list. Selection can be done in a dynamic way using CVPbkFieldTypeSelector or static way using resource ids of the field types.
MVPbkContactFindObserver & aObserver Observer for the find process.

FindL(const MDesC16Array &, const MVPbkFieldTypeList &, MVPbkContactFindFromStoresObserver &, const TCallBack &)

IMPORT_C MVPbkContactOperationBase * FindL ( const MDesC16Array & aSearchStrings,
const MVPbkFieldTypeList & aFieldTypes,
MVPbkContactFindFromStoresObserver & aObserver,
const TCallBack & aWordParserCallBack
)

Finds a string containing text that is stored in one or more fields asynchronously. Client can give multiple find words. All the words must match to separated data. E.g. if there are two find words: "Jo" and "Jo" then field data "John Johnson" matches but "John Doe" doesn't if the word parser uses white space as a word separator.

NOTE: The accuracy of the results depends on the implementation of the store to carry out the find operation. The performance can also vary depending on the store.

Parameters

const MDesC16Array & aSearchStrings strings that are compared to field data.
const MVPbkFieldTypeList & aFieldTypes types of the fields that are used. Constructing a fieldtype list: use CVPbkFieldTypeRefsList and append the types that are needed from the master fieldtype list (FieldTypes()) to the reference list. Selection can be done in a dynamic way using CVPbkFieldTypeSelector or static way using resource ids of the fieldtypes.
MVPbkContactFindFromStoresObserver & aObserver an observer for asynchronous operation.
const TCallBack & aWordParserCallBack a client implementation of word parser function that separates the field data into words. Parameter to function is TVPbkWordParserParam.

FindL(const MDesC16Array &, const MVPbkFieldTypeList &, MVPbkContactFindFromStoresObserver &, const TCallBack &, const CDesC16ArrayFlat &)

IMPORT_C MVPbkContactOperationBase * FindL ( const MDesC16Array & aSearchStrings,
const MVPbkFieldTypeList & aFieldTypes,
MVPbkContactFindFromStoresObserver & aObserver,
const TCallBack & aWordParserCallBack,
const CDesC16ArrayFlat & aStoreEntriesArray
)

Finds a string containing text that is stored in one or more fields asynchronously. Client can give multiple find words. All the words must match to separated data. E.g. if there are two find words: "Jo" and "Jo" then field data "John Johnson" matches but "John Doe" doesn't if the word parser uses white space as a word separator.

NOTE: The accuracy of the results depends on the implementation of the store to carry out the find operation. The performance can also vary depending on the store.

Parameters

const MDesC16Array & aSearchStrings strings that are compared to field data.
const MVPbkFieldTypeList & aFieldTypes types of the fields that are used. Constructing a fieldtype list: use CVPbkFieldTypeRefsList and append the types that are needed from the master fieldtype list (FieldTypes()) to the reference list. Selection can be done in a dynamic way using CVPbkFieldTypeSelector or static way using resource ids of the fieldtypes.
MVPbkContactFindFromStoresObserver & aObserver an observer for asynchronous operation.
const TCallBack & aWordParserCallBack a client implementation of word parser function that separates the field data into words. Parameter to function is TVPbkWordParserParam.
const CDesC16ArrayFlat & aStoreEntriesArray an array that lists the store entries

FindStore(const TVPbkContactStoreUriPtr &)

MVPbkContactStore * FindStore ( const TVPbkContactStoreUriPtr & aURI ) const [private]

Parameters

const TVPbkContactStoreUriPtr & aURI

FsSession()

IMPORT_C RFs & FsSession ( )

Returns the file server session of the contact manager.

LoadContactStoreL(const TVPbkContactStoreUriPtr &)

IMPORT_C void LoadContactStoreL ( const TVPbkContactStoreUriPtr & aURI )

Loads a store plug-in for given URI and adds aURI to the list of stores handled by this manager. If there is no store plug-in for the aURI then nothing changes.

Parameters

const TVPbkContactStoreUriPtr & aURI the store URI to be loaded.

MatchPhoneNumberL(const TDesC &, TInt, MVPbkContactFindObserver &)

IMPORT_C MVPbkContactOperationBase * MatchPhoneNumberL ( const TDesC & aPhoneNumber,
TInt aMaxMatchDigits,
MVPbkContactFindObserver & aObserver
)

Searches the contact stores for a phone number using defined amount of digits from the end of the number asynchronously. The store implementations determine, which field types are included in the search.

Parameters

const TDesC & aPhoneNumber Phone number to search for.
TInt aMaxMatchDigits Maximum number of digits to match from the end of the number.
MVPbkContactFindObserver & aObserver Observer for the find process.

NewL(const CVPbkContactStoreUriArray &, RFs *)

IMPORT_C CVPbkContactManager * NewL ( const CVPbkContactStoreUriArray & aURIList,
RFs * aFs = NULL
) [static]

Creates a contact manager instance and loads the plug-ins that can handle the stores corresponding to the aURIList.

Parameters

const CVPbkContactStoreUriArray & aURIList Universal Resource Identifier list of the stores to be loaded initially.
RFs * aFs = NULL File system handle. NULL opens a new connection.

NewL(TSecurityInfo, const CVPbkContactStoreUriArray &, RFs *)

IMPORT_C CVPbkContactManager * NewL ( TSecurityInfo aSecurityInfo,
const CVPbkContactStoreUriArray & aURIList,
RFs * aFs = NULL
) [static]

Creates a contact manager instance and loads the plug-ins that can handle the stores corresponding to the aURIList.

Parameters

TSecurityInfo aSecurityInfo Security info from caller to be passed for stores. Stores can check security info and deside if client can use service.
const CVPbkContactStoreUriArray & aURIList Universal Resource Identifier list of the stores to be loaded initially.
RFs * aFs = NULL File system handle. NULL opens a new connection.

RetrieveContactL(const MVPbkContactLink &, MVPbkSingleContactOperationObserver &)

IMPORT_C MVPbkContactOperationBase * RetrieveContactL ( const MVPbkContactLink & aLink,
MVPbkSingleContactOperationObserver & aObserver
) const

Retrieves asynchronously a contact that is individualized by a contact link. Delete the operation for canceling.

Parameters

const MVPbkContactLink & aLink a link to the contact
MVPbkSingleContactOperationObserver & aObserver operation observer

Member Data Documentation

MVPbkContactAttributeManager * iAttributeManager

MVPbkContactAttributeManager * iAttributeManager [private]

CVPbkContactStoreDomainList * iContactStoreDomains

CVPbkContactStoreDomainList * iContactStoreDomains [private]

MVPbkFieldTypeList * iFieldTypes

MVPbkFieldTypeList * iFieldTypes [private]

RFs iFs

RFs iFs [private]

RFs iOwnFs

RFs iOwnFs [private]

TSecurityInfo iSecurityInfo

TSecurityInfo iSecurityInfo [private]

CContactStoreLoader * iStoreLoader

CContactStoreLoader * iStoreLoader [private]