This section describes what you need to do to attach your help application to the AIW framework.
Note: For more information on how to create context sensitive help files, see the Context-sensitive help compiler GUI guide in the Symbian OS Library.
To attach a help application to a AIW framework:
Use the Help AIW Provider to construct your application. See the code snippet below for an example of how to do this.
Create the required resource file declarations. For more information, see Managing resource files.
Attach the application to the AIW framework.
The service handler instance is then initialized. After this,
a help menu is attached to the service handler instance with the AttachMenuL method,
using the interest (R_AIWCONSUMERBASICS_MENUINTEREST
in the
code snippet) and the menu pane (R_AIWCONSUMERBASICS_MENU
in
the code snippet) as parameters, both of which are defined in a resource file.
Note: When the Service Handler instance exists, the consumer application's
interest must be attached to it before AIW service commands can be executed.
Attaching usually needs to be done only once, and a good place for it is the
consumer application's ConstructL()
method.
In the below code snippet, the UI controller is first initialized and the view object is created. For more information about UI controllers, see UI controller.
void CAIWConsumerBasicsAppUi::ConstructL() { // Initialise app UI with standard value. BaseConstructL(); // Create view object iAppView = CAIWConsumerBasicsAppView::NewL( ClientRect(), *this ); AddToStackL( iAppView ); // Create service handler instance. iServiceHandler = CAiwServiceHandler::NewL(); // Attach call UI menu service interest to AIW framework. iServiceHandler->AttachMenuL(R_AIWCONSUMERBASICS_MENU, R_AIWCONSUMERBASICS_MENUINTEREST) ; }
Note: Where you attach your help application depends on the UI architecture solution you are using:
Make sure ServiceHandler.lib
is
accessible to your linker when compiling your application by including it
in your mmp file or by editing the project properties in your IDE, depending
on your build environment.
Initialize the menu and handle the commands. For more information, see Commands. If the "Help" command is selected, a parameter list is built (see below code snippet) to pass common types of parameters (the UID and the context name of the help in this case) to the AIW provider.
void CAIWConsumerBasicsAppUi::HandleCommandL( TInt aCommand ) { switch( aCommand ) { case EEikCmdExit: case EAknSoftkeyExit: Exit(); break; default: { // Check first that we really want to execute KAiwCmdHelp. By this // way we can set up the generic param list only if necessary. TInt aiwCmd = iServiceHandler->ServiceCmdByMenuCmd( aCommand ); if ( aiwCmd == KAiwCmdHelp ) { // First set up help context parameters. CAiwGenericParamList& inParamList = SetupGenericParamListL(); // Execute AIW service command. iServiceHandler->ExecuteMenuCmdL( aCommand, inParamList, iServiceHandler->OutParamListL()); } break; } } }
Figure: Menu option origins
The above figure shows the origin of each menu option function, when
the application is constructed using the above code snippets. You can find
the original AIWConsumerBasics example application in the SDK at <
SDK installation directory>\S60Ex\AIWConsumerBasics
.
Note: The "Show open applications" menu option comes directly from the Symbian OS. Thus, when your application is attached to the AIW framework, you cannot control the menu option's text , icon, or position in the menu.
Note: The consumer application uses the following APIs in order to use Help through AIW.
The S60 platform provides the following AIW APIs:
The AIW Service Handler API offers access to the Service Handler, which manages the relationship between consumers of AIW services and providers of AIW services.
The AIW Criteria API allows you to pass information about the desired services to the AIW framework, including where and how the services should be bound to your application.
The AIW Generic Parameter API allows you to transfer data to providers of AIW services and to receive data from those providers. The generic parameters are used for transferring data between AIW consumers and providers and are a pair of semantic id and variant values.