CContactItemViewDef Class Reference

#include <app/cntdb.h>

Link against: cntmodel.lib

class CContactItemViewDef : public CBase

Inherits from

  • CContactItemViewDef

    Detailed Description

    A view definition for a contact item.

    When reading or opening a contact item using the CContactDatabase class, a view definition may be specified to indicate which field data should be retrieved. See for instance CContactDatabase::ReadContactL().

    A view definition for a contact item contains an array of field types, a use (CContactItemViewDef::TUse) and a mode (CContactItemViewDef::TMode). The use indicates whether the field types contained in the view definition should be included in or excluded from the view. The mode indicates whether fields with the hidden attribute should be included or excluded.

    Member Enumeration Documentation

    Enum TMode

    Include or exclude hidden fields.

    EnumeratorValueDescription
    EIncludeHiddenFields

    Include hidden fields in the view.

    EMaskHiddenFields

    Exclude hidden fields from the view.

    Enum TUse

    Include or exclude specified fields.

    EnumeratorValueDescription
    EIncludeFields

    Include specified fields in the view.

    EMaskFields

    Exclude specified fields from the view.

    Member Function Documentation

    AddL ( TFieldType )

    IMPORT_C voidAddL(TFieldTypeaFieldType)

    Appends a field type to the view definition's array of field types.

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

    Contains ( const CContactItem & )

    IMPORT_C TBoolContains(const CContactItem &aItem)

    Tests whether a contact item complies with the view definition.

    This indicates whether or not the item will be included in the view.

    ParameterDescription
    aItemThe contact item to test.

    Returns: ETrue if any of the item's fields are contained in the view definition (so that the item will be included in the view), EFalse if none of the item's fields are contained in the view definition (so that the item will not be included in the view).

    Count ( )

    TInt Count()const [inline]

    Gets the number of field types in the view definition.

    Returns: The number of field types in the view definition.

    ExternalizeL ( RWriteStream & )

    IMPORT_C voidExternalizeL(RWriteStream &aStream)const

    Externalises the item view definition to a write stream. The presence of this function means that the standard templated operator<<() (defined in s32strm.h) is available to externalise objects of this class.

    ParameterDescription
    aStreamStream to which the item view definition should be externalised.

    Find ( const CContentType & )

    IMPORT_C TIntFind(const CContentType &aContentType)const

    Searches the view definition for any field type contained in the specified content type.

    ParameterDescription
    aContentTypeContent type containing the field types to search for.

    Returns: The index in the view definition of the first matching field type or KErrNotFound.

    Find ( TFieldType )

    IMPORT_C TIntFind(TFieldTypeaFieldType)const

    Searches the view definition for the specified field type.

    ParameterDescription
    aFieldTypeThe field type to search for.

    Returns: The index in the view definition of the matching field type, or KErrNotFound.

    InternalizeL ( RReadStream & )

    IMPORT_C voidInternalizeL(RReadStream &aStream)

    Internalises the item view definition from a read stream. The presence of this function means that the standard templated operator>>() (defined in s32strm.h) is available to internalise objects of this class.

    ParameterDescription
    aStreamStream from which the item view definition should be internalised.

    MatchesAll ( )

    IMPORT_C TBoolMatchesAll()const

    Tests whether the view definition contains a field type with the value KUidContactFieldMatchAll.

    If this is the case, all fields in the contact item are retrieved, regardless of the other field types specified in the view definition.

    Returns: ETrue if all field types are matched, EFalse if not.

    Mode ( )

    TMode Mode()const [inline]

    Gets the view definition's mode.

    Returns: The current TMode setting.

    NewL ( TUse, TMode )

    IMPORT_C CContactItemViewDef *NewL(TUseaUse,
    TModeaMode
    )[static]

    Allocates and constructs a new CContactItemViewDef, with a use and a mode.

    ParameterDescription
    aUseSpecifies whether to include or exclude specified fields.
    aModeSpecifies whether to include or exclude hidden fields.

    Returns: Pointer to the newly created view definition.

    NewLC ( TUse, TMode )

    IMPORT_C CContactItemViewDef *NewLC(TUseaUse,
    TModeaMode
    )[static]

    Allocates and constructs a new CContactItemViewDef, specifying a use and a mode, leaving the object on the cleanup stack.

    ParameterDescription
    aUseSpecifies whether to include or exclude specified fields.
    aModeSpecifies whether to include or exclude hidden fields.

    Returns: Pointer to the newly created view definition.

    NewLC ( RReadStream & )

    CContactItemViewDef *NewLC(RReadStream &aStream)[static]

    Allocates and constructs a new CContactItemViewDef based on a RReadStream, specifying a use and a mode, leaving the object on the cleanup stack.

    ParameterDescription
    aStreamRReadStream containing object to internalize.

    Returns: Pointer to the newly created view definition.

    Remove ( TFieldType )

    IMPORT_C voidRemove(TFieldTypeaFieldType)

    Removes a field type, identified by its UID.

    ParameterDescription
    aFieldTypeThe field type to remove from the list. This must be present in the CContactItemViewDef object, or the function raises a panic.

    Remove ( TInt )

    IMPORT_C voidRemove(TIntaIndex)

    Removes a field type, identified by its index into the array of field types.

    ParameterDescription
    aIndexThe index of the element to delete. The position is relative to zero. This value must not be negative and must not be greater than the number of elements currently in the list, or the function raises a panic.

    Reset ( )

    voidReset()[inline]

    Deletes all field types from the view definition's field type array.

    SetMode ( TMode )

    voidSetMode(TModeaMode)[inline]

    Sets the view definition's mode.

    ParameterDescription
    aModeThe new TMode setting.

    SetUse ( TUse )

    voidSetUse(TUseaUse)[inline]

    Sets the view definition's use.

    ParameterDescription
    aUseThe new TUse setting.

    Use ( )

    TUse Use()const [inline]

    Gets the view definition's use.

    Returns: The current TUse setting.

    operator[] ( TInt )

    TUid operator[](TIntaIndex)const [inline]

    Gets the field type located at a specified index position within the field type array.

    ParameterDescription
    aIndexThe position of the field type in the array, relative to zero. It must be non-negative and less than the number of objects in the array otherwise the function raises a panic.

    Returns: The field type located at index aIndex within the array (this is equivalent to a TFieldType).