CPbkContactItem Class Reference

#include <app/CPbkContactItem.h>

class CPbkContactItem : public CBase

Inherits from

  • CPbkContactItem
    Public Member Functions
    ~CPbkContactItem()
    IMPORT_C TPbkContactItemField &AddFieldL(CPbkFieldInfo &)
    IMPORT_C TPbkContactItemField *AddOrReturnUnusedFieldL(CPbkFieldInfo &)
    IMPORT_C TBoolCanAcceptDataOfType(CPbkFieldInfo &)
    IMPORT_C CPbkFieldArray &CardFields()
    IMPORT_C TPbkIconIdContactIconIdL()
    IMPORT_C CContactItem &ContactItem()
    IMPORT_C const CContactItem &ContactItem()
    IMPORT_C TPbkContactItemField *DefaultEmailField()
    IMPORT_C TPbkContactItemField *DefaultEmailOverSmsField()
    IMPORT_C TPbkContactItemField *DefaultMmsField()
    IMPORT_C TPbkContactItemField *DefaultPhoneNumberField()
    IMPORT_C TPbkContactItemField *DefaultPocField()
    IMPORT_C TPbkContactItemField *DefaultSmsField()
    IMPORT_C TPbkContactItemField *DefaultVideoNumberField()
    IMPORT_C TPbkContactItemField *DefaultVoipField()
    IMPORT_C TIntFindContactItemFieldIndex(const CContactItemField &)
    IMPORT_C TPbkContactItemField *FindField(TPbkFieldId)
    IMPORT_C TPbkContactItemField *FindField(TPbkFieldId, TInt &)
    IMPORT_C TPbkContactItemField *FindField(const CPbkFieldInfo &)
    IMPORT_C TPbkContactItemField *FindField(const CPbkFieldInfo &, TInt &)
    IMPORT_C TIntFindFieldIndex(const TPbkContactItemField &)
    IMPORT_C TPbkContactItemField *FindNextFieldWithPhoneNumber(const TDesC &, TInt, TInt &)
    IMPORT_C TPbkContactItemField *FindNextFieldWithText(const TDesC &, TInt &)
    IMPORT_C TPbkContactItemField *FindSameField(const TPbkContactItemField &)
    IMPORT_C HBufC *GetContactTitleL()
    IMPORT_C HBufC *GetContactTitleOrNullL()
    IMPORT_C CContactIdArray *GroupsJoinedLC()
    IMPORT_C TContactItemIdId()
    IMPORT_C CPbkContactItem *NewL(CContactItem *, const CPbkFieldsInfo &, MPbkContactNameFormat &)
    MPbkFieldData &PbkFieldAt(TInt)
    const MPbkFieldData &PbkFieldAt(TInt)
    TInt PbkFieldCount()
    voidPrepareAfterLoadL()
    voidPrepareForSaveL()
    IMPORT_C voidRemoveDefaultEmailField()
    IMPORT_C voidRemoveDefaultEmailOverSmsField()
    IMPORT_C voidRemoveDefaultMmsField()
    IMPORT_C voidRemoveDefaultPhoneNumberField()
    IMPORT_C voidRemoveDefaultPocField()
    IMPORT_C voidRemoveDefaultSmsField()
    IMPORT_C voidRemoveDefaultVideoNumberField()
    IMPORT_C voidRemoveDefaultVoipField()
    IMPORT_C voidRemoveField(TInt)
    IMPORT_C voidRemoveVoiceTagField()
    IMPORT_C voidSetDefaultEmailFieldL(TPbkContactItemField *)
    IMPORT_C voidSetDefaultEmailOverSmsFieldL(TPbkContactItemField *)
    IMPORT_C voidSetDefaultMmsFieldL(TPbkContactItemField *)
    IMPORT_C voidSetDefaultPhoneNumberFieldL(TPbkContactItemField *)
    IMPORT_C voidSetDefaultPocFieldL(TPbkContactItemField *)
    IMPORT_C voidSetDefaultSmsFieldL(TPbkContactItemField *)
    IMPORT_C voidSetDefaultVideoNumberFieldL(TPbkContactItemField *)
    IMPORT_C voidSetDefaultVoipFieldL(TPbkContactItemField *)
    IMPORT_C voidSetVoiceTagFieldL(TPbkContactItemField *)
    IMPORT_C TUidType()
    IMPORT_C voidUpdateFieldSetL(const CPbkFieldsInfo &)
    IMPORT_C TPbkContactItemField *VoiceTagField()
    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()

    Detailed Description

    Phonebook Contact item class. Contact items can be read from the contact database by using the Phonebook engine,

    See also: CPbkContactEngine. This class extends Symbian Contacts model class CContactItem capabilities to better suit Phonebook application's needs.

    Constructor & Destructor Documentation

    ~CPbkContactItem ( )

    ~CPbkContactItem()

    Destructor.

    Member Function Documentation

    AddFieldL ( CPbkFieldInfo & )

    IMPORT_C TPbkContactItemField &AddFieldL(CPbkFieldInfo &aFieldInfo)

    Creates a new field based on aFieldInfo and adds it to this contact.

    ParameterDescription
    aFieldInfoType of field to create.

    Returns: The created field.

    AddOrReturnUnusedFieldL ( CPbkFieldInfo & )

    IMPORT_C TPbkContactItemField *AddOrReturnUnusedFieldL(CPbkFieldInfo &aFieldInfo)

    Finds an unused or creates a new field based on aFieldInfo. An unused field is a field that is in the contact template, but doesnt contain any data, in other words it is empty. So a unused field is preferred ad the next field to add user data before adding a new field to the contact.

    ParameterDescription
    aFieldInfoType of field to search or create.

    Returns: Pointer to the found or created field. NULL only if field exists AND field is nonempty AND aFieldInfo.Multiplicity()==EPbkFieldMultiplicityOne.

    CanAcceptDataOfType ( CPbkFieldInfo & )

    IMPORT_C TBoolCanAcceptDataOfType(CPbkFieldInfo &aFieldInfo)const

    Returns ETrue if data of type aFieldInfo can be added to this contact.

    ParameterDescription
    aFieldInfoThe field type that we are trying to add.

    Returns: ETrue if the contact can accept this type of data, EFalse otherwise.

    CardFields ( )

    IMPORT_C CPbkFieldArray &CardFields()const

    Returns the field set of this contact item.

    Returns: Field array of this contact item.

    ContactIconIdL ( )

    IMPORT_C TPbkIconIdContactIconIdL()const

    Returns an Phonebook icon id for a contact. This icon id is the icon of the field that is set as the default number to call.

    Returns: Icon index for this contact, EPbkNullIconId for no icon.

    ContactItem ( )

    IMPORT_C CContactItem &ContactItem()

    Converts this object to a CContactItem. Use only if this class's API is not enough.

    Returns: The underlying Symbian Contacts model contact item object.

    ContactItem ( )

    IMPORT_C const CContactItem &ContactItem()const

    Converts this object to a const CContactItem. Use only if this class's API is not enough.

    Returns: The underlying Symbian Contacts model contact item object.

    DefaultEmailField ( )

    IMPORT_C TPbkContactItemField *DefaultEmailField()const

    Returns the default email field of this contact.

    Returns: Default email field of this contact, NULL if no default set.

    DefaultEmailOverSmsField ( )

    IMPORT_C TPbkContactItemField *DefaultEmailOverSmsField()const

    Returns the default EmailOverSms field of this contact.

    Returns: Default EmailOverSms field of this contact, NULL if no default set.

    DefaultMmsField ( )

    IMPORT_C TPbkContactItemField *DefaultMmsField()const

    Returns the default Mms field of this contact.

    Returns: Default Mms field of this contact, NULL if no default set.

    DefaultPhoneNumberField ( )

    IMPORT_C TPbkContactItemField *DefaultPhoneNumberField()const

    Returns the default phone number field of this contact.

    Returns: Default phone number field of this contact, NULL if no default set.

    DefaultPocField ( )

    IMPORT_C TPbkContactItemField *DefaultPocField()const

    Returns the default Poc field of this contact.

    Returns: Default Poc field of this contact, NULL if no default set.

    DefaultSmsField ( )

    IMPORT_C TPbkContactItemField *DefaultSmsField()const

    Returns the default SMS field of this contact.

    Returns: Default SMS field of this contact, NULL if no default set.

    DefaultVideoNumberField ( )

    IMPORT_C TPbkContactItemField *DefaultVideoNumberField()const

    Returns the default video number field of this contact.

    Returns: Default video number field of this contact, NULL if no default set.

    DefaultVoipField ( )

    IMPORT_C TPbkContactItemField *DefaultVoipField()const

    Returns the default VOIP field of this contact.

    Returns: Default VOIP field of this contact, NULL if no default set.

    FindContactItemFieldIndex ( const CContactItemField & )

    IMPORT_C TIntFindContactItemFieldIndex(const CContactItemField &aField)const

    Returns aField's index from ContactItem()'s CardFields() or KErrNotFound if not found.

    ParameterDescription
    aFieldThe field which index we are querying.

    Returns: The fields index in this contact item, KErrNotFound is not found.

    FindField ( TPbkFieldId )

    IMPORT_C TPbkContactItemField *FindField(TPbkFieldIdaFieldId)const

    Returns first field matching aFieldId.

    ParameterDescription
    aFieldIdField id to search.

    Returns: First field matching aFieldId, NULL if none found.

    FindField ( TPbkFieldId, TInt & )

    IMPORT_C TPbkContactItemField *FindField(TPbkFieldIdaFieldId,
    TInt &aIndex
    )const

    Returns first field matching aFieldId starting from aIndex.

    ParameterDescription
    aFieldIdField id to search.
    aIndexInput: field index where to start the search from, output: index of the found field or -1 if not found.

    Returns: Field matching aFieldId, NULL if none found.

    FindField ( const CPbkFieldInfo & )

    IMPORT_C TPbkContactItemField *FindField(const CPbkFieldInfo &aFieldInfo)const

    Returns first field matching aFieldInfo.

    ParameterDescription
    aFieldInfoField type to find from the contact.

    Returns: First field matching aFieldInfo, NULL if none found.

    FindField ( const CPbkFieldInfo &, TInt & )

    IMPORT_C TPbkContactItemField *FindField(const CPbkFieldInfo &aFieldInfo,
    TInt &aIndex
    )const

    Returns first field matching aFieldInfo starting from aIndex.

    ParameterDescription
    aFieldInfoField type to find from the contact.
    aIndexInput: field index where to start the search from, output: index of the found field or -1 if not found.

    Returns: Field matching aFieldInfo, NULL if none found.

    FindFieldIndex ( const TPbkContactItemField & )

    IMPORT_C TIntFindFieldIndex(const TPbkContactItemField &aField)const

    Returns aField's index from this contact item.

    See also: TPbkContactItemField::IsSame

    ParameterDescription
    aFieldField to search for. Field is matched with TPbkContactItemField::IsSame -function.

    Returns: Index of aField in this contact item's field set, KErrNotFound if not found.

    FindNextFieldWithPhoneNumber ( const TDesC &, TInt, TInt & )

    IMPORT_C TPbkContactItemField *FindNextFieldWithPhoneNumber(const TDesC &aNumber,
    TIntaNumberOfDigits,
    TInt &aIndex
    )const

    Searches phone number fields of this contact for a match. Uses PbkEngUtils::ContainSameDigits to perform the matching.

    See also: PbkEngUtils::ContainSameDigits

    ParameterDescription
    aNumberPhone number to match to.
    aNumberOfDigitsNumber of digits to compare from the end of the phone numbers. Full comparison performed if 0.
    aIndexInput: field index where to start the search from, output: index of the found field or KErrNotFound if not found.

    Returns: The matching field, NULL if not found.

    FindNextFieldWithText ( const TDesC &, TInt & )

    IMPORT_C TPbkContactItemField *FindNextFieldWithText(const TDesC &aText,
    TInt &aIndex
    )const

    Searches for a text in this contact's fields. Uses TDesC::FindF() search the text from the fields.

    See also: TDesC::FindF

    ParameterDescription
    aIndexInput: field index from where to start the search, Output: index of the found field or KErrNotFound if not found.

    Returns: The matching field, NULL if not found.

    FindSameField ( const TPbkContactItemField & )

    IMPORT_C TPbkContactItemField *FindSameField(const TPbkContactItemField &aField)const

    Returns field matching aField from this contact item's field set, NULL if not found.

    ParameterDescription
    aFieldThe field that we a mathing.

    Returns: Matching field or NULL if not found. !FindSameField(field) || FindSameField(field)->IsSame(field)

    GetContactTitleL ( )

    IMPORT_C HBufC *GetContactTitleL()const

    Gets a title text for this contact or localized unnamed text.

    Returns: A buffer containing the title or localized unnamed text if no title can be generated. Caller is responsible for deleting the returned buffer.

    GetContactTitleOrNullL ( )

    IMPORT_C HBufC *GetContactTitleOrNullL()const

    Gets a title text for this contact.

    Returns: A buffer containing the title text, NULL if title is empty. Caller is responsible for deleting the returned buffer.

    GroupsJoinedLC ( )

    IMPORT_C CContactIdArray *GroupsJoinedLC()const

    Gets the groups this contact belongs to.

    See also: CContactItem::GroupsJoinedLC()

    Returns: Array of group ids. Caller owns the array.

    Id ( )

    IMPORT_C TContactItemIdId()const

    Returns this contact item's id.

    See also: CContactItem::Id()

    NewL ( CContactItem *, const CPbkFieldsInfo &, MPbkContactNameFormat & )

    IMPORT_C CPbkContactItem *NewL(CContactItem *aItem,
    const CPbkFieldsInfo &aFieldsInfo,
    MPbkContactNameFormat &aNameFormat
    )[static]

    Creates an instance of this class.

    ParameterDescription
    aItemContact item this object wraps. This object takes ownership of aItem. If this function leaves, ownership is not taken.
    aFieldsInfoCollection of Phonebook field types.
    aNameFormatContact name formatter.

    Returns: A new instance of this class.

    PbkFieldAt ( TInt )

    MPbkFieldData &PbkFieldAt(TIntaIndex)

    PbkFieldAt ( TInt )

    const MPbkFieldData &PbkFieldAt(TIntaIndex)const

    PbkFieldCount ( )

    TInt PbkFieldCount()const

    PrepareAfterLoadL ( )

    voidPrepareAfterLoadL()

    PrepareForSaveL ( )

    voidPrepareForSaveL()

    RemoveDefaultEmailField ( )

    IMPORT_C voidRemoveDefaultEmailField()

    Removes email field default from this contact.

    DefaultEmailField()==NULL.

    RemoveDefaultEmailOverSmsField ( )

    IMPORT_C voidRemoveDefaultEmailOverSmsField()

    Removes EmailOverSms field default from this contact.

    DefaultEmailOverSmsField()==NULL.

    RemoveDefaultMmsField ( )

    IMPORT_C voidRemoveDefaultMmsField()

    Removes MMS field default from this contact.

    DefaultMmsField()==NULL.

    RemoveDefaultPhoneNumberField ( )

    IMPORT_C voidRemoveDefaultPhoneNumberField()

    Removes phone number default from this contact.

    DefaultPhoneNumberField()==NULL.

    RemoveDefaultPocField ( )

    IMPORT_C voidRemoveDefaultPocField()

    Removes POC field default from this contact.

    DefaultPocField()==NULL.

    RemoveDefaultSmsField ( )

    IMPORT_C voidRemoveDefaultSmsField()

    Removes SMS field default from this contact.

    DefaultSmsField()==NULL.

    RemoveDefaultVideoNumberField ( )

    IMPORT_C voidRemoveDefaultVideoNumberField()

    Removes video number default from this contact.

    DefaultVideoNumberField()==NULL.

    RemoveDefaultVoipField ( )

    IMPORT_C voidRemoveDefaultVoipField()

    Removes VOIP field default from this contact.

    DefaultVoipField()==NULL.

    RemoveField ( TInt )

    IMPORT_C voidRemoveField(TIntaIndex)

    Deletes field at aIndex.

    ParameterDescription
    aIndexField index to delete from the contact item.

    RemoveVoiceTagField ( )

    IMPORT_C voidRemoveVoiceTagField()

    Removes any voice tag mark from this contact.

    VoiceTagField()==NULL. Deprecated

    SetDefaultEmailFieldL ( TPbkContactItemField * )

    IMPORT_C voidSetDefaultEmailFieldL(TPbkContactItemField *aField)

    Sets this contact's default email address field to aField.

    Exceptions
    KErrNotFound

    If aField is not this contact's field.

    KErrNotSupported

    If aField is not an email field.

    ParameterDescription
    aFieldField to set as default, if NULL email default is removed. Guaranteed not to leave if aField is NULL.

    SetDefaultEmailOverSmsFieldL ( TPbkContactItemField * )

    IMPORT_C voidSetDefaultEmailOverSmsFieldL(TPbkContactItemField *aField)

    Sets this contact's default Sms With Email address field to aField.

    Exceptions
    KErrNotFound

    If aField is not this contact's field.

    KErrNotSupported

    If aField is not an email field.

    ParameterDescription
    aFieldField to set as default, if NULL Sms With Email default is removed. Guaranteed not to leave if aField is NULL.

    SetDefaultMmsFieldL ( TPbkContactItemField * )

    IMPORT_C voidSetDefaultMmsFieldL(TPbkContactItemField *aField)

    Sets this contact's default MMS address field to aField.

    Exceptions
    KErrNotFound

    If aField is not this contact's field.

    KErrNotSupported

    If aField is not an email field.

    ParameterDescription
    aFieldField to set as default, if NULL MMS default is removed. Guaranteed not to leave if aField is NULL.

    SetDefaultPhoneNumberFieldL ( TPbkContactItemField * )

    IMPORT_C voidSetDefaultPhoneNumberFieldL(TPbkContactItemField *aField)

    Sets this contact's default phone number field to aField.

    Exceptions
    KErrNotFound

    If aField is not this contact's field.

    KErrNotSupported

    If aField is not a phone number field.

    ParameterDescription
    aFieldField to set as default, if NULL phone number default is removed. Guaranteed not to leave if aField is NULL.

    SetDefaultPocFieldL ( TPbkContactItemField * )

    IMPORT_C voidSetDefaultPocFieldL(TPbkContactItemField *aField)

    Sets this contact's default POC address field to aField.

    Exceptions
    KErrNotFound

    If aField is not this contact's field.

    KErrNotSupported

    If aField is not an email field.

    ParameterDescription
    aFieldField to set as default, if NULL POC default is removed. Guaranteed not to leave if aField is NULL.

    SetDefaultSmsFieldL ( TPbkContactItemField * )

    IMPORT_C voidSetDefaultSmsFieldL(TPbkContactItemField *aField)

    Sets this contact's default SMS field to aField.

    Exceptions
    KErrNotFound

    if aField is not this contact's field.

    KErrNotSupported

    if aField is not a phone number field.

    ParameterDescription
    aFieldField to set as default, if NULL SMS default is removed. Guaranteed not to leave if aField is NULL.

    SetDefaultVideoNumberFieldL ( TPbkContactItemField * )

    IMPORT_C voidSetDefaultVideoNumberFieldL(TPbkContactItemField *aField)

    Sets this contact's default video number field to aField.

    Exceptions
    KErrNotFound

    if aField is not this contact's field.

    KErrNotSupported

    if aField is not a phone number field.

    ParameterDescription
    aFieldField to set as default, if NULL video number default is removed. Guaranteed not to leave if aField is NULL.

    SetDefaultVoipFieldL ( TPbkContactItemField * )

    IMPORT_C voidSetDefaultVoipFieldL(TPbkContactItemField *aField)

    Sets this contact's default VOIP address field to aField.

    Exceptions
    KErrNotFound

    If aField is not this contact's field.

    KErrNotSupported

    If aField is not an email field.

    ParameterDescription
    aFieldField to set as default, if NULL VOIP default is removed. Guaranteed not to leave if aField is NULL.

    SetVoiceTagFieldL ( TPbkContactItemField * )

    IMPORT_C voidSetVoiceTagFieldL(TPbkContactItemField *aField)

    Sets this contact's voice tag field to aField.

    Exceptions
    KErrNotFound

    If aField is not this contact's field.

    KErrNotSupported

    If aField is not a phone number field. (aField && VoiceTagField()->IsSame(*aField)) || (!aField && !VoiceTagField())

    Deprecated
    ParameterDescription
    aFieldField to set as default, if NULL voice tag mark is removed. Guaranteed not to leave if aField is NULL.

    Type ( )

    IMPORT_C TUidType()const

    Returns type of this contact item. The contact types are documented in the Symbian Contacts model CContactItem::Type().

    See also: CContactItem::Type()

    Returns: Contact type.

    UpdateFieldSetL ( const CPbkFieldsInfo & )

    IMPORT_C voidUpdateFieldSetL(const CPbkFieldsInfo &aFieldsInfo)

    Updates this contacts field set to match the field set of the owned CContactItem. No need to call unless contact item's field set has been manipulated directly. In other words remaps the field types of this contact item from the underlying Symbian Contacts model contact item.

    ParameterDescription
    aFieldsInfoThe new fields set for this contact.

    VoiceTagField ( )

    IMPORT_C TPbkContactItemField *VoiceTagField()const

    Returns the voice tag field of this contact. NOTE: If this function is unable to make a connection to the voice tag handling system for some reason, this function will return null.

    Deprecated

    Returns: Voice tag field of this contact, NULL if no voice tag set.