![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Section Contents
Applications that use this class will not work correctly on a version of EPOC earlier than ER5.
CBase |
Abstract: CBase behaviour. |
cntitem.h
cntmodel.lib
This class represents a field set. It owns an array of contact item fields (CContactItemFields). An instance of this class is owned by a contact item, and this can be retrieved using CContactItem::CardFields(). Use functions provided by class CContactItem to add and remove fields to/from the field set.
A field set can contain more than one field of the same type, but this is not advisable as it may cause problems, for example if the contacts database is synchronized with a PC scheduler.
static CContactItemFieldSet* NewL();
static CContactItemFieldSet* NewLC();
Use these functions to allocate and construct a new field set.
If the new field set is successfully constructed, NewLC() leaves it on the cleanup stack.
CContactItemFieldSet* |
Pointer to the newly created field set. |
TStreamId StoreL(CStreamStore& aStore);
Store the field set to a stream store.
CStreamStore& aStore |
Stream store to which the field set is written. |
TStreamId |
The ID of the stream store. |
void RestoreL(CStreamStore& aStore, TStreamId anId,const CContactItemViewDef& aViewDef);
Restore the field set using a view definition.
CStreamStore& aStore |
Store from which to restore the field set. |
TStreamId anId |
ID of the stream store containing the field set. |
const CContactItemViewDef& aViewDef |
The view definition to use. |
TInt Find(TFieldType aFieldType) const;
Find the first field in the field set containing the specified field type.
TFieldType aFieldType |
The field type of interest. |
TInt |
If found, the index of the field within the field set, or KErrNotFound if not found. |
TInt FindNext(TFieldType aFieldType,TInt aStartPos=KContactFieldSetSearchAll) const;
Find the next field in the field set containing the specified field type.
TFieldType aFieldType |
The field type of interest. |
TInt aStartPos=KContactFieldSetSearchAll |
The index within the field set array at which to start the search. By default set to KContactFieldSetSearchAll, to find the first field. Must be a valid array index, or the function raises a panic. |
TInt |
If found, the index of the field within the field set, or KErrNotFound if not found. |
TInt Find(TFieldType aFieldType,TUid aMapping) const;
Find the first field in the field set containing both the content type mapping and the field type specified.
TFieldType aFieldType |
The field type of interest. |
TUid aMapping |
The content type mapping of interest. |
TInt |
If found, the index of the field within the field set, or KErrNotFound if not found. |
TInt FindNext(TFieldType aFieldType,TUid aMapping,TInt aStartPos=KContactFieldSetSearchAll) const;
Find the next field in the field set containing both the content type mapping and the field type specified.
TFieldType aFieldType |
The field type of interest. |
TUid aMapping |
The content type mapping of interest. |
TInt aStartPos=KContactFieldSetSearchAll |
The index within the array at which to start the search. By default set to KContactFieldSetSearchAll, to find the first field. Must be a valid array index, or the function raises a panic. |
TInt |
If found, the index of the field within the field set, or KErrNotFound if not found. |
CContactItemFieldSet& AddL(CContactItemField& aField);
Append a field to the field set. The field set takes ownership of the field.
CContactItemField& aField |
Reference to the field to add to the field set. The field ID is updated by this function. |
CContactItemFieldSet& |
Reference to the current field set. |
void Remove(TInt aIndex);
Remove a field from the field set.
TInt aIndex |
The index of the field to delete. Must be a valid index within the field set, or a panic occurs. |
void InsertL(TInt aIndex,CContactItemField& aField);
Insert a field into the field set.
TInt aIndex |
The position in the field set at which to insert the field. If equal to or greater than the number of elements in the field set, the field is appended to the field set. |
CContactItemField& aField |
Reference to the field to add to the field set. The field ID is updated by this function. |
void Reset();
Delete all fields in the field set.
void Move(TInt aFrom, TInt aTo);
Change a field's position within the field set.
Both indexes specified must be valid (i.e. between zero and Count()1 inclusive), or the function raises a panic.
TInt aFrom |
The index of the field to move. |
TInt aTo |
The index of the new position within the field set. |
const CContactItemField& operator[](TInt aIndex) const;
CContactItemField& operator[](TInt aIndex);
Use these operators to retrieve the field located at position aIndex within the field set.
The compiler chooses the appropriate operator variant depending on the context of the call.
TInt aIndex |
The position of the field within the field set. 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. |
CContactItemField& |
Reference to the field located at position aIndex within the array. |
const CContactItemField& |
A reference to a const element in the array; the element cannot be changed through this reference. |
TInt Count() const;
Retrieve the number of fields in the field set.
TInt |
The number of fields in the field set. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |