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 |
TBool | AddFieldToHint | ( | TFieldType | aFieldType, |
CContactItemField::THint & | aHint | |||
) | const [private] |
TFieldType aFieldType | |
CContactItemField::THint & aHint |
IMPORT_C void | AddFieldTypeL | ( | TFieldType | aFieldType | ) |
TFieldType aFieldType |
void | CloneL | ( | const CContactItemField & | aField | ) | [private] |
const CContactItemField & aField |
void | CopyStorageL | ( | const CContactItemField & | aField | ) |
const CContactItemField & aField |
TBool | DoSynchronize | ( | ) | const [inline] |
Gets the value of the field's synchronise attribute.
ETrue if synchronise attribute is set, EFalse if not set.
void | ExternalizeL | ( | RWriteStream & | aStream | ) | const |
RWriteStream & aStream |
IMPORT_C TBool | HasCustomFilter | ( | EContactFieldFlags & | contactFieldFlag | ) | const |
EContactFieldFlags & contactFieldFlag |
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.
True if the field uses an extra stream; false if not.
TBool | IsCustomFilterable | ( | ) | const [inline] |
Tests the value of the user defined filter attribute.
ETrue if the user defined filter attribute is set, EFalse if not.
TBool | IsDeleted | ( | ) | const [inline] |
Gets the value of the field's deleted attribute.
ETrue if the field is deleted, otherwise EFalse.
TBool | IsDisabled | ( | ) | const [inline] |
Gets the value of the field's disabled attribute.
ETrue if disabled attribute set, EFalse if not set.
TBool | IsHidden | ( | ) | const [inline] |
Gets the value of the field's hidden attribute.
ETrue if hidden attribute is set, EFalse if not set.
TBool | IsPrivate | ( | ) | const [inline] |
Tests whether the field's private attribute is set.
True if the field's private attribute is set, false if not.
TBool | IsReadOnly | ( | ) | const [inline] |
Gets the value of the field's read only attribute.
ETrue if read only attribute set, EFalse if not set.
TBool | IsSpeedDial | ( | ) | const [inline] |
Tests whether the field is a speed dial field.
True if the field is a speed dial field, false if not.
TBool | IsTemplate | ( | ) | const [inline] |
Tests whether the field is in a template, as set by SetTemplateField().
ETrue if field is a template field. EFalse if not.
IMPORT_C TBool | IsValidLabel | ( | const TDesC & | aLabel, |
TInt & | aInvalidPos | |||
) | [static] |
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.
True if the field's label has been set, false if not.
IMPORT_C CContactItemField * | NewL | ( | TStorageType | aType | ) | [static] |
TStorageType aType |
IMPORT_C CContactItemField * | NewL | ( | TStorageType | aType, |
TFieldType | aFieldType | |||
) | [static] |
TStorageType aType | |
TFieldType aFieldType |
IMPORT_C CContactItemField * | NewL | ( | const CContactItemField & | aField | ) | [static] |
const CContactItemField & aField |
IMPORT_C CContactItemField * | NewL | ( | TStorageType | aType, |
const CContentType & | aContentType | |||
) | [static] |
TStorageType aType | |
const CContentType & aContentType |
IMPORT_C CContactItemField * | NewLC | ( | TStorageType | aType | ) | [static] |
TStorageType aType |
IMPORT_C CContactItemField * | NewLC | ( | TStorageType | aType, |
TFieldType | aFieldType | |||
) | [static] |
TStorageType aType | |
TFieldType aFieldType |
IMPORT_C CContactItemField * | NewLC | ( | const CContactItemField & | aField | ) | [static] |
const CContactItemField & aField |
IMPORT_C CContactItemField * | NewLC | ( | TStorageType | aType, |
const CContentType & | aContentType | |||
) | [static] |
TStorageType aType | |
const CContentType & aContentType |
TBool | OverRidesLabel | ( | ) | const [inline] |
Tests whether the field's label (as set by SetLabel()) overrides the label specified in the field's template.
True if the field's label overrides the label specified in the template; false if not.
void | PopulateStoreL | ( | RStoreWriteStream & | aRootStream, |
TInt | aCount, | |||
CArrayFix< TFieldHeader > & | aFieldHeaderArray | |||
) | const |
RStoreWriteStream & aRootStream | |
TInt aCount | |
CArrayFix< TFieldHeader > & aFieldHeaderArray |
void | PrepareFieldAsTemplateL | ( | CContactItemFieldSet & | aSystemTemplateFieldSet | ) |
CContactItemFieldSet & aSystemTemplateFieldSet |
IMPORT_C void | RemoveFieldType | ( | TFieldType | aFieldType | ) |
TFieldType aFieldType |
void | RestoreDataL | ( | CStreamStore & | aStore, |
TStreamId | aId | |||
) | [private] |
CStreamStore & aStore | |
TStreamId aId |
IMPORT_C TStreamId | RestoreFieldTypesL | ( | RReadStream & | aRootStream, |
const CContactItemFieldSet * | aSystemTemplateFields | |||
) |
RReadStream & aRootStream | |
const CContactItemFieldSet * aSystemTemplateFields |
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 | SetCustomFilterable | ( | EContactFieldFlags | aContactFilterType | ) |
EContactFieldFlags aContactFilterType |
void | SetLabelUnspecified | ( | TBool | aUnspecified | ) | [private] |
TBool aUnspecified |
IMPORT_C void | SetTemplateField | ( | TBool | aTemplateField | ) |
TBool aTemplateField |
IMPORT_C void | SetUserAddedField | ( | TBool | aUserAddedField | ) |
TBool aUserAddedField |
void | SetUsesTemplateTypes | ( | TBool | aUsesTemplateTypes | ) |
TBool aUsesTemplateTypes |
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] |
RWriteStream & aTextStream | |
CStreamStore & aBlobStore | |
TInt aTextFieldIndex |
const CContentType & | TemplateContentType | ( | const CContactItemFieldSet & | aSystemTemplateFields | ) | const [private] |
const CContactItemFieldSet & aSystemTemplateFields |
void | UpdateFieldFlags | ( | const CContactItemFieldSet & | aTemplateFieldSet | ) |
const CContactItemFieldSet & aTemplateFieldSet |
TBool | UserAddedField | ( | ) | const [inline] |
Gets the value of the user added field attribute.
ETrue if the user added attribute is set, EFalse if not.
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.
True if the field's content type is based on a template; false if not.
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 |