![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Section Contents
Applications that use this class will not work correctly on a version of EPOC earlier than ER5.
CBase |
Abstract: CBase behaviour. |
cntfield.h
cntmodel.lib
A single field in a contact item. Fields are owned by the contact item and are stored in a field set (class CContactItemFieldSet).
A contact item field has a storage type (TStorageType) which indicates what kind of field it is. The storage type can have one of the following values, defined in cntdef.hrh
:
Fields also have a content type, attributes and a label.
The following attributes are supported:
static CContactItemField* NewL(TStorageType aType);
static CContactItemField* NewLC(TStorageType aType);
Creates a new CContactItemField with the storage type specified.
The field's label and content type are left unspecified.
If the new contact item field is successfully constructed, NewLC() leaves it on the cleanup stack.
TStorageType aType |
The field's storage type. |
CContactItemField* |
Pointer to the newly created contact item field. |
If the aType parameter has an invalid value, the function leaves with KErrNotSupported.
static CContactItemField* NewL(TStorageType aType, TFieldType aFieldType);
static CContactItemField* NewLC(TStorageType aType, TFieldType aFieldType);
Creates a new CContactItemField with the storage type specified. The field's content type is initialised with the specified field type, and its vCard mapping is set by default to KNullUid.
The field's label is left unspecified.
If the new contact item field is successfully constructed, NewLC() leaves it on the cleanup stack.
TStorageType aType |
The field's storage type. |
TFieldType aFieldType |
The field type. Field types are defined in |
CContactItemField* |
Pointer to the newly created contact item field. |
static CContactItemField* NewL(const CContactItemField& aField);
static CContactItemField* NewLC(const CContactItemField& aField);
Creates a new CContactItemField copying all details (content type, storage type, attributes and label) from the specified field.
If the new contact item field is successfully constructed, NewLC() leaves it on the cleanup stack.
const CContactItemField& aField |
The contact field to copy. |
CContactItemField* |
Pointer to the newly created contact item field. |
static CContactItemField* NewL(TStorageType aType, const CContentType& aContentType);
static CContactItemField* NewLC(TStorageType aType, const CContentType& aContentType);
Creates a new CContactItemField with the specified content type and storage type.
The field's label is left unspecified.
If the new contact item field is successfully constructed, NewLC() leaves it on the cleanup stack.
TStorageType aType |
The field's storage type. |
const CContentType& aContentType |
The field's content type. |
CContactItemField* |
Pointer to the newly created contact item field. |
TStorageType StorageType() const;
Retrieves the field's storage type.
TStorageType |
The field's storage type. |
CContactFieldStorage* Storage() const;
Retrieves 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 almost always be used: TextStorage(), StoreStorage(), AgentStorage(), or DateTimeStorage().
CContactFieldStorage* |
The field's base storage type. |
CContactTextField* TextStorage() const;
Returns a pointer to the field's storage as a CContactTextField*. If the field storage type is not KStorageTypeText, this function raises a panic.
CContactTextField* |
Field's storage as a CContactTextField*. |
CContactStoreField* StoreStorage() const;
Returns a pointer to the field's storage as a CContactStoreField*. This indicates generic field data. If the field storage type is not KStorageTypeStore, this function raises a panic.
CContactStoreField* |
Field's storage as a CContactStoreField*. |
CContactAgentField* AgentStorage() const;
Returns a pointer to the field's storage as a CContactAgentField*. An agent is a property in a vCard. If the field storage type is not KStorageTypeContactItemId, this function raises a panic.
CContactAgentField* |
Field's storage as a CContactAgentField*. |
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.
CContactDateField* |
Field's storage as a CContactDateField*. |
const CContentType& ContentType() const;
Returns the field's content type.
CContentType& |
Reference to the field's content type. |
void AddFieldTypeL(TFieldType aFieldType);
Append a field type to the field's content type.
TFieldType aFieldType |
The field type to append to the field's content type. |
void RemoveFieldType(TFieldType aFieldType);
Remove a field type from the field's content type.
TFieldType aFieldType |
The field type to remove from the field's content type. |
void SetMapping(TUid aMapping);
Set the vCard mapping for the field's content type.
TUid aMapping |
The new mapping for the field's content type. |
void SetHidden(TBool aHidden);
Set the status of the hidden attribute.
If hidden fields are included in the view definition, they are displayed like other fields. If the view definition masks hidden fields, hidden fields are not displayed. See the TMode enumeration defined in class CContactItemViewDef.
TBool aHidden |
ETrue for hidden, EFalse for displayed. |
TBool IsHidden() const;
Returns the field's hidden attribute.
TBool |
ETrue if hidden attribute set, EFalse if not set. |
void SetReadOnly(TBool aReadOnly);
Set the status of the field's read only attribute.
TBool aReadOnly |
ETrue to set the field's read only attribute, EFalse to unset the attribute. |
TBool IsReadOnly() const;
Returns the field's read only attribute.
TBool |
ETrue if read only attribute set, EFalse if not set. |
void SetSynchronize(TBool aSynchronize);
Set the status of the field's synchronize attribute.
TBool aSynchronize |
ETrue to set synchronize attribute, EFalse to unset it. |
TBool DoSynchronize() const;
Retrieves the status of the field's synchronize attribute.
TBool |
ETrue if synchronize attribute set, EFalse if not set. |
void SetDisabled(TBool aDisabled);
Set the status of the disabled attribute.
TBool aDisabled |
ETrue to set the disabled attribute, EFalse to unset the attribute. |
TBool IsDisabled() const;
Retrieves the field's disabled attribute.
TBool |
ETrue if disabled attribute set, EFalse if disabled attribute not set. |
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. |
TBool UserAddedField() const;
Retrieves the value of the user added field attribute.
TBool |
ETrue if the user added attribute is set, EFalse if not. |
void SetLabelL(const TDesC& aLabel);
Sets the field label. This function allocates the label (using TDesC::AllocL()) and can leave. Any existing label is first deleted.
const TDesC& aLabel |
The new field label. |
void SetLabel(HBufC* aLabel);
Sets the field label. The CContactItemField takes ownership of aLabel and this function cannot leave.
HBufC* aLabel |
The new field label. |
TPtrC Label() const;
Returns the field label.
TPtrC |
The field label. If no label has been set, is of zero length. |
static TBool IsValidLabel(const TDesC& aLabel,TInt& aInvalidPos);
Tests whether a field label is valid.
const TDesC& aLabel |
The field label to test. |
TInt& aInvalidPos |
On return, contains the character position within the label of the first invalid character. The first character position is zero. |
TBool |
ETrue if valid, EFalse if invalid. |
The label is invalid if it contains any of the following characters:
TUint UserFlags() const;
Retrieves the value of the user flags, as set by SetUserFlags().
The user flags value. |
void SetUserFlags(TUint aFlags);
Sets the value of the user flags.
TUint aFlags |
The user flags value. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |