MVPbkStoreContact Class Reference

class MVPbkStoreContact : public MVPbkBaseContact

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.

MVPbkContactStore MVPbkViewContact

Inherits from

Constructor & Destructor Documentation

~MVPbkStoreContact()

~MVPbkStoreContact ( ) [inline, virtual]

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

Parameters

MVPbkStoreContactField * aField A 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

CommitL(MVPbkContactObserver &)

void CommitL ( 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.

Parameters

MVPbkContactObserver & aObserver The 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.

Parameters

const MVPbkFieldType & aFieldType A type of the field to create. Must be found in ParentStore().SupportedFieldTypes().

Fields()

const MVPbkStoreContactFieldCollection & Fields ( ) const [pure virtual]

Returns this contact's fields (read only).

Fields()

MVPbkStoreContactFieldCollection & Fields ( ) [pure virtual]

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

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.

GroupsJoinedLC()

MVPbkContactLinkArray * GroupsJoinedLC ( ) const [pure virtual]

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

IsSame(const MVPbkBaseContact &)

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

Parameters

const MVPbkBaseContact & aOtherContact

IsSame(const MVPbkViewContact &)

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

Returns true if this a representation of the same contact.

Parameters

const MVPbkViewContact & aOtherContact a contact this contact is compared against.

LockL(MVPbkContactObserver &)

void LockL ( 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.

Parameters

MVPbkContactObserver & aObserver The 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.

Parameters

const MVPbkFieldType & aType The field type of the field

ParentStore()

MVPbkContactStore & ParentStore ( ) const [pure virtual]

Returns this contact's parent store.

PushL()

void PushL ( ) [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()

void RemoveAllFields ( ) [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)

void RemoveField ( TInt aIndex ) [pure virtual]

Removes a field from the contact.

Parameters

TInt aIndex A 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.

Parameters

TUid