Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: cntdb.h
Link against: cntmodel.lib

Class CContactTextDef

CContactTextDef

Support

Supported from 5.0

Description

Defines a way of grouping together fields to form a string which represents a contact item. A text definition is an array of text definition items (TContactTextDefItems).

An example of a function which uses a text definition to build up a string from a contact item is CContactDatabase::ReadContactTextDefL(). When creating the string, this function searches the item for fields whose type matches one of the fields specified in the text definition. The contents of the first matching field of each type found in the item are read into the string. These strings may be separated using a field separator, which is also specified in the text definition. A separator is not appended to the last field used to make up the string — it is only inserted when there is a following non-empty field.

In addition to this, the text definition may also contain a fallback field type. This is used when none of a contact item's fields specified in the text definition contain any text. If the item's fallback field contains no text either, or if the fallback field type's value is KUidContactFieldNone, the text is read from the first non-empty field in the item.

A contact database can have a default text definition which is set using CContactDatabase::SetTextDefinitionL(). This may be overriden using the variants of CContactDatabase::ReadContactTextDefL() which take a CContactTextDef* argument.

CContactTextDef is derived from CArrayFixFlat<TContactTextDefItem>, so all relevant functions can be used, e.g. to add and remove elements.

Derivation

CArrayFixA thin templated base class for arrays of fixed length objects
CArrayFixBaseBase class for arrays of fixed length objects
CArrayFixFlatArray of fixed length objects contained within a flat dynamic buffer
CBaseBase class for all classes to be instantiated on the heap
CContactTextDefDefines a way of grouping together fields to form a string which represents a contact item

Defined in CContactTextDef:
FallbackField(), NewL(), NewLC(), SetFallbackField()

Inherited from CArrayFix:
AppendL(), AppendL()Append, Array(), At(), Back(), End(), ExpandL(), ExtendL(), Find(), FindIsq(), InsertIsqAllowDuplicatesL(), InsertIsqL(), InsertL(), ResizeL(), operator[]

Inherited from CArrayFixBase:
Compress(), Count(), Delete(), Length(), Reset(), Sort()

Inherited from CArrayFixFlat:
SetReserveL()

Inherited from CBase:
operator new()


Allocation and construction


NewL()

static CContactTextDef* NewL();

Description

Allocates and constructs a new text definition. The fallback field type is initialised to KUidContactFieldNone.

Return value

CContactTextDef*

Pointer to the newly created text definition.


NewLC()

static CContactTextDef* NewLC();

Description

Allocates and constructs a new text definition. If the text definition is successfully constructed, it is left on the cleanup stack.The fallback field type is initialised to KUidContactFieldNone.

Return value

CContactTextDef*

Pointer to the newly created text definition.

[Top]


Fallback field type


SetFallbackField()

void SetFallbackField(TFieldType iFieldType);

Description

Sets the fallback field type.

Parameters

TFieldType iFieldType

The fallback field type.


FallbackField()

TFieldType FallbackField() const;

Description

Gets the fallback field type.

Return value

TFieldType

The fallback field type.