Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: cntfield.h
Link against: cntmodel.lib

Class CContentType

CContentType

Support

Supported from 5.0

Description

A contact item field's content type. The content type identifies the field's type and the vCard property which the field maps to. It is owned by the field. Field types are defined as UIDs in cntdef.h.

The vCard mapping is optional. It should be specified if the field types alone are not enough to identify the mapping. The possible values for the vCard mapping are defined as UIDs in cntdef.h.

Each field is uniquely identified by the combination of UIDs contained in the content type.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CContentTypeA contact item field's content type

Defined in CContentType:
AddFieldTypeL(), ContainsFieldType(), FieldType(), FieldTypeCount(), Mapping(), NewL(), RemoveFieldType(), SetMapping(), SupportsMultipleLines(), operator==(), ~CContentType()

Inherited from CBase:
operator new()


Construction and destruction


NewL()

static CContentType* NewL();
static CContentType* NewL(TFieldType aFieldType,TUid aMapping=KNullUid);
static CContentType* NewL(const CContentType& aContentType);

Description

Allocates and constructs a new CContentType — overloaded function. The object may be constructed:

Parameters

TFieldType aFieldType

The field type to add to the content type.

TUid aMapping=KNullUid

The mapping. Defaults to KNullUid.

Return value

CContentType*

Pointer to the newly created content type object.


~CContentType()

~CContentType();

Description

The destructor frees all resources owned by the content type object, prior to its destruction.

[Top]


Field types


AddFieldTypeL()

void AddFieldTypeL(TFieldType aFieldType);

Description

Appends a field type to the content type's list of field types.

Parameters

TFieldType aFieldType

The field type to append to the list of field types.


RemoveFieldType()

void RemoveFieldType(TFieldType aFieldType);

Description

Removes a field type from the list of field types.

Parameters

TFieldType aFieldType

The field type to remove from the list of field types.


FieldType()

TFieldType FieldType(TInt aIndex) const;

Description

Gets the indexed field type.

Parameters

TInt aIndex

Index into the list of field types. The position is relative to zero; i.e. zero implies the first element in the array. This value must be non-negative and less than the number of objects currently within the array otherwise the operator raises a panic.

Return value

TFieldType

The indexed field type.


FieldTypeCount()

TInt FieldTypeCount() const;

Description

Gets the number of field types in the CContentType's list of field types.

Return value

TInt

The number of field types in the content type.


ContainsFieldType()

TBool ContainsFieldType(TFieldType aFieldType) const;

Description

Tests whether the content type object contains the specified field type UID either as the mapping value or in its list of field types.

Parameters

TFieldType aFieldType

The field type of interest.

Return value

TBool

ETrue if the CContentType contains the specified field type. EFalse if not.

[Top]


vCard mapping


SetMapping()

void SetMapping(TUid aMapping);

Description

Sets the vCard mapping.

Parameters

TUid aMapping

The new vCard mapping for the content type.


Mapping()

TUid Mapping() const;

Description

Gets the vCard mapping.

Return value

TUid

The vCard mapping.

[Top]


Query


SupportsMultipleLines()

TBool SupportsMultipleLines() const;

Description

Tests whether the content type supports multiple lines of text. If the content type object contains a field type which supports this, either in its list of field types, or as its mapping, the function returns ETrue. Examples of such field types are address fields (type KUidContactFieldAddress) and note fields (type KUidContactFieldNote).

Return value

TBool

ETrue if the CContentType supports multiple lines of text. EFalse if not.


operator==()

TBool operator==(const CContentType& aType) const;

Description

Compares two content type objects for equality.

Parameters

const CContentType& aType

The content type to compare with this CContentType.

Return value

TBool

ETrue if aType is an identical content type. Field types do not need to be in the same order in the list of field types for a match to be made.