CViewContact Class Reference

#include <app/cntviewbase.h>

class CViewContact : public CBase, public CBase

Inherits from

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.

Parameters
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

Return Value
The contact hint value

ContactMatchesFilter ( TInt )

IMPORT_C TBoolContactMatchesFilter(TIntaFilter)const

Checks if this contact matches the supplied filter.

Return Value
ETrue, if this contact matches the filter supplied; EFalse, otherwise.

ContactType ( )

TViewContactType ContactType()const [inline]

Gets the view item's type.

Return Value
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.

Parameters
aContactthe view contact to be copied.
Leave Codes
KErrNoMemory

ExternalizeL ( RWriteStream & )

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Externalises a CViewContact object to a write stream.

Parameters
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.

Return Value
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.

Parameters
aPositionA field index.
Return Value
The contents of the field located at the specified field index.
Panic Codes
CNTMODEL27 In debug builds, this indicates that aPosition is invalid. It must be less than the number of fields in the item.

FieldCount ( )

IMPORT_C TIntFieldCount()const

Gets the number of fields in the contact view item.

Return Value
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.

Parameters
aHintFieldthe hint bit flag field
aFilterthe filter to compare against

Id ( )

TContactItemId Id()const [inline]

Gets the view item's ID.

Return Value
The view item's ID.

InternalizeL ( RReadStream & )

IMPORT_C voidInternalizeL(RReadStream &aStream)

Internalises a CViewContact object from a read stream.

Parameters
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.

Parameters
aContactAn existing CViewContact object whose values are used to initialise the new one.
Return Value
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.

Parameters
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.

Parameters
aIdID of the existing CViewContact object whose values are used to initialise the new one.
Return Value
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

Parameters
aHintThe new contact hint value

SetContactType ( CViewContact::TViewContactType )

voidSetContactType(CViewContact::TViewContactTypeaContactType)[inline]

Sets the view item's type.

Parameters
aContactTypeThe view item's type.

SetContactTypeUid ( TUid )

IMPORT_C voidSetContactTypeUid(TUidaUid)

Note: This method can leave.

Leave Codes
KErrNoMemoryThe 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.

Parameters
aIdThe contact item ID.