CVPbkContactViewDefinition Class Reference

class CVPbkContactViewDefinition : public CBase

A contact view definition.

This class is needed when a client needs to create a contact view. A client can define a structure of VPBK_CONTACT_VIEW from VPbkContactView.rh and use this class to read the definition or construct an empty definition and then set the information to it.

A view definition enables complex view structures. A client can e.g. create a composite view that contains subviews from multiple contact stores. However, it's up to client to understand that there are certain limits for the structure. E.g. a contact view is a leaf view and can not have subviews. Another important thing to keep in mind is that complex view structures consumes more RAM that can be a problem if there are thousands of contacts in the view.

VPBK_CONTACT_VIEW in VPbkContactView.rh CVPbkContactManager::CreateContactViewLC VPbkEng.lib

Inherits from

  • CVPbkContactViewDefinition
Public Member Functions
~CVPbkContactViewDefinition()
IMPORT_C voidAddSubViewL(CVPbkContactViewDefinition *)
IMPORT_C MVPbkContactSelector *ContactSelector()
IMPORT_C CVPbkFieldTypeSelector *FieldTypeFilter()
IMPORT_C TBoolFlagIsOn(TVPbkContactViewFlag)
IMPORT_C TIntId()
IMPORT_C const TDesC &Name()
IMPORT_C CVPbkContactViewDefinition *NewL(TResourceReader &)
IMPORT_C CVPbkContactViewDefinition *NewL()
IMPORT_C CVPbkContactViewDefinition *NewL(const CVPbkContactViewDefinition &)
IMPORT_C CVPbkContactViewDefinition *NewLC(TResourceReader &)
IMPORT_C CVPbkContactViewDefinition *NewLC()
IMPORT_C CVPbkContactViewDefinition *NewLC(const CVPbkContactViewDefinition &)
IMPORT_C voidSetContactSelector(MVPbkContactSelector *)
IMPORT_C voidSetFieldTypeFilterL(CVPbkFieldTypeSelector *)
IMPORT_C voidSetFlag(TVPbkContactViewFlag, TBool)
IMPORT_C voidSetId(TInt)
IMPORT_C voidSetNameL(const TDesC &)
IMPORT_C voidSetSharing(TVPbkContactViewSharing)
IMPORT_C voidSetSortPolicy(TVPbkContactViewSortPolicy)
IMPORT_C voidSetType(TVPbkContactViewType)
IMPORT_C voidSetUriL(const TDesC &)
IMPORT_C TVPbkContactViewSharingSharing()
IMPORT_C TVPbkContactViewSortPolicySortPolicy()
IMPORT_C const CVPbkContactViewDefinition &SubViewAt(TInt)
IMPORT_C CVPbkContactViewDefinition &SubViewAt(TInt)
IMPORT_C TIntSubViewCount()
IMPORT_C TVPbkContactViewTypeType()
IMPORT_C const TDesC &Uri()
Private Member Functions
CVPbkContactViewDefinition()
voidConstructFromResourceL(TResourceReader &)
voidConstructL()
voidConstructL(const CVPbkContactViewDefinition &)
voidInitializeSharing()
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
MVPbkContactSelector *iContactSelector
CVPbkFieldTypeSelector *iFilter
TUint32 iFlags
TInt iId
HBufC *iName
TVPbkContactViewSharing iSharing
TVPbkContactViewSortPolicy iSortPolicy
RPointerArray< CVPbkContactViewDefinition >iSubViews
TVPbkContactViewType iType
HBufC *iUri

Constructor & Destructor Documentation

CVPbkContactViewDefinition()

CVPbkContactViewDefinition()[private]

~CVPbkContactViewDefinition()

~CVPbkContactViewDefinition()

Destructor.

Member Functions Documentation

AddSubViewL(CVPbkContactViewDefinition *)

IMPORT_C voidAddSubViewL(CVPbkContactViewDefinition *aSubView)

Adds new view as a subview. This object takes ownership of the subview. If this function leaves ownership is not taken.

Parameters

CVPbkContactViewDefinition * aSubViewThe new subview to add.

ConstructFromResourceL(TResourceReader &)

voidConstructFromResourceL(TResourceReader &aReader)[private]

Parameters

TResourceReader & aReader

ConstructL()

voidConstructL()[private]

ConstructL(const CVPbkContactViewDefinition &)

voidConstructL(const CVPbkContactViewDefinition &aViewDef)[private]

Parameters

const CVPbkContactViewDefinition & aViewDef

ContactSelector()

IMPORT_C MVPbkContactSelector *ContactSelector()const

Gives either the contact selector or NULL. Ownership is not transferred.

FieldTypeFilter()

IMPORT_C CVPbkFieldTypeSelector *FieldTypeFilter()const

Returns the field type selector used to filter the view or NULL.

The view contains only contacts having the fields defined by the field type filter.

FlagIsOn(TVPbkContactViewFlag)

IMPORT_C TBoolFlagIsOn(TVPbkContactViewFlagaFlag)const

Returns ETrue if aFlag is on, otherwise EFalse.

Parameters

TVPbkContactViewFlag aFlagThe flag to check.

Id()

IMPORT_C TIntId()const

Returns the id of this view.

InitializeSharing()

voidInitializeSharing()[private]

Name()

IMPORT_C const TDesC &Name()const

Returns the name of the view. Default is KNullDesC.

In view types EVPbkContactsView and EVPbkGroupsView the name can be used as a shared view identifier by the store. Shared view creation is indicated by TVPbkContactViewSharing. If the name is empty for shared view then store implementation uses its default name. This is a preferred way to use shared views in the platform.

In view type EVPbkFoldingView the name is the label of the only contact in the view.

In view type EVPbkCompositeView the name has no meaning.

NewL(TResourceReader &)

IMPORT_C CVPbkContactViewDefinition *NewL(TResourceReader &aReader)[static]

Creates a new contact view definition and initializes it from resource. Takes a VPBK_CONTACT_VIEW resource structure as a parameter.

Parameters

TResourceReader & aReaderA resource reader to a VPBK_CONTACT_VIEW structure.

NewL()

IMPORT_C CVPbkContactViewDefinition *NewL()[static]

Creates a new empty contact view definition. Client must then set the needed information.

NewL(const CVPbkContactViewDefinition &)

IMPORT_C CVPbkContactViewDefinition *NewL(const CVPbkContactViewDefinition &aViewDef)[static]

Constructs a new contact view definition from an existing one by copying the data.

Parameters

const CVPbkContactViewDefinition & aViewDefA view definition to copy.

NewLC(TResourceReader &)

IMPORT_C CVPbkContactViewDefinition *NewLC(TResourceReader &aReader)[static]

Creates a new contact view definition and initializes it from resource. Takes a VPBK_CONTACT_VIEW resource structure as a parameter.

Parameters

TResourceReader & aReaderA resource reader to a VPBK_CONTACT_VIEW structure.

NewLC()

IMPORT_C CVPbkContactViewDefinition *NewLC()[static]

Creates a new empty contact view definition. Client must then set the needed information.

NewLC(const CVPbkContactViewDefinition &)

IMPORT_C CVPbkContactViewDefinition *NewLC(const CVPbkContactViewDefinition &aViewDef)[static]

Constructs a new contact view definition from an existing one by copying the data.

Parameters

const CVPbkContactViewDefinition & aViewDefA view definition to copy.

SetContactSelector(MVPbkContactSelector *)

IMPORT_C voidSetContactSelector(MVPbkContactSelector *aContactSelector)

Sets the contact selector used to filter the view.

The view contains only contacts accepted by the selector.

Parameters

MVPbkContactSelector * aContactSelectorThe contact selector. Use NULL to filter nothing. Ownership not transferred.

SetFieldTypeFilterL(CVPbkFieldTypeSelector *)

IMPORT_C voidSetFieldTypeFilterL(CVPbkFieldTypeSelector *aFilter)

Sets the field type selector used to filter the view.

The view contains only contacts having the fields defined by the field type filter.

Parameters

CVPbkFieldTypeSelector * aFilterThe field type filter. Use NULL to filter nothing.

SetFlag(TVPbkContactViewFlag, TBool)

IMPORT_C voidSetFlag(TVPbkContactViewFlagaFlag,
TBoolaState
)

Sets the saFlag's state as aState.

Parameters

TVPbkContactViewFlag aFlagThe flag to modify.
TBool aStateThe state to set.

SetId(TInt)

IMPORT_C voidSetId(TIntaId)

Sets aId as this views id.

Parameters

TInt aIdthe id to set.

SetNameL(const TDesC &)

IMPORT_C voidSetNameL(const TDesC &aName)

Sets aName as this views Name. This function takes a copy of aName.

Parameters

const TDesC & aNameThe name to set.

SetSharing(TVPbkContactViewSharing)

IMPORT_C voidSetSharing(TVPbkContactViewSharingaViewSharing)

Sets the view sharing type.

Parameters

TVPbkContactViewSharing aViewSharingOne of the values defined in VPbkContactView.hrh.

SetSortPolicy(TVPbkContactViewSortPolicy)

IMPORT_C voidSetSortPolicy(TVPbkContactViewSortPolicyaSortPolicy)

Sets aSortPolicy as this views sorting policy.

Parameters

TVPbkContactViewSortPolicy aSortPolicyThe sort policy to set.

SetType(TVPbkContactViewType)

IMPORT_C voidSetType(TVPbkContactViewTypeaType)

Sets aType as this views type.

Parameters

TVPbkContactViewType aTypeThe type to set.

SetUriL(const TDesC &)

IMPORT_C voidSetUriL(const TDesC &aUri)

Sets aUri as this views URI. This function takes a copy of aUri.

Parameters

const TDesC & aUriThe URI to set.

Sharing()

IMPORT_C TVPbkContactViewSharingSharing()const

Returns the view sharing type. The store can support a shared view creation for saving RAM.

Default value for types EVPbkContactsView and EVPbkGroupsView is EVPbkSharedView. Store implementation creates then a shared view if it's possible for the store. Prefer using the default values for saving resources.

For view types EVPbkFoldingView and EVPbkCompositeView the sharing has no effect.

See also the documentation of Name()

SortPolicy()

IMPORT_C TVPbkContactViewSortPolicySortPolicy()const

Returns the sorting policy of this view.

SubViewAt(TInt)

IMPORT_C const CVPbkContactViewDefinition &SubViewAt(TIntaIndex)const

Returns the sub view definition at aIndex.

Parameters

TInt aIndexThe index of the sub view definition.

SubViewAt(TInt)

IMPORT_C CVPbkContactViewDefinition &SubViewAt(TIntaIndex)

Returns the sub view definition at aIndex.

Parameters

TInt aIndexThe index to query.

SubViewCount()

IMPORT_C TIntSubViewCount()const

Returns the number of sub views owned by this view.

Type()

IMPORT_C TVPbkContactViewTypeType()const

Returns the type of this view.

Uri()

IMPORT_C const TDesC &Uri()const

Returns the URI of this view. KNullDesC if this is not a leaf node.

Member Data Documentation

MVPbkContactSelector * iContactSelector

MVPbkContactSelector *iContactSelector[private]

CVPbkFieldTypeSelector * iFilter

CVPbkFieldTypeSelector *iFilter[private]

TUint32 iFlags

TUint32 iFlags[private]

TInt iId

TInt iId[private]

HBufC * iName

HBufC *iName[private]

TVPbkContactViewSharing iSharing

TVPbkContactViewSharing iSharing[private]

TVPbkContactViewSortPolicy iSortPolicy

TVPbkContactViewSortPolicy iSortPolicy[private]

RPointerArray< CVPbkContactViewDefinition > iSubViews

RPointerArray< CVPbkContactViewDefinition >iSubViews[private]

TVPbkContactViewType iType

TVPbkContactViewType iType[private]

HBufC * iUri

HBufC *iUri[private]