Enabling quick access to functions with a toolbar

To use the Toolbar API, follow the steps below.

  1. Link the AVKON libraries ( avkon.lib , eikcoctl.lib ) to the project file of the application.
  2. Define the toolbar in the application resources. Set it as application or view specific.
  3. Provide a class that implements the toolbar observer ( MAknToolbarObserver ) interface. Set the class as the observer of the toolbar ( CAknToolbar ) created in the previous step.
  4. If the toolbar items were not defined in the resources, add them dynamically in the application code.
  5. In the case of a floating toolbar, set the toolbar visible. (The framework sets the fixed toolbar automatically visible when activating the application/view.)
  6. Handle toolbar events using the observer interface methods.
Figure 1. Fixed toolbar with implementation classes

Implementing a toolbar

To use a toolbar in your application, implement the following use cases:

The following use cases are optional, allowing you to set additional properties for your toolbar:

Implementing a toolbar extension (optional)

To use a toolbar extension in your application, implement the following use cases:

The following use cases are optional, allowing you to set additional properties for your toolbar extension:

Main implementation files

The main implementation files for the Toolbar API are:

  • akntoolbar.h for creating the toolbar and setting its properties

  • akntoolbarobserver.h for handling toolbar events

  • akntoolbarextension.h for creating the toolbar extension and setting its properties