Enabling the open applications menu option

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:

Implementing the ability to switch the open applications menu from the Options menu on and off

To switch the 'show open applications' menu option on or off:

  1. 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:

  2. 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.

  3. Make sure you have the correct capabilities information set for your application, depending on your application you need at least None.

Related S60 APIs and classes