class CContactItemField : public CBase |
A field in a contact item.
Fields are grouped into a field set ( CContactItemFieldSet ), which is owned by the contact item.
The contact item field stores the field data. The data may be text, a date/time value, or an agent, as indicated by the storage type (TStorageType). The storage type is also owned by the field. Note that numeric field data is not supported. All numbers, for instance telephone or fax numbers are stored as text.
Fields also have a content type, attributes and a label. The label is a string which identifies the field to a user e.g. First name, Last name.
The following attributes are supported:
hidden: the field is not displayed if the view definition masks hidden fields
disabled: the field cannot be deleted from the original template and thus is marked as disabled
read only: the field cannot be written to
synchronise: used by Connectivity applications; set by default for all contact item fields
user added: the field was added by the user and was not taken from the template
template: indicates that the field is part of a template. Template fields differ from other fields in that they are persisted when they do not contain any data.
speed dial: the field contains a telephone number which maps to one of the nine possible speed dial positions.
These attributes can be set using member functions of this class, but they are normally set automatically by other functions, for instance when setting a speed dial field, CContactDatabase automatically sets the field's speed dial attribute.
Protected Member Functions | |
---|---|
void | UsesTemplateData ( TInt ) |
Private Member Functions | |
---|---|
CContactItemField () | |
CContactItemField ( TStorageType ) | |
TBool | AddFieldToHint ( TFieldType , CContactItemField::THint &) |
void | CloneL (const CContactItemField &) |
void | ConstructStorageL () |
void | MapHintsToFieldTypesL ( THint ) |
void | RestoreDataL ( CStreamStore &, TStreamId ) |
TStreamId | RestoreHintL ( CStreamStore &, RReadStream &) |
void | RestoreL ( CStreamStore &, RReadStream &) |
void | SetLabelUnspecified ( TBool ) |
TStreamId | StoreAdditionalUidsL ( CStreamStore &, TStreamId , CArrayFixFlat < TUid > *) |
TStreamId | StoreDataL ( CStreamStore &) |
TFieldHeader | StoreL ( RWriteStream &, CStreamStore &, TInt ) |
const CContentType & | TemplateContentType (const CContactItemFieldSet &) |
void | UsesTemplateLabel () |
Private Member Enumerations | |
---|---|
enum |
anonymous
{
EHidden = 0x00000001, EReadOnly = 0x00000002, ESynchronize = 0x00000004, EDisabled = 0x00000008, EUserMask = 0x000000F0, ETemplateMask = EUserMask|ESynchronize|EReadOnly|EHidden, EOverRidesLabel = 0x00000100, EUsesTemplateData = 0x00000200, EUserAddedField = 0x00000400, ETemplate = 0x00000800, ELabelUnspecified = 0x40000000, EDeleted = 0x80000000 } |
enum |
anonymous
{
EPrivate = 0x00000001, ESpeedDial = 0x00000002, EUserDefinedFilter = 0x00000004, EUserDefinedFilter1 = 0x00000008, EUserDefinedFilter2 = 0x00000010, EUserDefinedFilter3 = 0x00000020, EUserDefinedFilter4 = 0x00000040 } |
Private Attributes | |
---|---|
TUint32 | iAttributes |
CContentType * | iContentType |
TUint32 | iExtendedAttributes |
TInt | iId |
HBufC * | iLabel |
CContactFieldStorage * | iStorage |
TStorageType | iStorageType |
TInt | iTemplateFieldId |
CContactItemField | ( | TStorageType | aType | ) | [private] |
TStorageType aType |
IMPORT_C | ~CContactItemField | ( | ) |
Frees all resources owned by the field (the label, the stored data and the content type), prior to its destruction.
TBool | AddFieldToHint | ( | TFieldType | aFieldType, |
CContactItemField::THint & | aHint | |||
) | const [private] |
TFieldType aFieldType | |
CContactItemField::THint & aHint |
IMPORT_C void | AddFieldTypeL | ( | TFieldType | aFieldType | ) |
Appends a field type to the field's content type.
Note that certain combinations of field types are not valid and should not be used.
TFieldType aFieldType | The field type to append to the field's content type. |
IMPORT_C CContactAgentField * | AgentStorage | ( | ) | const |
Gets a pointer to the field's storage as a CContactAgentField .
An agent is a property in a vCard which contains another person's contact details. If the field storage type is not KStorageTypeContactItemId, this function raises a panic.
void | CloneL | ( | const CContactItemField & | aField | ) | [private] |
const CContactItemField & aField |
void | CopyStorageL | ( | const CContactItemField & | aField | ) |
const CContactItemField & aField |
IMPORT_C CContactDateField * | DateTimeStorage | ( | ) | const |
Returns a pointer to the field's storage as a CContactDateField .
If the field storage type is not KStorageTypeDateTime, this function raises a panic.
TBool | DoSynchronize | ( | ) | const [inline] |
Gets the value of the field's synchronise attribute.
void | ExternalizeL | ( | RWriteStream & | aStream | ) | const |
Externalises a CContactItemField object to a write stream.
RWriteStream & aStream | Stream to which the object should be externalised. |
IMPORT_C TBool | HasCustomFilter | ( | EContactFieldFlags & | contactFieldFlag | ) | const |
Determine if a custom filter exists. If it does, return the filter type.
EContactFieldFlags & contactFieldFlag | The custom filter type if one exists. |
TBool | HasExtraStream | ( | ) | const [inline] |
Tests whether the field needs an extra stream to store information not contained in the template. This is the case if the field's content type is not based on a template, or if the field has a label which overrides the label specified in the template.
void | InternalizeL | ( | RReadStream & | aStream | ) |
Internalises a CContactItemField object from a read stream.
RReadStream & aStream | Stream from which the object should be internalised. |
TBool | IsCustomFilterable | ( | ) | const [inline] |
Tests the value of the user defined filter attribute.
TBool | IsTemplate | ( | ) | const [inline] |
Tests whether the field is in a template, as set by SetTemplateField() .
IMPORT_C TBool | IsTemplateLabelField | ( | ) | const |
Tests whether the field is a template label field (a field which holds the label for a contact card template: see class CContactCardTemplate ).
IMPORT_C TBool | IsValidLabel | ( | const TDesC & | aLabel, |
TInt & | aInvalidPos | |||
) | [static] |
Tests whether a field label is valid.
Note: the label is invalid if it contains any of the following characters:
[] (left or right square bracket)
= (equals sign)
. (dot)
: (colon)
, (comma)
TBool | LabelUnspecified | ( | ) | const [inline] |
Tests whether the field's label has been set, either by a call to SetLabel() or by inheriting a label specified in the template.
void | MapHintsToFieldTypesL | ( | THint | aHint | ) | [private] |
THint aHint |
IMPORT_C CContactItemField * | NewL | ( | TStorageType | aType | ) | [static] |
Allocates and constructs a contact item field with a storage type.
The field's label and content type are unspecified.
TStorageType aType | The field's storage type. |
IMPORT_C CContactItemField * | NewL | ( | TStorageType | aType, |
TFieldType | aFieldType | |||
) | [static] |
Allocates and constructs a contact item field with a storage type and a field type.
The field's content type is initialised with the field type, and its vCard mapping is set by default to KNullUid. The field's label is unspecified.
TStorageType aType | The field's storage type. |
TFieldType aFieldType | The field type as defined in cntdef.h. |
IMPORT_C CContactItemField * | NewL | ( | const CContactItemField & | aField | ) | [static] |
Allocates and constructs a contact item field based on another one.
All details (content type, storage type, attributes and label) are copied from the specified field.
const CContactItemField & aField | The contact field to copy. |
IMPORT_C CContactItemField * | NewL | ( | TStorageType | aType, |
const CContentType & | aContentType | |||
) | [static] |
Allocates and constructs a contact item field with a content type and a storage type.
The field's label is unspecified.
TStorageType aType | The field's storage type. |
const CContentType & aContentType | The field's content type. |
IMPORT_C CContactItemField * | NewLC | ( | ) | [static] |
Allocates and constructs a new default contact item field.
The field's storage type, content type and label are unspecified. The ESynchronize attribute is set.
IMPORT_C CContactItemField * | NewLC | ( | TStorageType | aType | ) | [static] |
Allocates and constructs a contact item field with a storage type.
The field's label and content type are unspecified.
TStorageType aType | The field's storage type. |
IMPORT_C CContactItemField * | NewLC | ( | TStorageType | aType, |
TFieldType | aFieldType | |||
) | [static] |
Allocates and constructs a contact item field with a storage type and a field type.
The field's content type is initialised with the field type, and its vCard mapping is set by default to KNullUid. The field's label is unspecified.
TStorageType aType | The field's storage type. |
TFieldType aFieldType | The field type as defined in cntdef.h. |
IMPORT_C CContactItemField * | NewLC | ( | const CContactItemField & | aField | ) | [static] |
Allocates and constructs a contact item field based on another one.
All details (content type, storage type, attributes and label) are copied from the specified field.
const CContactItemField & aField | The contact field to copy. |
IMPORT_C CContactItemField * | NewLC | ( | TStorageType | aType, |
const CContentType & | aContentType | |||
) | [static] |
Allocates and constructs a contact item field with a content type and a storage type.
The field's label is unspecified.
TStorageType aType | The field's storage type. |
const CContentType & aContentType | The field's content type. |
TBool | OverRidesLabel | ( | ) | const [inline] |
Tests whether the field's label (as set by SetLabel() ) overrides the label specified in the field's template.
void | PopulateStoreL | ( | RStoreWriteStream & | aRootStream, |
TInt | aCount, | |||
CArrayFix < TFieldHeader > & | aFieldHeaderArray | |||
) | const |
Part of the system template update implementation. This could be used for a generic update method at a later stage.
RStoreWriteStream & aRootStream | |
TInt aCount | |
CArrayFix < TFieldHeader > & aFieldHeaderArray |
void | PrepareFieldAsTemplateL | ( | CContactItemFieldSet & | aSystemTemplateFieldSet | ) |
CContactItemFieldSet & aSystemTemplateFieldSet |
IMPORT_C void | RemoveFieldType | ( | TFieldType | aFieldType | ) |
Removes a field type from the field's content type.
TFieldType aFieldType | The field type to remove from the field's content type. |
IMPORT_C void | ResetStore | ( | ) |
Resets the field storage. The field's store is deleted, then re-allocated.
void | RestoreDataL | ( | CStreamStore & | aStore, |
TStreamId | aId | |||
) | [private] |
CStreamStore & aStore | |
TStreamId aId |
IMPORT_C TStreamId | RestoreFieldTypesL | ( | RReadStream & | aRootStream, |
const CContactItemFieldSet * | aSystemTemplateFields | |||
) |
Decode given blob header stream into contact field relevent data.
RReadStream & aRootStream | reference to the blob header stream to be decoded. |
const CContactItemFieldSet * aSystemTemplateFields | cached template fields. |
IMPORT_C void | RestoreHeaderL | ( | RReadStream & | aStream, |
const CContactItemFieldSet * | aSystemTemplateFields | |||
) |
RReadStream & aStream | |
const CContactItemFieldSet * aSystemTemplateFields |
TStreamId | RestoreHintL | ( | CStreamStore & | aStore, |
RReadStream & | aStream | |||
) | [private] |
CStreamStore & aStore | |
RReadStream & aStream |
IMPORT_C TBool | RestoreIfMatchL | ( | RReadStream & | aStream, |
const CContactItemFieldDef * | aFieldDef, | |||
const CContactItemFieldSet * | aSystemTemplateFields, | |||
HBufC * | aTextStream, | |||
TInt | aTextIndex | |||
) |
RReadStream & aStream | |
const CContactItemFieldDef * aFieldDef | |
const CContactItemFieldSet * aSystemTemplateFields | |
HBufC * aTextStream | |
TInt aTextIndex |
TBool | RestoreIfMatchL | ( | RReadStream & | aStream, |
TFieldType | aFieldType, | |||
const CContactItemFieldSet * | aSystemTemplateFields, | |||
HBufC * | aTextStream, | |||
TInt | aTextIndex | |||
) |
RReadStream & aStream | |
TFieldType aFieldType | |
const CContactItemFieldSet * aSystemTemplateFields | |
HBufC * aTextStream | |
TInt aTextIndex |
void | RestoreL | ( | CStreamStore & | aStore, |
RReadStream & | aStream | |||
) | [private] |
CStreamStore & aStore | |
RReadStream & aStream |
IMPORT_C void | RestoreTextL | ( | HBufC * | aTextStream, |
TInt | aTextFieldIndex | |||
) |
IMPORT_C void | SetCustomFilterable | ( | EContactFieldFlags | aContactFilterType | ) |
EContactFieldFlags aContactFilterType |
IMPORT_C void | SetDisabled | ( | TBool | aDisabled | ) |
Sets the value of the disabled attribute.
TBool aDisabled | ETrue to set the disabled attribute, EFalse to unset the attribute. |
IMPORT_C void | SetHidden | ( | TBool | aHidden | ) |
Sets the value of the hidden attribute.
If hidden fields are included in the view definition, the field is displayed like other fields. If the view definition masks hidden fields, it is not displayed. See the TMode enumeration defined in class CContactItemViewDef .
TBool aHidden | ETrue for hidden, EFalse for displayed. |
IMPORT_C void | SetId | ( | TInt | aId | ) |
Sets the ID which uniquely identifies a field within a field set..
Note that the field ID value is initialised when the field is added to the field set (using CContactItemFieldSet::AddL() ). It is equivalent to the field's index within the field set array, and should not normally be changed.
TInt aId | The new field ID. |
IMPORT_C void | SetLabel | ( | HBufC * | aLabel | ) |
Sets the field label.
The field takes ownership of aLabel so the function cannot leave.
HBufC * aLabel | The new field label. |
IMPORT_C void | SetLabelL | ( | const TDesC & | aLabel | ) |
Sets the field label.
The label is allocated using TDesC::AllocL() , so the function can leave. Any existing label is replaced.
const TDesC & aLabel | The new field label. |
void | SetLabelUnspecified | ( | TBool | aUnspecified | ) | [private] |
TBool aUnspecified |
IMPORT_C void | SetMapping | ( | TUid | aMapping | ) |
Sets the vCard mapping for the field's content type.
TUid aMapping | The new mapping for the field's content type. |
IMPORT_C void | SetPrivate | ( | TBool | aTemplateField | ) |
Sets the value of the field's private attribute.
This is used by the contact database when exporting a contact item as a vCard, to identify fields which should not be exported.
TBool aTemplateField | ETrue to set the field's private attribute, EFalse to unset it. |
IMPORT_C void | SetReadOnly | ( | TBool | aReadOnly | ) |
Sets the value of the field's read only attribute.
TBool aReadOnly | ETrue to set the field's read only attribute, EFalse to unset the attribute. |
IMPORT_C void | SetSpeedDial | ( | TBool | aSpeedDialField | ) |
Sets the value of the field's speed dial attribute.
TBool aSpeedDialField | ETrue if the field should be a speed dial field, EFalse if not. |
IMPORT_C void | SetSynchronize | ( | TBool | aSynchronize | ) |
Sets the value of the field's synchronise attribute.
TBool aSynchronize | ETrue to set synchronise attribute, EFalse to unset it. |
IMPORT_C void | SetTemplateField | ( | TBool | aTemplateField | ) |
Sets whether the field is a template field.
TBool aTemplateField | ETrue to set the field's Is template attribute. EFalse to unset it. |
IMPORT_C void | SetUserAddedField | ( | TBool | aUserAddedField | ) |
Sets the user added field attribute.
TBool aUserAddedField | ETrue to set the field's user added attribute, EFalse to unset it. |
IMPORT_C void | SetUserFlags | ( | TUint | aFlags | ) |
Sets the value of the user flags.
TUint aFlags | The user flags value. |
void | SetUsesTemplateTypes | ( | TBool | aUsesTemplateTypes | ) |
TBool aUsesTemplateTypes |
IMPORT_C CContactFieldStorage * | Storage | ( | ) | const |
Gets a pointer to the field's base storage.
Rather than using this function and then casting to a specific storage class, one of the following functions should normally be used: TextStorage() , StoreStorage() , AgentStorage() , or DateTimeStorage() .
TStreamId | StoreAdditionalUidsL | ( | CStreamStore & | aStore, |
TStreamId | aId, | |||
CArrayFixFlat < TUid > * | aAdditionalFields | |||
) | [private] |
CStreamStore & aStore | |
TStreamId aId | |
CArrayFixFlat < TUid > * aAdditionalFields |
TStreamId | StoreDataL | ( | CStreamStore & | aStore | ) | [private] |
CStreamStore & aStore |
TFieldHeader | StoreL | ( | RWriteStream & | aTextStream, |
CStreamStore & | aBlobStore, | |||
TInt | aTextFieldIndex | |||
) | [private] |
Encode contact field data into stream store.
RWriteStream & aTextStream | the text blob stream to export text data. |
CStreamStore & aBlobStore | the binary blob stream to export binary data. |
TInt aTextFieldIndex | the index of text field stored in the storage |
IMPORT_C CContactStoreField * | StoreStorage | ( | ) | const |
Gets a pointer to the field's storage as a CContactStoreField .
This indicates the field data is stored in a descriptor or descriptor array. If the field storage type is not KStorageTypeStore, this function raises a panic.
const CContentType & | TemplateContentType | ( | const CContactItemFieldSet & | aSystemTemplateFields | ) | const [private] |
const CContactItemFieldSet & aSystemTemplateFields |
IMPORT_C CContactTextField * | TextStorage | ( | ) | const |
Gets a pointer to the field's storage as a CContactTextField .
If the field's storage type is not KStorageTypeText, this function raises a panic.
void | UpdateFieldFlags | ( | const CContactItemFieldSet & | aTemplateFieldSet | ) |
const CContactItemFieldSet & aTemplateFieldSet |
TBool | UserAddedField | ( | ) | const [inline] |
Gets the value of the user added field attribute.
IMPORT_C TUint | UserFlags | ( | ) | const |
Gets the value of the user flags, as set by SetUserFlags() .
void | UsesTemplateData | ( | TInt | aTemplateFieldId | ) | [protected] |
TInt aTemplateFieldId |
TBool | UsesTemplateTypes | ( | ) | const [inline] |
Tests whether or not the field's content type is based on a template.
EHidden = 0x00000001 | |
EReadOnly = 0x00000002 | |
ESynchronize = 0x00000004 | |
EDisabled = 0x00000008 | |
EUserMask = 0x000000F0 | |
ETemplateMask = EUserMask|ESynchronize|EReadOnly|EHidden | |
EOverRidesLabel = 0x00000100 | |
EUsesTemplateData = 0x00000200 | |
EUserAddedField = 0x00000400 | |
ETemplate = 0x00000800 | |
ELabelUnspecified = 0x40000000 | |
EDeleted = 0x80000000 |
EPrivate = 0x00000001 | |
ESpeedDial = 0x00000002 | |
EUserDefinedFilter = 0x00000004 | |
EUserDefinedFilter1 = 0x00000008 | |
EUserDefinedFilter2 = 0x00000010 | |
EUserDefinedFilter3 = 0x00000020 | |
EUserDefinedFilter4 = 0x00000040 |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.