LibreOffice
LibreOffice 24.2 SDK API Reference
|
provides read/write access to an accelerator configuration set. More...
import"XAcceleratorConfiguration.idl";
Exported Interfaces | |
interface | com::sun::star::ui::XUIConfigurationPersistence |
specifies a persistence interface which supports to load/store accelerator configuration data to a storage and to retrieve information about the current state. More... | |
interface | com::sun::star::ui::XUIConfigurationStorage |
connects this configuration to a new storage which must be used further on subsequent calls of com::sun::star::util::XConfigurationPersistence.load() and com::sun::star::util::XConfigurationPersistence.store(). More... | |
interface | com::sun::star::ui::XUIConfiguration |
supports to notify other implementations about changes of this accelerator configuration. More... | |
Public Member Functions | |
sequence< com::sun::star::awt::KeyEvent > | getAllKeyEvents () |
return the list of all key events, which are available at this configuration set. More... | |
string | getCommandByKeyEvent ([in] com::sun::star::awt::KeyEvent aKeyEvent) raises (com::sun::star::container::NoSuchElementException) |
return the registered command for the specified key event. More... | |
void | setKeyEvent ([in] com::sun::star::awt::KeyEvent aKeyEvent, [in] string sCommand) raises (com::sun::star::lang::IllegalArgumentException, com::sun::star::container::NoSuchElementException) |
modify or create a key - command - binding. More... | |
void | removeKeyEvent ([in] com::sun::star::awt::KeyEvent aKeyEvent) raises (com::sun::star::container::NoSuchElementException) |
remove a key-command-binding from this configuration set. More... | |
sequence< com::sun::star::awt::KeyEvent > | getKeyEventsByCommand ([in] string sCommand) raises (com::sun::star::lang::IllegalArgumentException , com::sun::star::container::NoSuchElementException) |
optimized access to the relation "command-key" instead of "key-command" which is provided normally by this interface. More... | |
sequence< any > | getPreferredKeyEventsForCommandList ([in] sequence< string > lCommandList) raises (com::sun::star::lang::IllegalArgumentException, com::sun::star::container::NoSuchElementException) |
optimized function to map a list of commands to a corresponding list of key events. More... | |
void | removeCommandFromAllKeyEvents ([in] string sCommand) raises (com::sun::star::lang::IllegalArgumentException , com::sun::star::container::NoSuchElementException) |
search for a key-command-binding inside this configuration set, where the specified command is used. More... | |
Public Member Functions inherited from XUIConfigurationPersistence | |
void | reload () raises ( ::com::sun::star::uno::Exception ) |
reloads the configuration data from the storage and reinitialize the user interface configuration manager instance with this data. More... | |
void | store () raises ( ::com::sun::star::uno::Exception ) |
stores the configuration data to the storage provided by setStorage() from the storage and initialize the user interface configuration manager instance with the newly data. More... | |
void | storeToStorage ([in] ::com::sun::star::embed::XStorage Storage) raises ( ::com::sun::star::uno::Exception ) |
stores the configuration data to the provided storage, ignoring the previously set storage by setStorage(). More... | |
boolean | isModified () |
provides the current modify state of the configuration manager instance. More... | |
boolean | isReadOnly () |
provides the current read-only state of the user configuration manager. More... | |
Public Member Functions inherited from XInterface | |
any | queryInterface ([in] type aType) |
queries for a new interface to an existing UNO object. More... | |
void | acquire () |
increases the reference counter by one. More... | |
void | release () |
decreases the reference counter by one. More... | |
Public Member Functions inherited from XUIConfigurationStorage | |
void | setStorage ([in] ::com::sun::star::embed::XStorage Storage) |
connects a storage to the user interface configuration manager which is used on subsequent calls of load() and store(). More... | |
boolean | hasStorage () |
checks if an instance has already a storage to load/store its data. More... | |
Public Member Functions inherited from XUIConfiguration | |
void | addConfigurationListener ([in] ::com::sun::star::ui::XUIConfigurationListener Listener) |
adds the specified listener to receive events when elements are changed, inserted or removed. More... | |
void | removeConfigurationListener ([in] ::com::sun::star::ui::XUIConfigurationListener Listener) |
removes the specified listener so it does not receive any events from this user interface configuration manager. More... | |
provides read/write access to an accelerator configuration set.
Such configuration set base on:
Note further:
All changes you made on this configuration access modify the configuration set inside memory only. You have to use the com::sun::star::util::XFlushable interface (which must be available at the same implementation object too), to make it persistent.
interface com::sun::star::ui::XUIConfiguration |
supports to notify other implementations about changes of this accelerator configuration.
specifies a persistence interface which supports to load/store accelerator configuration data to a storage and to retrieve information about the current state.
connects this configuration to a new storage which must be used further on subsequent calls of com::sun::star::util::XConfigurationPersistence.load() and com::sun::star::util::XConfigurationPersistence.store().
sequence< com::sun::star::awt::KeyEvent > getAllKeyEvents | ( | ) |
return the list of all key events, which are available at this configuration set.
The key events are the "primary keys" of this configuration sets. Means: Commands are registered for key events.
Such key event can be mapped to its bound command, using the method getCommandForKeyEvent().
string getCommandByKeyEvent | ( | [in] com::sun::star::awt::KeyEvent | aKeyEvent | ) | |
raises | ( | com::sun::star::container::NoSuchElementException | |||
) |
return the registered command for the specified key event.
This function can be used to:
aKeyEvent | the key event, where the registered command is searched for. |
com::sun::star::container::NoSuchElementException | if the key event is an invalid one or does not exists inside this configuration set. |
sequence< com::sun::star::awt::KeyEvent > getKeyEventsByCommand | ( | [in] string | sCommand | ) | |
raises | ( | com::sun::star::lang::IllegalArgumentException , | |||
com::sun::star::container::NoSuchElementException | |||||
) |
optimized access to the relation "command-key" instead of "key-command" which is provided normally by this interface.
It can be used to implement collision handling, if more than one key event match to the same command. The returned list contains all possible key events - and the outside code can select a possible one. Of course - mostly this list will contain only one key event ...
sCommand | the command, where key bindings are searched for. |
com::sun::star::lang::IllegalArgumentException | if the specified command is empty. It can't be checked, if a command is valid - because every URL schema can be used here. |
com::sun::star::container::NoSuchElementException | if the specified command isn't empty but does not occur inside this configuration set. |
sequence< any > getPreferredKeyEventsForCommandList | ( | [in] sequence< string > | lCommandList | ) | |
raises | ( | com::sun::star::lang::IllegalArgumentException, | |||
com::sun::star::container::NoSuchElementException | |||||
) |
optimized function to map a list of commands to a corresponding list of key events.
It provides a fast mapping, which is e.g. needed by a menu or toolbar implementation. E.g. a sub menu is described by a list of commands - and the implementation of the menu must show the corresponding shortcuts. Iteration over all items of this configuration set can be very expensive.
Instead to the method getKeyEventsForCommand() the returned list contains only one(!) key event bound to one(!) requested command. If more than one key event is bound to a command - a selection is done inside this method. This internal selection can't be influenced from outside.
lCommandList | a list of commands |
com::sun::star::lang::IllegalArgumentException | if at least one of the specified commands is empty. It can't be checked, if a command is valid - because every URL schema can be used here. |
void removeCommandFromAllKeyEvents | ( | [in] string | sCommand | ) | |
raises | ( | com::sun::star::lang::IllegalArgumentException , | |||
com::sun::star::container::NoSuchElementException | |||||
) |
search for a key-command-binding inside this configuration set, where the specified command is used.
If such binding could be located, the command will be removed from it. If as result of that the key binding will be empty, if will be removed too.
This is an optimized method, which can perform removing of commands from this configuration set. Because normally Commands are "foreign keys" and key identifier the "primary keys" - it needs some work to remove all commands outside this container ...
sCommand | the command, which should be removed from any key binding. |
com::sun::star::lang::IllegalArgumentException | if the specified command is empty. |
com::sun::star::container::NoSuchElementException | if the specified command isn't used inside this configuration set. |
void removeKeyEvent | ( | [in] com::sun::star::awt::KeyEvent | aKeyEvent | ) | |
raises | ( | com::sun::star::container::NoSuchElementException | |||
) |
remove a key-command-binding from this configuration set.
aKeyEvent | the key event, which should be removed. |
com::sun::star::container::NoSuchElementException | if the key event does not exists inside this configuration set. |
void setKeyEvent | ( | [in] com::sun::star::awt::KeyEvent | aKeyEvent, |
[in] string | sCommand | ||
) | |||
raises | ( | com::sun::star::lang::IllegalArgumentException, | |
com::sun::star::container::NoSuchElementException | |||
) |
modify or create a key - command - binding.
If the specified key event does not already exists inside this configuration access, it will be created and the command will be registered for it.
If the specified key event already exists, its command will be overwritten with the new command. There is no warning nor any error about that! The outside code has to use the method getCommandForKeyEvent() to check for possible collisions.
Note: This method can't be used to remove entities from the configuration set. Empty parameters will result into an exception! Use the method removeKeyEvent() instead.
aKeyEvent | specify the key event, which must be updated or new created. |
sCommand | the new command for the specified key event. |
com::sun::star::lang::IllegalArgumentException | if the key event isn't a valid one. Commands can be checked only, if they are empty. Because every URL schema can be used by commands in general, so it's not possible to validate it. |