You can use the Options Menu API to enable users to switch to other open applications through the options menu. This option is included in the Option menu by default through the 'show open applications' menu option. When mobile device users select this option, the "open applications" view opens. You can also use the Options Menu API to remove the option from the menu.
The use case is:
Switching the "show open applications" menu option in the options menu on and off
Note: If the application key’s functionality has been disabled, the “Show open applications” menu option will be turned off.
Important design considerations include:
To switch the 'show open applications' menu option on or off:
Use the methods of the Options Menu API to construct your application.
In CEikMenuBar
header file, there's an enum
related
to the new menu option, as shown in below code snippet:
enum TMenuType { EMenuOptions = 0, EMenuContext = 1, EMenuEdit = 2, EMenuOptionsNoTaskSwapper = 3 }
The CEikMenuBar::SetMenuType (TMenuType aMenuType)
method
can be used to manipulate this value. If the value is set as EMenuOptions
,
option menu will turn on the "show open applications" item. If set as EMenuOptionsNoTaskSwapper
,
the option is turned off. The instance of CEikMenuBar
, that
switches the menu option, can be accessed from anywhere. You can get the instance
of CEikMenuBar
by any available approach.
See the below code snippet on how to turn the menu option on or off. The default setting is "on".
CEikMenuBar* menuBar = STATIC_CAST( MEikAppUiFactory*, CEikonEnv::Static()->AppUiFactory() )->MenuBar(); // Turn on menuBar->SetMenuType(CEikMenuBar::EMenuOptions); // Turn off menuBar->SetMenuType(CEikMenuBar::EMenuOptionsNoTaskSwapper);
For information on some detailed uses of the API, see the Options Menu API Usage section for:
CEikMenuBar::SetMenuType()
Make sure eikcoctl.lib
and eikcore.lib
are
accessible to your linker when compiling your application by including them
in your mmp file or by editing the project properties in your IDE, depending
on your build environment.
Make sure you have the correct capabilities information set for your application, depending on your application you need at least None.
Menu bars are constructed from MENU_BAR
resources and
issue application commands which should be handled by overriding CEikAppUi::HandleCommandL().
An environment for creating controls and utility functions for manipulating them.