MFepAttributeStorer Class Reference

class MFepAttributeStorer

Protocol for storing, restoring and synchronising FEP attributes.

An abstract base class for CCoeFep, so FEPs must implement the pure virtual functions declared in this class.

Rather than using a single device-wide instance of a FEP, each application has its own instance of the FEP. MFepAttributeStorer provides a framework for synchronising FEP attributes across each running instance of the same FEP. For this to happen, the FEP must implement MFepAttributeStorer::WriteAttributeDataToStreamL() and MFepAttributeStorer::ReadAttributeDataFromStreamL().

Attributes are FEP-specific, and are identified by a UID which can be accessed using AttributeAtIndex(). An example of a FEP attribute might be whether inline editing is enabled or disabled.

Member Functions Documentation

AttributeAtIndex(TInt)

TUid AttributeAtIndex(TIntaIndex)const [pure virtual]

Returns the UID of the FEP attribute at the index specified.

Parameters

TInt aIndexAn array index.

MFepAttributeStorer_Reserved_1()

IMPORT_C voidMFepAttributeStorer_Reserved_1()[private, virtual]

MFepAttributeStorer_Reserved_2()

IMPORT_C voidMFepAttributeStorer_Reserved_2()[private, virtual]

NumberOfAttributes()

TInt NumberOfAttributes()const [pure virtual]

Returns the total number of FEP attributes.

NumberOfOccurrencesOfAttributeUid(TUid)

TInt NumberOfOccurrencesOfAttributeUid(TUidaAttributeUid)const [private]

Parameters

TUid aAttributeUid

ReadAllAttributesL(CCoeEnv &)

IMPORT_C voidReadAllAttributesL(CCoeEnv &aConeEnvironment)

Reads all of the FEP's attributes from the system settings.

Calls the implementation of ReadAttributeDataFromStreamL() for each attribute.

This function has identical behaviour to CCoeFep::ReadAllAttributesL().

Parameters

CCoeEnv & aConeEnvironmentNot used.

ReadAttributeDataFromStreamL(TUid, RReadStream &)

voidReadAttributeDataFromStreamL(TUidaAttributeUid,
RReadStream &aStream
)[pure virtual]

Reads the value of the attribute identified by the UID specified in aAttributeUid from the specified read stream.

You should take appropriate action if the attribute has changed, e.g. if inline editing has been disabled, you might cancel the current transaction.

This function is called by MFepAttributeStorer::ReadAllAttributesL() for all attributes. It is also called when the FEP receives a message that an attribute has been changed by another running instance of the FEP (using WriteAttributeDataAndBroadcastL()).

Parameters

TUid aAttributeUidIdentifies the attribute whose value should be read.
RReadStream & aStreamRead stream from which to read the attribute's value.

WriteAttributeDataAndBroadcastL(CCoeEnv &, TUid)

IMPORT_C voidWriteAttributeDataAndBroadcastL(CCoeEnv &aConeEnvironment,
TUidaAttributeUid
)

Call this function after changing the value of an attribute that needs to be synchronised.

Writes the new value to the system-wide settings and causes all other running instances of the FEP to be notified of the change.

A panic occurs if aAttributeUid is not one of the FEP's attributes.

capability
WriteDeviceData

Parameters

CCoeEnv & aConeEnvironmentThe FEP's control environment.
TUid aAttributeUidThe UID of the attribute whose value has changed.

WriteAttributeDataAndBroadcastL(CCoeEnv &, const TArray< TUid > &)

IMPORT_C voidWriteAttributeDataAndBroadcastL(CCoeEnv &aConeEnvironment,
const TArray< TUid > &aAttributeUids
)

Call this function after changing the value of multiple attributes that need to be synchronised.

Writes the new values to the system settings, and causes all other running instances of the FEP to be notified of the change.

A panic occurs if any of the attributes contained in aAttributeUids are not among the FEP's attributes.

capability
WriteDeviceData To prevent corruption of FEP settings.

Parameters

CCoeEnv & aConeEnvironmentNot used.
const TArray< TUid > & aAttributeUidsArray of UIDs of the attribute whose values have changed.

WriteAttributeDataToStreamL(TUid, RWriteStream &)

voidWriteAttributeDataToStreamL(TUidaAttributeUid,
RWriteStream &aStream
)const [pure virtual]

Writes the value of the attribute specified to the specified write stream.

Called by MFepAttributeStorer::WriteAttributeDataAndBroadcastL() for each attribute passed to it.

Parameters

TUid aAttributeUidUID of the attribute to write to the stream.
RWriteStream & aStreamThe stream to which to write the attribute.