CContactItemFieldSet Class Reference
Link against: cntmodel.lib
class CContactItemFieldSet : public CBase |
Public Member Functions |
---|
| ~CContactItemFieldSet() |
IMPORT_C CContactItemFieldSet & | AddL(CContactItemField &) |
CArrayFix< TFieldHeader > * | ConstructFieldHeaderArrayLC(RWriteStream &, CStreamStore &) |
TBool
| ContainsFieldTypeMapping(const CContentType &, const TFieldType &) |
TInt
| Count() |
void | ExternalizeL(RWriteStream &) |
TInt
| FieldText(TFieldType, TDes &, TInt) |
TInt
| FieldTypeCount(const CContactItemFieldSet &, TInt, const CContactItemField &) |
TInt
| Find(TFieldType) |
TInt
| Find(TFieldType, TUid) |
IMPORT_C TInt | FindNext(TFieldType, TInt) |
IMPORT_C TInt | FindNext(TFieldType, TUid, TInt) |
IMPORT_C void | InsertL(TInt, CContactItemField &) |
void | InternalizeL(RReadStream &) |
IMPORT_C void | Move(TInt, TInt) |
IMPORT_C CContactItemFieldSet * | NewL() |
IMPORT_C CContactItemFieldSet * | NewLC() |
IMPORT_C void | Remove(TInt) |
void | Reset() |
IMPORT_C void | RestoreL(CStreamStore &, TStreamId, CStreamStore *, const CContactItemViewDef &, RReadStream &) |
IMPORT_C void | RestoreL(CStreamStore &, TStreamId, CStreamStore *, const CContactItemViewDef &, const CContactItem *, HBufC *) |
IMPORT_C TStreamId | StoreL(CStreamStore &, RWriteStream &, CStreamStore &) |
TStreamId
| StoreL(CStreamStore &, RWriteStream &, CStreamStore &, CContactTables *) |
IMPORT_C void | UpdateFieldL(const CContactItemField &, TInt) |
IMPORT_C void | UpdateFieldSyncL(const CContactItemField &, TInt) |
const CContactItemField & | operator[](TInt) |
CContactItemField & | operator[](TInt) |
Detailed Description
A contact item's field set. The field set owns an array of contact item fields (CContactItemFields). The field set is owned by a contact item, and can be retrieved using CContactItem::CardFields(). Use functions in 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 when synchronising the contacts database.
Constructor & Destructor Documentation
~CContactItemFieldSet ( )
IMPORT_C | ~CContactItemFieldSet | ( | ) | |
The destructor frees all resources owned by the field set, prior to its destruction.
Member Function Documentation
AddL ( CContactItemField & )
Appends a field to the field set. The field set takes ownership of the field.
Parameter | Description | aField | Reference to the field to add to the field set. The field's ID is updated. |
Returns: Reference to the current field set.
ConstructFieldHeaderArrayLC ( RWriteStream &, CStreamStore & )
Part of the system template update implementation. This could be used for a generic update method at a later stage.
- Since
- 7.0
ContainsFieldTypeMapping ( const CContentType &, const TFieldType & )
Count ( )
TInt
| Count | ( | ) | const [inline] |
Gets the number of fields in the field set.
Returns: The number of fields in the field set.
ExternalizeL ( RWriteStream & )
Parameter | Description | aStream | Stream to which the object should be externalised. |
FieldText ( TFieldType, TDes &, TInt )
FieldTypeCount ( const CContactItemFieldSet &, TInt, const CContactItemField & )
Find ( TFieldType )
Finds the first field in the field set with the specified field type.
Parameter | Description | aFieldType | The field type of interest. |
Returns: If found, the index of the field within the field set, or KErrNotFound if not found.
Find ( TFieldType, TUid )
Finds the first field in the field set containing both the content type mapping and the field type specified.
Parameter | Description | aFieldType | The field type of interest. |
aMapping | The content type mapping of interest. |
Returns: If found, the index of the field within the field set, or KErrNotFound if not found.
FindNext ( TFieldType, TInt )
Finds the next field in the field set with the specified field type.
Parameter | Description | aFieldType | The field type of interest. |
aStartPos | 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. |
Returns: If found, the index of the field within the field set, or KErrNotFound if not found.
FindNext ( TFieldType, TUid, TInt )
Finds the next field in the field set containing both the content type mapping and the field type specified.
Parameter | Description | aFieldType | The field type of interest. |
aMapping | The content type mapping of interest. |
aStartPos | 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. |
Returns: If found, the index of the field within the field set, or KErrNotFound if not found.
InsertL ( TInt, CContactItemField & )
Inserts a field into the field set.
Parameter | Description | 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. |
aField | Reference to the field to add to the field set. The field's ID is updated. |
InternalizeL ( RReadStream & )
Parameter | Description | aStream | Stream from which the object should be internalised. |
Move ( TInt, TInt )
Changes 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.
Parameter | Description | aFrom | The index of the field to move. |
aTo | The index of the new position within the field set. |
NewL ( )
Allocates and constructs a new field set.
Returns: Pointer to the newly created field set.
NewLC ( )
Allocates and constructs a new field set.
Returns: Pointer to the newly created field set. This is left on the cleanup stack.
Remove ( TInt )
IMPORT_C void | Remove | ( | TInt | aIndex | ) | |
Removes a field from the field set.
Parameter | Description | aIndex | The index of the field to delete. Must be a valid index within the field set or the function raises a panic. |
Reset ( )
Deletes all fields in the field set.
RestoreL ( CStreamStore &, TStreamId, CStreamStore *, const CContactItemViewDef &, RReadStream & )
Restores the field set using a view definition.
Parameter | Description | aStore | Store from which to restore the field set. |
anId | The root stream ID of aStore. |
aBlobStore | If specified, the stream store from which data stored in non-text fields is read. |
aViewDef | The view definition to use. |
aReadStream | Read stream from which data stored in text fields (with a storage type of KStorageTypeText) is read. |
RestoreL ( CStreamStore &, TStreamId, CStreamStore *, const CContactItemViewDef &, const CContactItem *, HBufC * )
The overload that doesn't use dangerous CContactItemFieldSet::LoadTextStreamLC(aReadStream) method. LoadTextStreamLC relies on the stream to know its size, but now all types of streams support this functionality. In order to avoid calling LoadTextStreamLC, aTextBuf is already loaded in HBufC in the caller function. The caller function had access to the table and can use ColLength() API to get the lebgth of the field.
StoreL ( CStreamStore &, RWriteStream &, CStreamStore & )
Stores the field set to a stream store.
Parameter | Description | aStore | Stream store to which the field set is written. |
aTextStream | Stream to which data stored in text fields (with a storage type of KStorageTypeText) is written. |
aBlobStore | Stream store to which data stored in non-text fields is written. |
Returns: The ID of the stream store.
StoreL ( CStreamStore &, RWriteStream &, CStreamStore &, CContactTables * )
UpdateFieldL ( const CContactItemField &, TInt )
Updates a field in the field set. The field whose content type matches aField's content type is replaced by aField. The second parameter is used to identify which matching field is updated. Specify 1 to update the first matching field, 2 for the second and so on. If there is no field in the field set which matches aField's content type, then aField is appended to the field set.
Parameter | Description | aField | The new field information. |
aMatchCount | Identifies which matching field in the field set should be updated. |
UpdateFieldSyncL ( const CContactItemField &, TInt )
Updates a field in the field set. Searches the set for a matching field. Deletes the matching set's field if any. Adds the aField to the set anyway. Uses the IsEqualForSyncUpdate() function to compare two CContentType objects, rather than the default equals operator. Takes care to hold the PREF, VoiceDial, and SpeedDial properties in the updated field.
Parameter | Description | aField | Specifies both the type of the field to update and the updated field's value. |
aMatchCount | Gives the offset of the matching field to update in the order of the set (i.e. 1, means update the first matching field in the set; 2, means update the second matching field in the set). |
operator[] ( TInt )
Gets the field located at a specified position in the field set.
Parameter | Description | aIndex | The position of the field in the field set. This is relative to zero. It must be non-negative and less than the number of objects in the array, otherwise the operator raises a panic. |
Returns: A const reference to an element in the array.
operator[] ( TInt )
Gets the field located at a specified position in the field set.
Parameter | Description | aIndex | The position of the field in the field set. This is relative to zero. It must be non-negative and less than the number of objects in the array, otherwise the operator raises a panic. |
Returns: A non-const reference to an element in the array.