MAknSettingCacheUpdatePlugin Class Reference

class MAknSettingCacheUpdatePlugin

Interface for implementing setting cache plugins, provided by AppUi clients. The plugin mechanism offers clients the ability to register themselves with the AppUi, so that client specific settings can be updated when necessary, and so that the plugin can report that a change has occurred to those settings. The plugin can also cache the value of the setting, and report it when requested, although in practice the AppUi would have to know about the setting in order to know what to do with it.

The idea is that there may be a single setting whose current value can in principle be controlled by a number of clients. At any one time, one of those clients has the right to control the actual value of the setting, but each of the other clients may need to listen to other events in order to keep their values up to date. The clients are arranged in a stack, so that the most recently added client overrides the values that are managed by the previously added clients.

The plugins can handle specific event IDs, for example KAknLocalZoomLayoutSwitch. When the setting cache is updated, for example during a layout switch event, the plugins are asked to update their own cached values (in the order of the stack).

The first plugin that claims to handle the event id, and successfully updates, is then asked for its value; however all other plugins will still get a chance to update.

It is possible to de-register from the middle of the stack (although in practice clients should ensure that the stacking corresponds logically to their own application context).

Consult the document S60 AVKON Zoom Design Document for a description of how this API can be used to implement local zoom functionality by handling the KAknLocalZoomLayoutSwitch event id.

avkon.lib
Since
3.1
Public Member Functions
TInt GetValue(TInt, TInt &)
TBool HandlesEvent(TInt)
TBool Update(TInt)

Member Functions Documentation

GetValue(TInt, TInt &)

TInt GetValue(TIntaEventId,
TInt &aValue
)const [pure virtual]

Return the value that is being managed by this plugin for the specified event.

Parameters

TInt aEventIdthe event id
TInt & aValueoutput the value

HandlesEvent(TInt)

TBool HandlesEvent(TIntaEventId)const [pure virtual]

Report whether the plugin handles a given event id. Resgistered plugins are queried in order of most recent registration. Update is only called on the plugin if it claims to handle the event id.

Parameters

TInt aEventIdevent id to be queried

Update(TInt)

TBool Update(TIntaEventId)[pure virtual]

Update the setting cache plugin's cached values, and report whether any values were changed. If this plugin is not the most recently registered plugin (that handles a given event id) the return value will be ignored.

Parameters

TInt aEventIdevent id to be processed