CContactTextDef Class Reference

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.

Public Member Functions
CContactTextDef ()
IMPORT_C TBool ExactMatchOnly ()
void ExternalizeL ( RWriteStream &)
IMPORT_C TFieldType FallbackField ()
void InternalizeL ( RReadStream &)
IMPORT_C CContactTextDef * NewL ()
IMPORT_C CContactTextDef * NewLC ()
CContactTextDef * NewLC ( RReadStream &)
IMPORT_C void SetExactMatchOnly ( TBool )
IMPORT_C void SetFallbackField ( TFieldType )
Inherited Functions
CArrayFix< TContactTextDefItem >::AppendL(const TContactTextDefItem &)
CArrayFix< TContactTextDefItem >::AppendL(const TContactTextDefItem &,TInt)
CArrayFix< TContactTextDefItem >::AppendL(const TContactTextDefItem *,TInt)
CArrayFix< TContactTextDefItem >::Array()const
CArrayFix< TContactTextDefItem >::At(TInt)
CArrayFix< TContactTextDefItem >::At(TInt)const
CArrayFix< TContactTextDefItem >::Back(TInt)
CArrayFix< TContactTextDefItem >::Back(TInt)const
CArrayFix< TContactTextDefItem >::CArrayFix(TBufRep,TInt)
CArrayFix< TContactTextDefItem >::End(TInt)
CArrayFix< TContactTextDefItem >::End(TInt)const
CArrayFix< TContactTextDefItem >::ExpandL(TInt)
CArrayFix< TContactTextDefItem >::ExtendL()
CArrayFix< TContactTextDefItem >::Find(const TContactTextDefItem &,TKeyArrayFix &,TInt &)const
CArrayFix< TContactTextDefItem >::FindIsq(const TContactTextDefItem &,TKeyArrayFix &,TInt &)const
CArrayFix< TContactTextDefItem >::InsertIsqAllowDuplicatesL(const TContactTextDefItem &,TKeyArrayFix &)
CArrayFix< TContactTextDefItem >::InsertIsqL(const TContactTextDefItem &,TKeyArrayFix &)
CArrayFix< TContactTextDefItem >::InsertL(TInt,const TContactTextDefItem &)
CArrayFix< TContactTextDefItem >::InsertL(TInt,const TContactTextDefItem &,TInt)
CArrayFix< TContactTextDefItem >::InsertL(TInt,const TContactTextDefItem *,TInt)
CArrayFix< TContactTextDefItem >::ResizeL(TInt)
CArrayFix< TContactTextDefItem >::ResizeL(TInt,const TContactTextDefItem &)
CArrayFix< TContactTextDefItem >::operator[](TInt)
CArrayFix< TContactTextDefItem >::operator[](TInt)const
CArrayFixBase::AtR(const CBase *,TInt)
CArrayFixBase::CArrayFixBase(TBufRep,TInt,TInt)
CArrayFixBase::Compress()
CArrayFixBase::Count()const
CArrayFixBase::CountR(const CBase *)
CArrayFixBase::Delete(TInt)
CArrayFixBase::Delete(TInt,TInt)
CArrayFixBase::Find(const TAny *,TKeyArrayFix &,TInt &)const
CArrayFixBase::FindIsq(const TAny *,TKeyArrayFix &,TInt &)const
CArrayFixBase::InsertIsqAllowDuplicatesL(const TAny *,TKeyArrayFix &)
CArrayFixBase::InsertIsqL(const TAny *,TKeyArrayFix &)
CArrayFixBase::InsertL(TInt,const TAny *)
CArrayFixBase::InsertL(TInt,const TAny *,TInt)
CArrayFixBase::InsertRepL(TInt,const TAny *,TInt)
CArrayFixBase::Length()const
CArrayFixBase::Reset()
CArrayFixBase::ResizeL(TInt,const TAny *)
CArrayFixBase::SetKey(TKeyArrayFix &)const
CArrayFixBase::SetReserveFlatL(TInt)
CArrayFixBase::Sort(TKeyArrayFix &)
CArrayFixBase::~CArrayFixBase()
CArrayFixFlat< TContactTextDefItem >::CArrayFixFlat(TInt)
CArrayFixFlat< TContactTextDefItem >::SetReserveL(TInt)
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
TBool iExactMatchOnly
TFieldType iFallbackFieldType

Constructor & Destructor Documentation

CContactTextDef()

CContactTextDef ( )

Member Functions Documentation

ExactMatchOnly()

IMPORT_C TBool ExactMatchOnly ( )

Gets the exact match for contact fields

ExternalizeL(RWriteStream &)

void ExternalizeL ( RWriteStream & aStream ) const

Externalises a CContactItem object to a write stream.

Parameters

RWriteStream & aStream Stream to which the object should be externalised.

FallbackField()

IMPORT_C TFieldType FallbackField ( ) const

Gets the fallback field type.

InternalizeL(RReadStream &)

void InternalizeL ( RReadStream & aStream )

Internalises a CContactItem object from a read stream.

Parameters

RReadStream & aStream Stream from which the object should be internalised.

NewL()

IMPORT_C CContactTextDef * NewL ( ) [static]

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

NewLC()

IMPORT_C CContactTextDef * NewLC ( ) [static]

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.

NewLC(RReadStream &)

CContactTextDef * NewLC ( RReadStream & aStream ) [static]

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

Parameters

RReadStream & aStream RReadStream containing object to internalize.

SetExactMatchOnly(TBool)

IMPORT_C void SetExactMatchOnly ( TBool aExactMatchOnly )

Sets the exact match for contact fields

Parameters

TBool aExactMatchOnly Contains the value for exact match. It takes ETrue when an exact match is required, EFalse otherwise.

SetFallbackField(TFieldType)

IMPORT_C void SetFallbackField ( TFieldType iFieldType )

Sets the fallback field type.

Parameters

TFieldType iFieldType The fallback field type.

Member Data Documentation

TBool iExactMatchOnly

TBool iExactMatchOnly [private]

TFieldType iFallbackFieldType

TFieldType iFallbackFieldType [private]