MVPbkContactViewBase Class Reference

class MVPbkContactViewBase

An common interface for different contact views.

The contact view interface has many implementations. It can be a view from a single contact store or it can be a composite of contact/group views from different stores. It's also possible that it contains folding items that are not from any store. The client defines the view structure.

The most common usage is that client uses CVPbkContactManager for creating a contact view and defines the structure of the view. CVPbkContactManager::CreateContactViewLC

Constructor & Destructor Documentation

~MVPbkContactViewBase()

~MVPbkContactViewBase()[inline, virtual]

Destructor.

Member Functions Documentation

AddObserverL(MVPbkContactViewObserver &)

voidAddObserverL(MVPbkContactViewObserver &aObserver)[pure virtual]

Adds an observer to this contact view asynchronously.

The observer will be notified after it has been added to the view.

Parameters

MVPbkContactViewObserver & aObserverA new observer for the view.

ChangeSortOrderL(const MVPbkFieldTypeList &)

voidChangeSortOrderL(const MVPbkFieldTypeList &aSortOrder)[pure virtual]

Changes sort order of the view asynchronously.

Clients of this view will get an event via MVPbkContactViewObserver interface when the order has been updated. The leaf view sends a pair of events. First it sends ContactViewUnavailable and then after the order has been changed ContactViewReady. However if the view is of type EVPbkCompositeView the client doesn't necessary receive ContactViewUnavailable at all because it might be that there is always some subview ready in the composite.

Exceptions
KErrArgument

Possible reasons: a client tries to change a sort order of platform defined shared view against the platform setting.

CVPbkSortOrder

Parameters

const MVPbkFieldTypeList & aSortOrderA new sort order for this view.

ContactAtL(TInt)

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

Returns a contact in this view.

The returned reference may be invalidated when this function is called again. For that reason clients should prefer not to save references to the contacts retrieved from this function.

Exceptions
KErrArgument

if aIndex >= ContactCountL()

Parameters

TInt aIndexAn index of the contact in this view.

ContactCountL()

TInt ContactCountL()const [pure virtual]

Returns the number of contacts in this view.

ContactViewBaseExtension(TUid)

TAny *ContactViewBaseExtension(TUid)[inline, virtual]

Returns an extension point for this interface or NULL.

Parameters

TUid

CreateBookmarkLC(TInt)

MVPbkContactBookmark *CreateBookmarkLC(TIntaIndex)const [pure virtual]

Creates and returns a bookmark that points to the view contact at aIndex.

Parameters

TInt aIndexAn index of the contact in the view.

CreateLinkLC(TInt)

MVPbkContactLink *CreateLinkLC(TIntaIndex)const [pure virtual]

Creates and returns a link that points to contact at aIndex.

NOTE: If the view contact is not from any store it can return also NULL. E.g. if the view contact is a folding contact view that it's not saved to any store. The NULL is not pushed onto the cleanup stack.

Exceptions
KErrArgument

if aIndex >= ContactCountL()

Parameters

TInt aIndexAn index of the contact for which the link is created.

IndexOfBookmarkL(const MVPbkContactBookmark &)

TInt IndexOfBookmarkL(const MVPbkContactBookmark &aContactBookmark)const [pure virtual]

Returns an index of the contact in the view.

If the identifier is not found from the view then KErrNotFound is returned.

NOTE: the implementation of this function probably must loop the view which means that calling this function frequently or in a loop can be slow when there are lots of contacts.

Parameters

const MVPbkContactBookmark & aContactBookmarkA bookmark that identifies a contact in the view.

IndexOfLinkL(const MVPbkContactLink &)

TInt IndexOfLinkL(const MVPbkContactLink &aContactLink)const [pure virtual]

Returns The index of the aContactLink in this view.

If the identifier is not found from the view then KErrNotFound is returned. If the view is not from any store (e.g. a folding view) then it will also return KErrNotFound.

NOTE: the implementation of this function probably must loop the view which means that calling this function frequently or in a loop can be slow when there are lots of contacts.

Parameters

const MVPbkContactLink & aContactLinkA link whose index is searched for.

MatchContactStore(const TDesC &)

TBool MatchContactStore(const TDesC &aContactStoreUri)const [pure virtual]

Returns ETrue if this view is from a store identified by aContactStoreUri.

TVPbkContactStoreUriPtr::UriDes

Parameters

const TDesC & aContactStoreUriThe whole URI of the contact store.

MatchContactStoreDomain(const TDesC &)

TBool MatchContactStoreDomain(const TDesC &aContactStoreDomain)const [pure virtual]

Returns ETrue if this view is from a store domain identified by aContactStoreDomain.

TVPbkContactStoreUriPtr

Parameters

const TDesC & aContactStoreDomainThe domain part of the contact store URI. The domain can be retrieved from the whole contact store URI using class TVPbkContactStoreUriPtr and EContactStoreUriStoreType. An implementation compares the EContactStoreUriStoreType part of its own URI to aContactStoreDomain.

RefreshL()

voidRefreshL()[pure virtual]

Refreshes the view contents asynchronously.

All handles to this view's contacts are invalidated. Clients of this view will get an event via MVPbkContactViewObserver interface when the view has been refreshed.

RemoveObserver(MVPbkContactViewObserver &)

voidRemoveObserver(MVPbkContactViewObserver &aObserver)[pure virtual]

Removes an observer from this contact view.

This method can be called even if aObserver has not been previously added. In that case, no observers are removed.

Parameters

MVPbkContactViewObserver & aObserverThe observer to be removed.

SortOrder()

const MVPbkFieldTypeList &SortOrder()const [pure virtual]

Returns the current sort order of the view.

The sort order is a sub set of master field types from CVPbkContactManager.

Type()

TVPbkContactViewType Type()const [pure virtual]

Returns type of this contact view.

ViewFiltering()

MVPbkContactViewFiltering *ViewFiltering()[pure virtual]

Returns an interface for text based contact filtering support.

If the view doesn't support filtering then this returns NULL. Filtering must be supported in all views created from a contact store. However, it's possible to implement a view that doesn't need a filtering support and therefore clients must always check the returned pointer.