CContentType Class Reference

#include <app/cntfield.h>

Link against: cntmodel.lib

class CContentType : public CBase

Inherits from

  • CContentType

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

    Constructor & Destructor Documentation

    ~CContentType ( )

    IMPORT_C~CContentType()

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

    Member Function Documentation

    AddFieldTypeL ( TFieldType )

    IMPORT_C voidAddFieldTypeL(TFieldTypeaFieldType)

    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.

    ParameterDescription
    aFieldTypeThe field type to append to the list of field types.

    ContainsFieldType ( TFieldType )

    IMPORT_C TBoolContainsFieldType(TFieldTypeaFieldType)const

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

    ParameterDescription
    aFieldTypeThe field type of interest.

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

    ExternalizeL ( RWriteStream & )

    voidExternalizeL(RWriteStream &aStream)const

    Externalises a CContentType object to a write stream.

    ParameterDescription
    aStreamStream to which the object should be externalised.

    FieldType ( TInt )

    IMPORT_C TFieldTypeFieldType(TIntaIndex)const

    Gets the indexed field type.

    ParameterDescription
    aIndexIndex 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.

    Returns: The indexed field type.

    FieldTypeCount ( )

    IMPORT_C TIntFieldTypeCount()const

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

    Returns: The number of field types in the content type.

    InternalizeAdditionalUidsL ( TInt, RReadStream & )

    voidInternalizeAdditionalUidsL(TIntaCount,
    RReadStream &aStream
    )

    InternalizeL ( RReadStream & )

    voidInternalizeL(RReadStream &aStream)

    Internalises a CContentType object from a read stream.

    ParameterDescription
    aStreamStream from which the object should be internalised.

    IsEqual ( const CContentType & )

    IMPORT_C TBoolIsEqual(const CContentType &aType)const
    Compares two content type objects for equality. Two content type objects are equal according to this method if all following conditions are met:
    • vCard property mapping matches

    • same number of field types

    • main field type matches

    • additional field types and vCard property parameter mappings match

    ParameterDescription
    aTypeThe content type to compare with this CContentType.

    Returns: ETrue if aType is equal with current content type.

    IsEqualForSyncUpdate ( const CContentType & )

    IMPORT_C TBoolIsEqualForSyncUpdate(const CContentType &aType)const

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

    ParameterDescription
    aTypeThe content type to compare with this CContentType.

    Returns: ETrue if aType is an identical content type

    Mapping ( )

    IMPORT_C TUidMapping()const

    Gets the vCard mapping.

    Returns: The vCard mapping.

    NewL ( )

    IMPORT_C CContentType *NewL()[static]

    Allocates and constructs a new default CContentType.

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

    Returns: Pointer to the newly created content type object.

    NewL ( TFieldType, TUid )

    IMPORT_C CContentType *NewL(TFieldTypeaFieldType,
    TUidaMapping = KNullUid
    )[static]

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

    ParameterDescription
    aFieldTypeThe field type to add to the content type.
    aMappingThe mapping.

    Returns: Pointer to the newly created content type object.

    NewL ( const CContentType & )

    IMPORT_C CContentType *NewL(const CContentType &aContentType)[static]

    Allocates and constructs a new CContentType based on another one.

    ParameterDescription
    aContentTypeThe CContentType on which to base the new one.

    Returns: Pointer to the newly created content type object.

    NewLC ( RReadStream & )

    CContentType *NewLC(RReadStream &aStream)[static]

    Constructs a new content type based on a RReadStream.

    ParameterDescription
    aStreamRReadStream containing object to internalize.

    Returns: Pointer to the newly created CContentType. This is left on the cleanup stack.

    RemoveFieldType ( TFieldType )

    IMPORT_C voidRemoveFieldType(TFieldTypeaFieldType)

    Removes a field type from the list of field types.

    ParameterDescription
    aFieldTypeThe field type to remove from the list of field types.

    Reset ( )

    voidReset()

    SetMapping ( TUid )

    IMPORT_C voidSetMapping(TUidaMapping)

    Sets the vCard mapping.

    ParameterDescription
    aMappingThe new vCard mapping for the content type.

    SupportsMultipleLines ( )

    IMPORT_C TBoolSupportsMultipleLines()const

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

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

    operator== ( const CContentType & )

    IMPORT_C TBooloperator==(const CContentType &aType)const
    Compares two content type objects for equality. Two content type objects are equal according to this method if all following conditions are met:
    • vCard property mapping matches

    • same number of field types

    • main field type matches

    • additional field types and vCard property parameter mappings match

    ParameterDescription
    aTypeThe content type to compare with this CContentType. +

    Returns: ETrue if aType is equal with current content type.