MVPbkStoreContact Class Reference

#include <app/MVPbkStoreContact.h>

Link against: VPbkVCardEng.lib

class MVPbkStoreContact : public MVPbkBaseContact

Inherits from

Detailed Description

An interface for store contacts.

A store contact is a contact that includes all the fields of the contact. For this reason it usually contains more data compared to the corresponding view contact. It can contain all types of fields that are supported by the its parent store.

The store contact can be edited if it's not read-only. The client must first lock the existing contact then edit it and finally commit the changes.

See also: MVPbkContactStore MVPbkViewContact

Constructor & Destructor Documentation

~MVPbkStoreContact ( )

~MVPbkStoreContact()[inline, virtual]

Member Function Documentation

AddFieldL ( MVPbkStoreContactField * )

TInt AddFieldL(MVPbkStoreContactField *aField)[pure virtual]

Adds a new field to the contact.

The field must be previously created with CreateFieldLC and it must NOT be used after adding.

If the client needs the field after adding it must be retrieved using Fields().

Exceptions
KErrAccessDenied

if the contact can not be modified.

ParameterDescription
aFieldA new field that was created using CreateFieldLC. This object takes ownership of the field. aField must not be NULL or VPbkError::Panic(VPbkError::ENullContactField) is raised. aField must be returned from this->CreateFieldLC or VPbkError::Panic(VPbkError::EInvalidContactField) panic is raised. this->Fields().FieldCount() == old(this->Fields().FieldCount()) + 1

Returns: The index of the new field in the field collection.

CommitL ( MVPbkContactObserver & )

voidCommitL(MVPbkContactObserver &aObserver)const [pure virtual]

Saves the contact to its associated store asynchronously.

LockL must have been called before commit if this is an existing contact. Otherwise ContactOperationFailed is called with KErrAccessDenied.

Exceptions
KErrInUse

If another asynchronous operation is already in progress.

KErrAccessDenied

if the contact can not be modified.

ParameterDescription
aObserverThe observer to call back when this operation completes. The observer will not be called if this function leaves.

CreateFieldLC ( const MVPbkFieldType & )

MVPbkStoreContactField *CreateFieldLC(const MVPbkFieldType &aFieldType)const [pure virtual]

Creates a new field for this contact.

The new field must be added to the contact using AddFieldL.

Exceptions
KErrNotSupported

if the field type is not supported.

KErrAccessDenied

if the contact can not be modified.

ParameterDescription
aFieldTypeA type of the field to create. Must be found in ParentStore().SupportedFieldTypes().

Returns: A new field object. The returned object is left on the cleanup stack.

Fields ( )

const MVPbkStoreContactFieldCollection &Fields()const [pure virtual]

Returns this contact's fields (read only).

Returns: This contact's fields in read only mode.

Fields ( )

MVPbkStoreContactFieldCollection &Fields()[pure virtual]

Returns this contact's fields (read-write).

Returns: A collection of contact fields.

Group ( )

MVPbkContactGroup *Group()[pure virtual]

Returns the group interface of the store contact if this contact is a group. If this contact is not a group, NULL is returned.

Returns: The group interface or NULL.

GroupsJoinedLC ( )

MVPbkContactLinkArray *GroupsJoinedLC()const [pure virtual]

Returns the identifiers of the groups that the contact belongs to.

Returns: The groups that this contact belongs to.

IsSame ( const MVPbkBaseContact & )

TBool IsSame(const MVPbkBaseContact &aOtherContact)const [inline, virtual]

Do not override.

IsSame ( const MVPbkViewContact & )

TBool IsSame(const MVPbkViewContact &aOtherContact)const [inline, virtual]

Returns true if this a representation of the same contact.

ParameterDescription
aOtherContacta contact this contact is compared against.

Returns: ETrue if this and aOtherContact represent the same contact.

LockL ( MVPbkContactObserver & )

voidLockL(MVPbkContactObserver &aObserver)const [pure virtual]

Locks this contact for modification asynchronously.

Once the observer is notified this contact is locked and cab be modified.

Exceptions
KErrInUse

If another asynchronous operation is already in progress.

KErrAccessDenied

if the contact can not be modified.

ParameterDescription
aObserverThe observer to call back when the operation completes. The observer will not be called if this function leaves.

MaxNumberOfFieldL ( const MVPbkFieldType & )

TInt MaxNumberOfFieldL(const MVPbkFieldType &aType)const [pure virtual]

Returns the maximum amount of fields of given type that can be inserted to the contact.

E.g. A USIM ADN contact can have 1 or more phone numbers but there is a limit that the store in USIM defines. On the other hand the contact in the Contacts Model data base doesn't have limits.

ParameterDescription
aTypeThe field type of the field

Returns: The maximum amount fields of given type in the contact or KVPbkStoreContactUnlimitedNumber it there is no limit set by the store contact

ParentStore ( )

MVPbkContactStore &ParentStore()const [pure virtual]

Returns this contact's parent store.

Returns: The parent store of the contact.

PushL ( )

voidPushL()[inline]

Pushes an item on the cleanup stack.

Clients must use either this function or CleanupDeletePushL from e32base.h.

CleanupStack::PushL(TAny*) must not be used because the virtual destructor of M-class won't be called. This function should be used to make sure that the virtual destructor of this object is called when popped and destroyed from the cleanup stack.

RemoveAllFields ( )

voidRemoveAllFields()[pure virtual]

Removes all the fields from the contact.

The contact is not read-only otherwise panics with VPbkError::EInvalidAccessToReadOnlyContact. this->Fields().FieldCount() == 0

RemoveField ( TInt )

voidRemoveField(TIntaIndex)[pure virtual]

Removes a field from the contact.

ParameterDescription
aIndexA zero-based index of the field to remove. aIndex >= 0 && aIndex < FieldCount(). Panics with VPbkError::EInvalidFieldIndex. The contact is not read-only otherwise panics with VPbkError::EInvalidAccessToReadOnlyContact. this->Fields().FieldCount() == old(this->Fields().FieldCount()) - 1

StoreContactExtension ( TUid )

TAny *StoreContactExtension(TUid)[inline, virtual]

Returns an extension point for this interface or NULL.

Returns: An extension point for this interface or NULL.