Location:
CNTDB.H
Link against: cntmodel.lib
class CContactTextDef : public CArrayFixFlat< TContactTextDefItem >;
Defines a way of grouping fields to form a string which represents a contact item.
A text definition is implemented as an array of text definition items (TContactTextDefItems).
For example, CContactDatabase::ReadContactTextDefL()
uses a text definition to build up a string from a contact item. When creating the string, it 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.
Additionally, the text definition may also contain a fallback field type. This is used when none of the 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 overridden 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.
CArrayFixFlat< TContactTextDefItem >
- No description.
CContactTextDef
- Defines a way of grouping fields to form a string which represents a contact item
Defined in CContactTextDef
:
ExactMatchOnly()
, FallbackField()
, NewL()
, NewLC()
, SetExactMatchOnly()
, SetFallbackField()
static IMPORT_C CContactTextDef *NewL();
Allocates and constructs a new text definition. The fallback field type is initialised to KUidContactFieldNone.
|
static IMPORT_C CContactTextDef *NewLC();
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.
|
IMPORT_C void SetFallbackField(TFieldType iFieldType);
Sets the fallback field type.
|
IMPORT_C TFieldType FallbackField() const;
Gets the fallback field type.
|
IMPORT_C TBool ExactMatchOnly();
Gets the exact match for contact fields
|
IMPORT_C void SetExactMatchOnly(TBool aExactMatchOnly);
Sets the exact match for contact fields
|