API published in: S60 3rd Ed FP 2
Link against: servicehandler.lib
#include <aiwservicehandler.h>
The Service Handler implements support for dynamically loadable service providers which offer services to consumer applications. The Service Handler maps consumers and service providers together via interests and data agreements and hides the consumers from the providers.
SERVICE is any command or functionality offered by a provider to consumer. The service includes typically menu item UI elements, but it can also just an engine type of command which executes specific functionality and reports status back to the consumer.
CONSUMER application accesses interesting services offered by service provider(s). The consumer uses only those services in which it is interested in. The interest is expressed using a set of criteria items.
INTEREST is a list of criteria items.
CRITERIA consists of set of attributes which guide the AIW Framework to use only those providers in which the consumer is interested in. The criteria consists of following attributes:
PROVIDER produces those services for a consumer that match the given criteria specified by the consumer. A provider can offer menu items and their command handling logic to the consumer applications. A provider can also offer base services that don't require any UI elements.
DATA AGREEMENT is an agreement between consumer and provider about parameters needed to be passed in a use case.
Public Member Functions |
|
virtual IMPORT_C | ~CAiwServiceHandler () |
Destructor. |
|
IMPORT_C void | Reset () |
Resets the Service Handler, discards existing interest and unloads corresponding service providers. |
|
IMPORT_C TInt | NbrOfProviders (const CAiwCriteriaItem *aCriteria) |
Returns the amount of providers that fulfil the given criteria. |
|
IMPORT_C void | AttachL (TInt aInterestResourceId) |
Adds the given interest to the Service Handler from a resource and updates possibly existing old interest. |
|
IMPORT_C void | AttachL (const RCriteriaArray &aInterest) |
Adds given interest to the Service Handler from an array of criteria items. |
|
IMPORT_C void | GetInterest (RCriteriaArray &aInterest) |
Gets the currently valid interest in use by the Service Handler. |
|
IMPORT_C void | DetachL (const RCriteriaArray &aInterest) |
Removes given interest from the Service Handler. |
|
IMPORT_C void | DetachL (TInt aInterestResourceId) |
Removes given interest from the Service Handler. |
|
IMPORT_C const CAiwCriteriaItem * | GetCriteria (TInt aId) |
Returns criteria by ID. |
|
IMPORT_C CAiwGenericParamList & | InParamListL () |
Returns an empty instance of CAiwGenericParamList class. |
|
IMPORT_C CAiwGenericParamList & | OutParamListL () |
Returns an empty instance of CAiwGenericParamList class. |
|
IMPORT_C void | InitializeMenuPaneL (CEikMenuPane &aMenuPane, TInt aMenuResourceId, TInt aBaseMenuCmdId, const CAiwGenericParamList &aInParamList) |
Initialises menu pane with service commands from a provider. |
|
IMPORT_C void | InitializeMenuPaneL (CEikMenuPane &aMenuPane, TInt aMenuResourceId, TInt aBaseMenuCmdId, const CAiwGenericParamList &aInParamList, TBool aUseSubmenuTextsIfAvailable) |
Initialises menu pane with service commands from a provider. |
|
IMPORT_C TInt | ServiceCmdByMenuCmd (TInt aMenuCmdId) const |
Returns the service command ID associated to the menu command. |
|
IMPORT_C void | ExecuteMenuCmdL (TInt aMenuCmdId, const CAiwGenericParamList &aInParamList, CAiwGenericParamList &aOutParamList, TUint aCmdOptions=0, MAiwNotifyCallback *aCallback=NULL) |
Tells the provider to execute a menu command invoked by the consumer. |
|
IMPORT_C void | AttachMenuL (TInt aMenuResourceId, TInt aInterestResourceId) |
Attach menu related criteria items to the given menu. |
|
IMPORT_C void | AttachMenuL (TInt aMenuResourceId, TResourceReader &aReader) |
Attach menu related criteria items to the given menu. |
|
IMPORT_C void | AttachMenuL (TInt aMenuResourceId, const RCriteriaArray &aInterest) |
Attach menu related criteria items to the given menu. |
|
IMPORT_C void | DetachMenu (TInt aMenuResourceId, TInt aInterestResourceId) |
Detach menu related criteria items from the given menu. |
|
IMPORT_C TBool | IsSubMenuEmpty (TInt aSubMenuId) |
Checks if there are menu providers attached to given menu id. |
|
IMPORT_C TBool | IsAiwMenu (TInt aMenuResourceId) |
Returns boolean value indicating whether the given menu contains currently attached placeholders. |
|
IMPORT_C TBool | HandleSubmenuL (CEikMenuPane &aPane) |
Handles AIW submenus. |
|
IMPORT_C void | ExecuteServiceCmdL (const TInt &aCmdId, const CAiwGenericParamList &aInParamList, CAiwGenericParamList &aOutParamList, TUint aCmdOptions=0, MAiwNotifyCallback *aCallback=0) |
Executes a service command for all providers. |
|
Static Public Member Functions |
|
static IMPORT_C CAiwServiceHandler * | NewL () |
Constructs a Service Handler instance. |
|
static IMPORT_C CAiwServiceHandler * | NewLC () |
Constructs a Service Handler instance. |
|
static IMPORT_C void | ReportMenuLaunch () |
CEikMenuPane uses this method to inform AIF framework that a menu is launched. |
|
Destructor. |
|
Adds given interest to the Service Handler from an array of criteria items. If a provider leaves during initialization, it is trapped by the Service Handler.
|
|
Adds the given interest to the Service Handler from a resource and updates possibly existing old interest. Corresponding service providers are loaded. If a provider leaves during initialization, it is trapped by the Service Handler.
|
|
Attach menu related criteria items to the given menu.
|
|
Attach menu related criteria items to the given menu. If a provider leaves during initialization, it is trapped by the Service Handler.
|
|
Attach menu related criteria items to the given menu. If a provider leaves during initialization, it is trapped by the Service Handler.
|
|
Removes given interest from the Service Handler. Corresponding service providers are unloaded.
|
|
Removes given interest from the Service Handler. Corresponding service providers are unloaded.
|
|
Detach menu related criteria items from the given menu. In following cases this method just returns without doing anything: 1. If interest resource id is non-zero and CCoeEnv is not accessible. 2. If interest resource id is non-zero and there occurs an error when reading the interest (e.g. not enough memory).
|
|
Tells the provider to execute a menu command invoked by the consumer. Not supported if calling outside UI framework. Use ServiceCmdByMenuCmd to check if there is any provider for the menu command.
|
|
Executes a service command for all providers. Otherwise similar to ExecuteMenuCmdL.
|
|
Returns criteria by ID.
|
|
Gets the currently valid interest in use by the Service Handler.
|
|
Handles AIW submenus. This method should be called from consumer application's DynInitMenuPaneL.
|
|
Initialises menu pane with service commands from a provider. This method must be called upon DynInitMenuPaneL of consumer application in order to let the provider to hook its menu items. In normal circumstances, the other variant of this method should be used.
|
|
Initialises menu pane with service commands from a provider. This method must be called upon DynInitMenuPaneL of consumer application in order to let the provider to hook its menu items.
|
|
Returns an empty instance of CAiwGenericParamList class. It can be used for example as an input parameter list for the Service Handler's API methods. This is just a convenience method and doesn't have to be used. If consumer wants to create input list by itself it is ok. If this method is used, the Service Handler takes care of deleting returned generic parameter list.
|
|
Returns boolean value indicating whether the given menu contains currently attached placeholders.
|
|
Checks if there are menu providers attached to given menu id. Consumer application can use this information to decide whether a sub menu containing only AIW items should be hidden or not.
|
|
Returns the amount of providers that fulfil the given criteria.
|
|
Constructs a Service Handler instance. |
|
Constructs a Service Handler instance. |
|
Returns an empty instance of CAiwGenericParamList class. The instance can be used for example as an output parameter list for Service Handler API methods. This is just a convenience method and doesn't have to be used. If consumer wants to create output list by itself it is ok. If this method is used, Service Handler takes care of deleting returned generic parameter list.
|
|
CEikMenuPane uses this method to inform AIF framework that a menu is launched. This method does not need to be called by any other component. |
|
Resets the Service Handler, discards existing interest and unloads corresponding service providers. |
|
Returns the service command ID associated to the menu command. If found, it means that there is a provider which can handle the menu command. Thus the command handling needs to be routed to the provider via ExecuteMenuCmdL.
|