MVPbkContactViewBase Class Reference

#include <app/MVPbkContactViewBase.h>

Link against: VPbkEng.lib

class MVPbkContactViewBase
Public Member Functions
virtual ~MVPbkContactViewBase()
pure virtual voidAddObserverL(MVPbkContactViewObserver &)
pure virtual voidChangeSortOrderL(const MVPbkFieldTypeList &)
pure virtual const MVPbkViewContact &ContactAtL(TInt)
pure virtual TInt ContactCountL()
virtual TAny *ContactViewBaseExtension(TUid)
pure virtual MVPbkContactBookmark *CreateBookmarkLC(TInt)
pure virtual MVPbkContactLink *CreateLinkLC(TInt)
pure virtual TInt IndexOfBookmarkL(const MVPbkContactBookmark &)
pure virtual TInt IndexOfLinkL(const MVPbkContactLink &)
pure virtual TBool MatchContactStore(const TDesC &)
pure virtual TBool MatchContactStoreDomain(const TDesC &)
pure virtual voidRefreshL()
pure virtual voidRemoveObserver(MVPbkContactViewObserver &)
pure virtual const MVPbkFieldTypeList &SortOrder()
pure virtual TVPbkContactViewType Type()
pure virtual MVPbkContactViewFiltering *ViewFiltering()

Detailed Description

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.

See also: CVPbkContactManager::CreateContactViewLC

Constructor & Destructor Documentation

~MVPbkContactViewBase ( )

~MVPbkContactViewBase()[inline, virtual]

Destructor.

Member Function 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.

ParameterDescription
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.

See also: CVPbkSortOrder

ParameterDescription
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()

ParameterDescription
aIndexAn index of the contact in this view.

Returns: A reference to a contact in this view at aIndex. aIndex >= 0 VPbkError::Panic(VPbkError::EInvalidContactIndex) is raised if the precondition does not hold.

ContactCountL ( )

TInt ContactCountL()const [pure virtual]

Returns the number of contacts in this view.

Returns: The number of contacts.

ContactViewBaseExtension ( TUid )

TAny *ContactViewBaseExtension(TUid)[inline, virtual]

Returns an extension point for this interface or NULL.

Returns: an extension point for this interface or NULL.

CreateBookmarkLC ( TInt )

MVPbkContactBookmark *CreateBookmarkLC(TIntaIndex)const [pure virtual]

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

ParameterDescription
aIndexAn index of the contact in the view.

Returns: A new bookmark to the view item. aIndex >= 0 VPbkError::Panic(VPbkError::EInvalidContactIndex) is raised if the precondition does not hold.

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

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

Returns: A new link object pointing to contact at aIndex or NULL if the link can't be created (e.g. a folder). aIndex >= 0 VPbkError::Panic(VPbkError::EInvalidContactIndex) is raised if the precondition does not hold.

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.

ParameterDescription
aContactBookmarkA bookmark that identifies a contact in the view.

Returns: An index of the contact in the view or KErrNotFound.

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.

ParameterDescription
aContactLinkA link whose index is searched for.

Returns: The index of the link or KErrNotFound.

MatchContactStore ( const TDesC & )

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

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

See also: TVPbkContactStoreUriPtr::UriDes

ParameterDescription
aContactStoreUriThe whole URI of the contact store.

Returns: ETrue if the view was from the given 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.

See also: TVPbkContactStoreUriPtr

ParameterDescription
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.

Returns: ETrue if the view was from the same store domain.

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.

ParameterDescription
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.

Returns: The sort order of the view.

Type ( )

TVPbkContactViewType Type()const [pure virtual]

Returns type of this contact view.

Returns: A contact view type.

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.

Returns: A filtering interface or NULL