class CLiwServiceHandler : public CBase |
CLiwServiceHandler is the main class of the Language Interworking Framework. 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 UID (we can allocate pre-defined criteria items).
Service command UID (we can allocate pre-defined commands).
Content MIME type (string).
Additional options (variant data type just in case).
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.
Private Member Functions | |
---|---|
CLiwServiceHandler () | |
void | ConstructL () |
Private Attributes | |
---|---|
CLiwServiceHandlerImpl * | iImpl |
IMPORT_C void | AttachL | ( | TInt | aInterestResourceId | ) |
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.
TInt aInterestResourceId | ID of the resource containing criteria items. |
IMPORT_C TInt | AttachL | ( | const RCriteriaArray & | aInterest | ) |
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.
const RCriteriaArray & aInterest | Array of criteria items. Ownership is not transferred. |
IMPORT_C TInt | AttachL | ( | const RCriteriaArray & | aInterest, |
CRTSecMgrScriptSession & | aSecMgrScriptSession | |||
) |
const RCriteriaArray & aInterest | |
CRTSecMgrScriptSession & aSecMgrScriptSession |
IMPORT_C void | AttachMenuL | ( | TInt | aMenuResourceId, |
TInt | aInterestResourceId | |||
) |
Attach menu related criteria items to the given menu. If a provider leaves during initialization, it is trapped by the Service Handler.
IMPORT_C void | AttachMenuL | ( | TInt | aMenuResourceId, |
TResourceReader & | aReader | |||
) |
Attach menu related criteria items to the given menu. If a provider leaves during initialization, it is trapped by the Service Handler.
TInt aMenuResourceId | Menu to be attached. |
TResourceReader & aReader | Resource reader for the interest list. |
IMPORT_C void | AttachMenuL | ( | TInt | aMenuResourceId, |
const RCriteriaArray & | aInterest | |||
) |
Attach menu related criteria items to the given menu.
TInt aMenuResourceId | Menu to be attached. |
const RCriteriaArray & aInterest | Array of criteria items. Ownership is not transferred. |
IMPORT_C void | AttachMenuL | ( | RArray < TInt > & | aMenuEntries, |
TInt | aMenuResourceId, | |||
RCriteriaArray & | aInterest | |||
) |
Attach menu related criteria items to the given menu.
RArray < TInt > & aMenuEntries | List of menu command ids, ids not related to interests may be set to 0. |
TInt aMenuResourceId | Menu to be attached. |
RCriteriaArray & aInterest | Interest list. |
IMPORT_C void | DetachL | ( | const RCriteriaArray & | aInterest | ) |
Removes given interest from the Service Handler. Corresponding service providers are unloaded.
const RCriteriaArray & aInterest | Array of returned criteria items, may be empty. |
IMPORT_C void | DetachL | ( | TInt | aInterestResourceId | ) |
Removes given interest from the Service Handler. Corresponding service providers are unloaded.
TInt aInterestResourceId | ID of the resource containing criteria items. |
IMPORT_C void | DetachMenu | ( | TInt | aMenuResourceId, |
TInt | aInterestResourceId | |||
) |
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).
IMPORT_C void | ExecuteMenuCmdL | ( | TInt | aMenuCmdId, |
const CLiwGenericParamList & | aInParamList, | |||
CLiwGenericParamList & | aOutParamList, | |||
TUint | aCmdOptions = 0, | |||
MLiwNotifyCallback * | aCallback = NULL | |||
) |
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.
TInt aMenuCmdId | The menu command to be executed. |
const CLiwGenericParamList & aInParamList | Input data parameters, can be an empty list. |
CLiwGenericParamList & aOutParamList | Output data parameters, can be an empty list. |
TUint aCmdOptions = 0 | Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
MLiwNotifyCallback * aCallback = NULL | Callback for asynchronous command handling, parameter checking, etc. |
IMPORT_C void | ExecuteServiceCmdL | ( | const TInt & | aCmdId, |
const CLiwGenericParamList & | aInParamList, | |||
CLiwGenericParamList & | aOutParamList, | |||
TUint | aCmdOptions = 0, | |||
MLiwNotifyCallback * | aCallback = 0 | |||
) |
Executes a service command for all providers. Otherwise similar to ExecuteMenuCmdL.
const TInt & aCmdId | The command to be executed. |
const CLiwGenericParamList & aInParamList | Input data parameters, can be an empty list. |
CLiwGenericParamList & aOutParamList | Output data parameters, can be an empty list. |
TUint aCmdOptions = 0 | Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
MLiwNotifyCallback * aCallback = 0 | Callback for asynchronous command handling, parameter checking, etc. |
IMPORT_C void | ExecuteServiceCmdL | ( | const CLiwCriteriaItem & | aCmd, |
const CLiwGenericParamList & | aInParamList, | |||
CLiwGenericParamList & | aOutParamList, | |||
TUint | aCmdOptions = 0, | |||
MLiwNotifyCallback * | aCallback = 0 | |||
) |
Executes a service command.
const CLiwCriteriaItem & aCmd | The criteria item containing the service command and content type |
const CLiwGenericParamList & aInParamList | Input data parameters, can be an empty list. |
CLiwGenericParamList & aOutParamList | Output data parameters, can be an empty list. |
TUint aCmdOptions = 0 | Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
MLiwNotifyCallback * aCallback = 0 | Callback for asynchronous command handling, parameter checking, etc. |
IMPORT_C const CLiwCriteriaItem * | GetCriteria | ( | TInt | aId | ) |
Returns criteria by ID.
TInt aId | Criteria ID. |
IMPORT_C void | GetInterest | ( | RCriteriaArray & | aInterest | ) |
Gets the currently valid interest in use by the Service Handler.
RCriteriaArray & aInterest | An array of returned criteria items, may be empty. Ownership is not transferred, i.e. the objects in the array must not be deleted. |
IMPORT_C TBool | HandleSubmenuL | ( | CEikMenuPane & | aPane | ) |
Handles LIW submenus. This method should be called from consumer application's DynInitMenuPaneL.
CEikMenuPane & aPane | Menu pane to be handled. |
IMPORT_C CLiwGenericParamList & | InParamListL | ( | ) |
Returns an empty instance of CLiwGenericParamList 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.
IMPORT_C void | InitializeMenuPaneL | ( | CEikMenuPane & | aMenuPane, |
TInt | aMenuResourceId, | |||
TInt | aBaseMenuCmdId, | |||
const CLiwGenericParamList & | aInParamList | |||
) |
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.
CEikMenuPane & aMenuPane | Handle of the menu pane to initialise. |
TInt aMenuResourceId | The menu to be attached. |
TInt aBaseMenuCmdId | Base ID for the Service Handler to generate menu IDs for placeholders. |
const CLiwGenericParamList & aInParamList | Input parameter list for provider's parameters checking. |
IMPORT_C void | InitializeMenuPaneL | ( | CEikMenuPane & | aMenuPane, |
TInt | aMenuResourceId, | |||
TInt | aBaseMenuCmdId, | |||
const CLiwGenericParamList & | aInParamList, | |||
TBool | aUseSubmenuTextsIfAvailable | |||
) |
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.
CEikMenuPane & aMenuPane | Handle of the menu pane to initialise. |
TInt aMenuResourceId | The menu to be attached. |
TInt aBaseMenuCmdId | Base ID for the Service Handler to generate menu IDs for placeholders. |
const CLiwGenericParamList & aInParamList | Input parameter list for provider's parameters checking. |
TBool aUseSubmenuTextsIfAvailable | If the provider has specified alternative submenu texts for its menu items, those can be taken into use if this parameter is set to ETrue. This should be used only for manually created submenus. If using LIW_CASCADE_ID or LIW_INTELLIGENT_CASCADE_ID, the LIW framework can automatically decide whether to use the submenu texts or not, and this parameter has no effect. |
IMPORT_C TBool | IsLiwMenu | ( | TInt | aMenuResourceId | ) |
Returns boolean value indicating whether the given menu contains currently attached placeholders.
TInt aMenuResourceId | Resource id of the menu to be queried. |
IMPORT_C TBool | IsSubMenuEmpty | ( | TInt | aSubMenuId | ) |
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 LIW items should be hidden or not.
TInt aSubMenuId | The menu id to be checked. |
IMPORT_C TInt | MenuCmdId | ( | TInt | aMenuCmdId | ) | const |
Gets provider command ID by dynamic command ID.
TInt aMenuCmdId | The consumer's menu command ID generated by LIW framework. This can be get e.g. from consumer's HandleCommandL(). |
IMPORT_C TInt | NbrOfProviders | ( | const CLiwCriteriaItem * | aCriteria | ) |
Returns the amount of providers that fulfil the given criteria.
const CLiwCriteriaItem * aCriteria | Criteria to match. |
IMPORT_C CLiwGenericParamList & | OutParamListL | ( | ) |
Returns an empty instance of CLiwGenericParamList 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.
IMPORT_C void | QueryImplementationL | ( | RCriteriaArray & | aFilterItem, |
RCriteriaArray & | aProviderList | |||
) |
Lists available service implementations
RCriteriaArray & aFilterItem | |
RCriteriaArray & aProviderList |
IMPORT_C void | ReportMenuLaunch | ( | ) | [static] |
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.
IMPORT_C void | Reset | ( | ) |
Resets the Service Handler, discards existing interest and unloads corresponding service providers.
IMPORT_C TInt | ServiceCmdByMenuCmd | ( | TInt | aMenuCmdId | ) | const |
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.
TInt aMenuCmdId | Menu command ID to be mapped to service cmd, KNullServiceCmd is returned if no service command exists. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.