|
||
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.
CBase
- Base class for all classes to be instantiated on the heap
CContactItemField
- A field in a contact item
Defined in CContactItemField
:
AddFieldTypeL()
Appends a field type to the field's content typeAgentStorage()
Gets a pointer to the field's storage as a CContactAgentFieldContentType()
Gets the field's content typeDateTimeStorage()
Returns a pointer to the field's storage as a CContactDateFieldDoSynchronize()
Gets the value of the field's synchronise attributeHasExtraStream()
Tests whether the field needs an extra stream to store information not contained in the templateId()
Gets the field IDIsCustomFilterable()
Tests the value of the user defined filter attributeIsDeleted()
Gets the value of the field's deleted attributeIsDisabled()
Gets the value of the field's disabled attributeIsHidden()
Gets the value of the field's hidden attributeIsPrivate()
Tests whether the field's private attribute is setIsReadOnly()
Gets the value of the field's read only attributeIsSpeedDial()
Tests whether the field is a speed dial fieldIsTemplate()
Tests whether the field is in a template, as set by SetTemplateField()IsTemplateLabelField()
Tests whether the field is a template label field (a field which holds the label for a contact card template: see class CContactCardTemplate)IsValidLabel()
Tests whether a field label is validLabel()
Gets the field's labelLabelUnspecified()
Tests whether the field's label has been set, either by a call to SetLabel() or by inheriting a label specified in the templateNewL()
Allocates and constructs a contact item field with a storage typeNewL()
Allocates and constructs a contact item field with a storage type and a field typeNewL()
Allocates and constructs a contact item field based on another oneNewL()
Allocates and constructs a contact item field with a content type and a storage typeNewLC()
Allocates and constructs a new default contact item fieldNewLC()
Allocates and constructs a contact item field with a storage typeNewLC()
Allocates and constructs a contact item field with a storage type and a field typeNewLC()
Allocates and constructs a contact item field based on another oneNewLC()
Allocates and constructs a contact item field with a content type and a storage typeOverRidesLabel()
Tests whether the field's label (as set by SetLabel()) overrides the label specified in the field's templateRemoveFieldType()
Removes a field type from the field's content typeResetStore()
Resets the field storageRestoreHeaderL()
SetDisabled()
Sets the value of the disabled attributeSetHidden()
Sets the value of the hidden attributeSetHintType()
SetId()
Sets the ID which uniquely identifies a field within a field set..SetLabel()
Sets the field labelSetLabelL()
Sets the field labelSetMapping()
Sets the vCard mapping for the field's content typeSetPrivate()
Sets the value of the field's private attributeSetReadOnly()
Sets the value of the field's read only attributeSetSpeedDial()
Sets the value of the field's speed dial attributeSetSynchronize()
Sets the value of the field's synchronise attributeSetTemplateField()
Sets whether the field is a template fieldSetUserAddedField()
Sets the user added field attributeSetUserFlags()
Sets the value of the user flagsStorage()
Gets a pointer to the field's base storageStorageType()
Gets the field's storage typeStoreStorage()
Gets a pointer to the field's storage as a CContactStoreFieldTextStorage()
Gets a pointer to the field's storage as a CContactTextFieldUserAddedField()
Gets the value of the user added field attributeUserFlags()
Gets the value of the user flags, as set by SetUserFlags()UsesTemplateTypes()
Tests whether or not the field's content type is based on a template~CContactItemField()
Frees all resources owned by the field (the label, the stored data and the content type), prior to its destructionInherited from CBase
:
Delete()
Deletes the specified objectExtension_()
Extension functionoperator new()
Initialises the object to binary zeroesstatic IMPORT_C CContactItemField *NewLC();
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.
|
static IMPORT_C CContactItemField *NewL(TStorageType aType);
Allocates and constructs a contact item field with a storage type.
The field's label and content type are unspecified.
|
|
static IMPORT_C CContactItemField *NewLC(TStorageType aType);
Allocates and constructs a contact item field with a storage type.
The field's label and content type are unspecified.
|
|
static IMPORT_C CContactItemField *NewL(TStorageType aType, TFieldType aFieldType);
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.
|
|
static IMPORT_C CContactItemField *NewLC(TStorageType aType, TFieldType aFieldType);
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.
|
|
static IMPORT_C CContactItemField *NewL(const CContactItemField &aField);
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.
|
|
static IMPORT_C CContactItemField *NewLC(const CContactItemField &aField);
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.
|
|
static IMPORT_C CContactItemField *NewL(TStorageType aType, const CContentType &aContentType);
Allocates and constructs a contact item field with a content type and a storage type.
The field's label is unspecified.
|
|
static IMPORT_C CContactItemField *NewLC(TStorageType aType, const CContentType &aContentType);
Allocates and constructs a contact item field with a content type and a storage type.
The field's label is unspecified.
|
|
IMPORT_C ~CContactItemField();
Frees all resources owned by the field (the label, the stored data and the content type), prior to its destruction.
IMPORT_C TStorageType StorageType() const;
Gets the field's storage type.
|
IMPORT_C const CContentType &ContentType() const;
Gets the field's content type.
|
inline TBool IsHidden() const;
Gets the value of the field's hidden attribute.
|
inline TBool IsReadOnly() const;
Gets the value of the field's read only attribute.
|
inline TBool IsDisabled() const;
Gets the value of the field's disabled attribute.
|
inline TBool IsTemplate() const;
Tests whether the field is in a template, as set by SetTemplateField()
.
|
inline TBool IsPrivate() const;
Tests whether the field's private attribute is set.
|
inline TBool IsSpeedDial() const;
Tests whether the field is a speed dial field.
|
inline TBool DoSynchronize() const;
Gets the value of the field's synchronise attribute.
|
inline TBool OverRidesLabel() const;
Tests whether the field's label (as set by SetLabel()
) overrides the label specified in the field's template.
|
inline TBool HasExtraStream() const;
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.
|
inline TBool UsesTemplateTypes() const;
Tests whether or not the field's content type is based on a template.
|
inline TBool LabelUnspecified() const;
Tests whether the field's label has been set, either by a call to SetLabel()
or by inheriting a label specified in the template.
|
inline TBool UserAddedField() const;
Gets the value of the user added field attribute.
|
inline TBool IsCustomFilterable() const;
Tests the value of the user defined filter attribute.
|
IMPORT_C TPtrC Label() const;
Gets the field's label.
|
IMPORT_C void ResetStore();
Resets the field storage. The field's store is deleted, then re-allocated.
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()
.
|
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.
|
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.
|
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.
|
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.
|
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.
|
IMPORT_C void RemoveFieldType(TFieldType aFieldType);
Removes a field type from the field's content type.
|
IMPORT_C void SetMapping(TUid aMapping);
Sets the vCard mapping for the field's content type.
|
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
.
|
IMPORT_C void SetReadOnly(TBool aReadOnly);
Sets the value of the field's read only attribute.
|
IMPORT_C void SetSynchronize(TBool aSynchronize);
Sets the value of the field's synchronise attribute.
|
IMPORT_C void SetDisabled(TBool aDisabled);
Sets the value of the disabled attribute.
|
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.
|
IMPORT_C void SetLabel(HBufC *aLabel);
Sets the field label.
The field takes ownership of aLabel so the function cannot leave.
|
IMPORT_C void SetUserAddedField(TBool aUserAddedField);
Sets the user added field attribute.
|
IMPORT_C void SetTemplateField(TBool aTemplateField);
Sets whether the field is a template field.
|
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.
|
IMPORT_C void SetSpeedDial(TBool aSpeedDialField);
Sets the value of the field's speed dial attribute.
|
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.
|
IMPORT_C TUint UserFlags() const;
Gets the value of the user flags, as set by SetUserFlags()
.
|
IMPORT_C void SetUserFlags(TUint aFlags);
Sets the value of the user flags.
|
static IMPORT_C TBool IsValidLabel(const TDesC &aLabel, TInt &aInvalidPos);
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)
|
|
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 void RestoreHeaderL(RReadStream &aStream, const CContactItemFieldSet *aSystemTemplateFields);
|
inline TBool IsDeleted() const;
Gets the value of the field's deleted attribute.
|