EPOC   SDK Home Glossary Indexes Previous Next Up

CContactTextDef class


Contents


CContactTextDef class — Text definition

Section Contents


Overview

Compatibility

Applications that use this class will not work correctly on a version of EPOC earlier than ER5.

Derivation

CArrayFixBase

Abstract: implementation; non-templated base class and shared code.

CArrayFix<TAny>

Abstract: implementation; shared code base class.

CArrayFixFlat<TContactTextDefItem>

A fixed length array of class TContactTextDefItem objects using a flat array buffer.

Defined in

cntdb.h

Link against

cntmodel.lib

Description

A text definition is an array of text definition items (TContactTextDefItems). It is used to define a way of grouping together fields to specify a string to represent a contact item.

When creating the string, a contact item is searched for fields whose type match those 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 may be separated using field separators which are 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 the array of text definition items, a fallback field type can be specified. This is used when none of the fields specified in the text definition item array contain any text. If the fallback field contains no text either, or if no fallback field type has been specified (its value is KUidContactFieldNone), the text is read from the first non-empty field.

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.


Allocation and construction


NewL() — Allocate and construct

static CContactTextDef* NewL();

static CContactTextDef* NewLC();

Description

Use these functions to allocate and construct a new CContactTextDef. If the new text definition is successfully constructed, NewLC() leaves it on the cleanup stack.

The fallback field type is initialised to KUidContactFieldNone.

Return value

CContactTextDef*

Pointer to the newly created text definition.


Fallback field type


SetFallbackField() — Set the fallback field type

void SetFallbackField(TFieldType iFieldType);

Description

Set the fallback field type.

Arguments

TFieldType iFieldType

The fallback field type.


FallbackField() — Get the fallback field type

TFieldType FallbackField() const;

Description

Get the fallback field type.

Return value

TFieldType

The fallback field type.

EPOC       SDK Home Glossary Indexes Previous Next Up