CViewContact Class Reference

#include <app/cntviewbase.h>

Link against: cntmodel.lib

class CViewContact : public CBase

Inherits from

  • CViewContact

    Detailed Description

    The representation of a contact item used in contact views.

    It stores the contact item ID and other information. This includes a buffer holding the contents of all the item's fields, an array of indexes into the buffer indicating the start position of each field and a hint bit field (a combination of CContactDatabase::TContactViewFilter values) which is used in filtered views.

    The fields are defined by the view's sort order (RContactViewSortOrder).

    Member Enumeration Documentation

    Enum TViewContactType

    Defines whether the contact view item is a contact group.

    EnumeratorValueDescription
    EContactItem

    The contact view item is not a contact group.

    EGroup

    The contact view item is a contact group (CContactGroup).

    Constructor & Destructor Documentation

    CViewContact ( TContactItemId )

    IMPORT_CCViewContact(TContactItemIdaId)

    Constructs a CViewContact object.

    This should not be called by clients. CViewContact::NewLC() should be used instead.

    ParameterDescription
    aIdThe contact ID to assign to the object.

    ~CViewContact ( )

    IMPORT_C~CViewContact()

    Destructor.

    Member Function Documentation

    AddFieldL ( const TDesC & )

    IMPORT_C voidAddFieldL(const TDesC &aField)

    ChangeToLightweightObject ( )

    IMPORT_C voidChangeToLightweightObject()

    Change the view contact object to lightweight object to save memory. It actually just delete the instance of CViewContactExtension.

    ContactHint ( )

    IMPORT_C TIntContactHint()const

    Get this contact's hint field value

    Returns: The contact hint value

    ContactMatchesFilter ( TInt )

    IMPORT_C TBoolContactMatchesFilter(TIntaFilter)const

    Checks if this contact matches the supplied filter.

    Returns: ETrue, if this contact matches the filter supplied; EFalse, otherwise.

    ContactType ( )

    TViewContactType ContactType()const [inline]

    Gets the view item's type.

    Returns: The view item's type.

    ContactTypeUid ( )

    IMPORT_C TUidContactTypeUid()const

    CopyL ( const CViewContact & )

    voidCopyL(const CViewContact &aContact)

    Copy the given view contact object to this instance.

    leave
    KErrNoMemory
    ParameterDescription
    aContactthe view contact to be copied.

    ExternalizeL ( RWriteStream & )

    IMPORT_C voidExternalizeL(RWriteStream &aStream)const

    Externalises a CViewContact object to a write stream.

    ParameterDescription
    aStreamStream to which the object is externalised.

    ExternalizedSize ( )

    IMPORT_C TIntExternalizedSize()const

    Retrieves the number of bytes required to store the contact view item when externalised.

    Returns: The size of the contact view item.

    Field ( TInt )

    IMPORT_C TPtrCField(TIntaPosition)const

    Gets a pointer descriptor to the contents of the single field located at the specified field index.

    panic
    CNTMODEL 27 In debug builds, this indicates that aPosition is invalid. It must be less than the number of fields in the item.
    ParameterDescription
    aPositionA field index.

    Returns: The contents of the field located at the specified field index.

    FieldCount ( )

    IMPORT_C TIntFieldCount()const

    Gets the number of fields in the contact view item.

    Returns: The number of fields in the item.

    FindFirstPopulatedField ( TInt, TInt & )

    TPtrC FindFirstPopulatedField(TIntaOffset,
    TInt &aFoundPosition
    )const

    HintFieldMatchesFilter ( TInt, TInt )

    TBool HintFieldMatchesFilter(TIntaHintField,
    TIntaFilter
    )[static]

    Compares a given hint field with any given filter. static function. Used to support member function ContactMatchesFilter and exported function ContactMatchesHintFieldL, from CContactDatabase.

    ParameterDescription
    aHintFieldthe hint bit flag field
    aFilterthe filter to compare against

    Id ( )

    TContactItemId Id()const [inline]

    Gets the view item's ID.

    Returns: The view item's ID.

    InternalizeL ( RReadStream & )

    IMPORT_C voidInternalizeL(RReadStream &aStream)

    Internalises a CViewContact object from a read stream.

    ParameterDescription
    aStreamStream from which the object is internalised.

    IsLightweightObject ( )

    TBool IsLightweightObject()const

    Check if the view contact object is a lightweight object.

    IsSortable ( )

    IMPORT_C TBoolIsSortable()const

    Test if contact is 'Sortable'

    NewL ( const CViewContact & )

    IMPORT_C CViewContact *NewL(const CViewContact &aContact)[static]

    Allocates and constructs a CViewContact object, based on an existing one.

    ParameterDescription
    aContactAn existing CViewContact object whose values are used to initialise the new one.

    Returns: Pointer to the newly created representation of a contact item used in contact views.

    NewL ( TContactItemId, TInt )

    IMPORT_C CViewContact *NewL(TContactItemIdaId,
    TIntaLength
    )[static]

    Allocates and constructs a CViewContact object, based on an existing one.

    ParameterDescription
    aIdID of the existing CViewContact object whose values are used to initialise the new one.
    aLengthinitial MaxLenght of a contact buffer

    NewLC ( TContactItemId )

    IMPORT_C CViewContact *NewLC(TContactItemIdaId)[static]

    Allocates and constructs a CViewContact object, based on an existing one.

    ParameterDescription
    aIdID of the existing CViewContact object whose values are used to initialise the new one.

    Returns: Pointer to the newly created representation of a contact item used in contact views.

    NewLC ( RReadStream & )

    CViewContact *NewLC(RReadStream &aStream)[static]

    Reset ( )

    IMPORT_C voidReset()

    Used for creating a view. Allows to re-use the same contact object what reduces the number of memory re-allocations. Resets the indexes array and contact buffer. The buffer MaxLength stays the same.

    SetContactHint ( TInt )

    IMPORT_C voidSetContactHint(TIntaHint)

    Set this contact's hint field value

    ParameterDescription
    aHintThe new contact hint value

    SetContactType ( CViewContact::TViewContactType )

    voidSetContactType(CViewContact::TViewContactTypeaContactType)[inline]

    Sets the view item's type.

    ParameterDescription
    aContactTypeThe view item's type.

    SetContactTypeUid ( TUid )

    IMPORT_C voidSetContactTypeUid(TUidaUid)

    Note: This method can leave.

    leave
    KErrNoMemory The CViewContactExtension cannot be allocated.

    SetFirstFieldForBlankContactL ( const TDesC & )

    IMPORT_C voidSetFirstFieldForBlankContactL(const TDesC &aFirstField)

    Set the first field text for the CViewContact. Fields are stored in one HBufC. Each field can be accessed using the indexes stored in the iTextIndexes member.

    SetId ( TContactItemId )

    voidSetId(TContactItemIdaId)[inline]

    Sets the view item's ID.

    ParameterDescription
    aIdThe contact item ID.