EPOC   SDK Home Glossary Indexes Previous Next Up

CContactItemViewDef class


Contents


CContactItemViewDef class — View definition for a contact item

Section Contents


Overview

Compatibility

Applications that use this class will not work correctly on a version of EPOC earlier than ER5.

Derivation

CBase

Abstract: CBase behaviour.

Defined in

cntdb.h

Link against

cntmodel.lib

Description

When reading or opening a contact item using the CContactDatabase class, a view definition for the item 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.


Allocation and construction


NewL() — Allocate and construct

static CContactItemViewDef* NewL(TUse aUse, TMode aMode);

static CContactItemViewDef* NewLC(TUse aUse, TMode aMode);

Description

Use these functions to allocate and construct a new CContactItemViewDef, specifying a use and a mode.

If the new view definition is successfully constructed, NewLC() leaves it on the cleanup stack.

Arguments

TUse aUse

Specifies whether to include or exclude specified fields.

TMode aMode

Specifies whether to include or exclude hidden fields.

Return value

CContactItemViewDef*

Pointer to the newly created view definition.


Index operator


operator[] — Index operator [ ]

TUid operator[](TInt aIndex) const;

Description

Use this operator to return the field type located at position aIndex within the field type array.

Arguments

TInt aIndex

The position of the field type element within the array.

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

TUid

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


Search


Find() — Search for field type using content type

TInt Find(const CContentType& aContentType) const;

Description

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

Arguments

const CContentType& aContentType

Content type containing field types to find.

Return value

TInt

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


Find() — Search for field type

TInt Find(TFieldType aFieldType) const;

Description

Searches the current view definition for the specified field type.

Arguments

TFieldType aFieldType

The field type to find.

Return value

TInt

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


Field type enquiry


Count() — Get field type count

TInt Count() const;

Description

Retrieves the number of field types in the current view definition.

Return value

TInt

The number of field types in the CContactItemViewDef.


MatchesAll() — Are all fields matched ?

TBool MatchesAll() const;

Description

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.

Return value

TBool

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


Add / remove field types


AddL() — Add a field type

void AddL(TFieldType aFieldType);

Description

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

Arguments

TFieldType aFieldType

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


Remove() — Remove a field type

void Remove(TFieldType aFieldType);

Description

Removes a field type, identified by its field type UID.

Arguments

TFieldType aFieldType

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


Remove() — Remove a field type

void Remove(TInt aIndex);

Description

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

Arguments

TInt aIndex

The 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() — Delete all field types

void Reset();

Description

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


Use and mode


Use() — Get the use

TUse Use() const;

Description

Returns the view definition's TUse setting.

Return value

TUse

The current TUse setting.


SetUse() — Set the use

void SetUse(TUse aUse);

Description

Sets the view definition's TUse setting.

Arguments

TUse aUse

The new TUse setting.


Mode() — Get the mode

TMode Mode() const;

Description

Returns the view definition's TMode setting.

Return value

TMode

The current TMode setting.


SetMode() — Set the mode

void SetMode(TMode aMode);

Description

Sets the view definition's TMode setting.

Arguments

TMode aMode

The new TMode setting.


Enumerations


TUse enum — Include or exclude specified fields

EIncludeFields

Include specified fields in the view.

EMaskFields

Exclude specified fields from the view.


TMode enumInclude or exclude hidden fields

EIncludeHiddenFields

Include hidden fields in the view.

EMaskHiddenFields

Exclude hidden fields from the view.

EPOC       SDK Home Glossary Indexes Previous Next Up