Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: CNTFIELD.H
Link against: cntmodel.lib

Class CContentType

class CContentType : public CBase;

Description

The content type for a contact item field.

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 type alone is 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

Members

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

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


~CContentType()

IMPORT_C ~CContentType();

Description

Frees all resources owned by the content type object, prior to its destruction.


NewL()

static IMPORT_C CContentType *NewL();

Description

Allocates and constructs a new default CContentType.

The object has no field types and the mapping is set to KNullUid

Return value

CContentType *

Pointer to the newly created content type object.


NewL()

static IMPORT_C CContentType *NewL(TFieldType aFieldType, TUid aMapping=TUid::Null());

Description

Allocates and constructs a new CContentType with a single field type and a mapping.

Parameters

TFieldType aFieldType

The field type to add to the content type.

TUid aMapping

The mapping.

Return value

CContentType *

Pointer to the newly created content type object.


NewL()

static IMPORT_C CContentType *NewL(const CContentType &aContentType);

Description

Allocates and constructs a new CContentType based on another one.

Parameters

const CContentType &aContentType

The CContentType on which to base the new one.

Return value

CContentType *

Pointer to the newly created content type object.

[Top]


Member functions


SetMapping()

IMPORT_C void SetMapping(TUid aMapping);

Description

Sets the vCard mapping.

Parameters

TUid aMapping

The new vCard mapping for the content type.


AddFieldTypeL()

IMPORT_C void AddFieldTypeL(TFieldType aFieldType);

Description

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

Note that certain combinations of field types are not valid and should not be used.

Parameters

TFieldType aFieldType

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


RemoveFieldType()

IMPORT_C 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()

IMPORT_C 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()

IMPORT_C TInt FieldTypeCount() const;

Description

Gets the number of field types in the content type's list of field types.

Return value

TInt

The number of field types in the content type.


Mapping()

IMPORT_C TUid Mapping() const;

Description

Gets the vCard mapping.

Return value

TUid

The vCard mapping.


ContainsFieldType()

IMPORT_C 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.


SupportsMultipleLines()

IMPORT_C 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==()

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

Description

Compares two content type objects for equality. Two content type objects are equal according to this method if all following conditions are met:

Parameters

const CContentType &aType

The content type to compare with this CContentType. +

Return value

TBool

ETrue if aType is equal with current content type.


IsEqualForSyncUpdate()

IMPORT_C TBool IsEqualForSyncUpdate(const CContentType &aType) const;

Description

Tests whether the content types are suitable to match for synchronisation purpose.

Parameters

const CContentType &aType

The content type to compare with this CContentType.

Return value

TBool

ETrue if aType is an identical content type


IsEqual()

IMPORT_C TBool IsEqual(const CContentType &aType) const;

Description

Compares two content type objects for equality. Two content type objects are equal according to this method if all following conditions are met:

Parameters

const CContentType &aType

The content type to compare with this CContentType.

Return value

TBool

ETrue if aType is equal with current content type.