#include <app/cntfield.h>
class CContactItemField : public CBase, public CBase |
Protected Member Functions | |
---|---|
void | UsesTemplateData(TInt) |
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.
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 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.
Parameters | |
---|---|
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.
IMPORT_C const CContentType & | ContentType | ( | ) | const |
Gets the field's content type.
void | CopyStorageL | ( | 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.
Parameters | |
---|---|
aStream | Stream to which the object should be externalised. |
IMPORT_C void | GetFieldText | ( | TDes & | aText | ) | const |
IMPORT_C TBool | HasCustomFilter | ( | EContactFieldFlags & | contactFieldFlag | ) | const |
Determine if a custom filter exists. If it does, return the filter type.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aStream | Stream from which the object should be internalised. |
TBool | IsCustomFilterable | ( | ) | const [inline] |
Tests the value of the user defined filter attribute.
TBool | IsDeleted | ( | ) | const [inline] |
Gets the value of the field's deleted attribute.
TBool | IsDisabled | ( | ) | const [inline] |
Gets the value of the field's disabled attribute.
TBool | IsHidden | ( | ) | const [inline] |
Gets the value of the field's hidden attribute.
TBool | IsPrivate | ( | ) | const [inline] |
Tests whether the field's private attribute is set.
TBool | IsReadOnly | ( | ) | const [inline] |
Gets the value of the field's read only attribute.
TBool | IsSpeedDial | ( | ) | const [inline] |
Tests whether the field is a speed dial field.
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).
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)
Parameters | |
---|---|
aLabel | The field label to test. |
aInvalidPos | On return, contains the character position within the label of the first invalid character. The first character position is zero. |
IMPORT_C TPtrC | Label | ( | ) | const |
Gets the field's label.
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.
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aType | The field's storage type. |
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aType | The field's storage type. |
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aType | The field's storage type. |
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aType | The field's storage type. |
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.
void | PrepareFieldAsTemplateL | ( | CContactItemFieldSet & | aSystemTemplateFieldSet | ) |
IMPORT_C void | RemoveFieldType | ( | TFieldType | aFieldType | ) |
Removes a field type from the field's content type.
Parameters | |
---|---|
aFieldType | The field type to remove from the field's content type. |
IMPORT_C void | Reset | ( | ) |
IMPORT_C void | ResetStore | ( | ) |
Resets the field storage. The field's store is deleted, then re-allocated.
IMPORT_C TStreamId | RestoreFieldTypesL | ( | RReadStream & | aRootStream, |
const CContactItemFieldSet * | aSystemTemplateFields | |||
) |
Decode given blob header stream into contact field relevent data.
Parameters | |
---|---|
aRootStream | reference to the blob header stream to be decoded. |
aSystemTemplateFields | cached template fields. |
IMPORT_C void | RestoreHeaderL | ( | RReadStream & | aStream, |
const CContactItemFieldSet * | aSystemTemplateFields | |||
) |
IMPORT_C TBool | RestoreIfMatchL | ( | 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 | |||
) |
IMPORT_C void | SetCustomFilterable | ( | EContactFieldFlags | aContactFilterType | ) |
void | SetDeleted | ( | TBool | aDeleted | ) |
IMPORT_C void | SetDisabled | ( | TBool | aDisabled | ) |
Sets the value of the disabled attribute.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aHidden | ETrue for hidden, EFalse for displayed. |
IMPORT_C void | SetHintType | ( | TInt | aType | ) |
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aLabel | The new field label. |
IMPORT_C void | SetMapping | ( | TUid | aMapping | ) |
Sets the vCard mapping for the field's content type.
Parameters | |
---|---|
aMapping | The new mapping for the field's content type. |
void | SetOverRidesLabel | ( | TBool | aValue | ) |
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aSynchronize | ETrue to set synchronise attribute, EFalse to unset it. |
IMPORT_C void | SetTemplateField | ( | TBool | aTemplateField | ) |
Sets whether the field is a template field.
Parameters | |
---|---|
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aFlags | The user flags value. |
void | SetUsesTemplateTypes | ( | 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().
IMPORT_C TStorageType | StorageType | ( | ) | const |
Gets the field's storage type.
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.
TInt | TemplateFieldId | ( | ) | const |
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 | ) |
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().