#include <app/MVPbkStoreContact.h>
class MVPbkStoreContact : public MVPbkBaseContact |
Public Member Functions | |
---|---|
virtual | ~MVPbkStoreContact() |
pure virtual TInt | AddFieldL(MVPbkStoreContactField *) |
pure virtual void | CommitL(MVPbkContactObserver &) |
pure virtual MVPbkStoreContactField * | CreateFieldLC(const MVPbkFieldType &) |
pure virtual const MVPbkStoreContactFieldCollection & | Fields() |
pure virtual MVPbkStoreContactFieldCollection & | Fields() |
pure virtual MVPbkContactGroup * | Group() |
pure virtual MVPbkContactLinkArray * | GroupsJoinedLC() |
virtual TBool | IsSame(const MVPbkBaseContact &) |
virtual TBool | IsSame(const MVPbkViewContact &) |
pure virtual void | LockL(MVPbkContactObserver &) |
pure virtual TInt | MaxNumberOfFieldL(const MVPbkFieldType &) |
pure virtual MVPbkContactStore & | ParentStore() |
void | PushL() |
pure virtual void | RemoveAllFields() |
pure virtual void | RemoveField(TInt) |
virtual TAny * | StoreContactExtension(TUid) |
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
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().
KErrAccessDenied |
if the contact can not be modified. |
Parameter | Description |
---|---|
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 |
Returns: The index of the new field in the field collection.
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.
KErrInUse |
If another asynchronous operation is already in progress. |
KErrAccessDenied |
if the contact can not be modified. |
Parameter | Description |
---|---|
aObserver | The observer to call back when this operation completes. The observer will not be called if this function leaves. |
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.
KErrNotSupported |
if the field type is not supported. |
KErrAccessDenied |
if the contact can not be modified. |
Parameter | Description |
---|---|
aFieldType | A 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.
const MVPbkStoreContactFieldCollection & | Fields | ( | ) | const [pure virtual] |
Reimplemented from MVPbkBaseContact::Fields()const
Returns this contact's fields (read only).
Returns: This contact's fields in read only mode.
MVPbkStoreContactFieldCollection & | Fields | ( | ) | [pure virtual] |
Returns this contact's fields (read-write).
Returns: A collection of contact fields.
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.
MVPbkContactLinkArray * | GroupsJoinedLC | ( | ) | const [pure virtual] |
Returns the identifiers of the groups that the contact belongs to.
Returns: The groups that this contact belongs to.
TBool | IsSame | ( | const MVPbkBaseContact & | aOtherContact | ) | const [inline, virtual] |
Reimplemented from MVPbkBaseContact::IsSame(const MVPbkBaseContact &)const
Do not override.
TBool | IsSame | ( | const MVPbkViewContact & | aOtherContact | ) | const [inline, virtual] |
Reimplemented from MVPbkBaseContact::IsSame(const MVPbkViewContact &)const
Returns true if this a representation of the same contact.
Parameter | Description |
---|---|
aOtherContact | a contact this contact is compared against. |
Returns: ETrue if this and aOtherContact represent the same contact.
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.
KErrInUse |
If another asynchronous operation is already in progress. |
KErrAccessDenied |
if the contact can not be modified. |
Parameter | Description |
---|---|
aObserver | The observer to call back when the operation completes. The observer will not be called if this function leaves. |
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.
Parameter | Description |
---|---|
aType | The 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
MVPbkContactStore & | ParentStore | ( | ) | const [pure virtual] |
Returns this contact's parent store.
Returns: The parent store of the contact.
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.
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
void | RemoveField | ( | TInt | aIndex | ) | [pure virtual] |
Removes a field from the contact.
Parameter | Description |
---|---|
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 |