Difference between revisions of "Framework/Tutorial/Accelerators"

From Apache OpenOffice Wiki
Jump to: navigation, search
(How to access the different accelerator layers)
(How to access the different accelerator layers)
Line 35: Line 35:
  
 
[[image:Access_to_Accelerator_Managers.png]]
 
[[image:Access_to_Accelerator_Managers.png]]
 +
 +
=== Global Accelerator Manager ===
 +
 +
The global accelerator manager can be directly created by using the OpenOffice.org service manager. The service name of the global accelerator manager is called <idl>com.sun.star.ui.GlobalAcceleratorManager</idl>. This service provides just one interface where accelerators can be retrieved, changes and removed.
 +
 +
=== Module Accelerator Manager ===
 +
 +
A module accelerator manager must be created via the one-instance service service <idl>com.sun.star.ui.ModuleUIConfigurationManagerSupplier</idl>. This service provides access to the module specific ui configuration managers via the method
 +
 +
 +
=== Document Accelerator Manager ===

Revision as of 14:36, 5 November 2008

This tutorial will give you a detailed step-by-step insight into accelerators in OpenOffice.org. Everybody is invited to participate. May be someone wants to translate the extension to a different language (e.g. Java or Python) or wants to have more information about a specific topic. You can set a link to this page, if you think that this page adds valuable information.

The reader of this tutorial should know the following

   * Programming with UNO
   * C++/Java knowledge (Using C++/Java with the SDK)
   * How to create an extension with the "OpenOffice.org SDK"

General abstract of the OpenOffice.org accelerator concept

Accelerator architecture

Architecture - Accelerators.png

OpenOffice.org accelerators are available and stored on three different layers which have a pre-defined priority. The layers are:

Priority of the different accelerator layers
1. Document based accelerators
2. Module based accelerators
3. Global based accelerators

If a user presses a possible keyboard shorcut the framework implementation starts to check every layer (using the pre-defined order document, module, global) for a matching entry. If there is match the associated command URL is used to find a dispatch object where the command can be executed. If no matching entry has been found the current application module is asked to process the keyboard event.

How to access the different accelerator layers

Access to Accelerator Managers.png

Global Accelerator Manager

The global accelerator manager can be directly created by using the OpenOffice.org service manager. The service name of the global accelerator manager is called com.sun.star.ui.GlobalAcceleratorManager. This service provides just one interface where accelerators can be retrieved, changes and removed.

Module Accelerator Manager

A module accelerator manager must be created via the one-instance service service com.sun.star.ui.ModuleUIConfigurationManagerSupplier. This service provides access to the module specific ui configuration managers via the method


Document Accelerator Manager

Personal tools