Public Member Functions |
virtual ActionContainer * | actionContainer (const QString &id) const =0 |
| Access function for menus and menu bars.
|
virtual Core::Observer * | actionContainerObserver ()=0 |
| Returns the observer managing action containers.
|
virtual Command * | command (const QString &id) const =0 |
| Access function for actions and shortcuts.
|
virtual QWidget * | commandEditor ()=0 |
| Creates the command editor/shortcut configuration page.
|
virtual Core::Observer * | commandObserver ()=0 |
| Returns the observer managing commands.
|
virtual QList< Command * > | commandsWithKeySequence (QKeySequence key_sequence)=0 |
| Returns commands that uses a specific shortcut mapping.
|
virtual ActionContainer * | createMenu (const QString &id, bool &existed)=0 |
| Creates a menu with the given string ID.
|
virtual ActionContainer * | createMenuBar (const QString &id, bool &existed)=0 |
| Creates a menu bar with the given string ID.
|
virtual bool | loadShortcutMapping (const QString &file_name)=0 |
| Imports a previously exported shortcut configuration.
|
virtual ActionContainer * | menu (const QString &id)=0 |
| Function to access a menu.
|
virtual ActionContainer * | menuBar (const QString &id)=0 |
| Function to access a menu bar.
|
virtual Command * | registerAction (const QString &id, QAction *action, const QList< int > &context=QList< int >())=0 |
| Registers an action with the action manager.
|
virtual Command * | registerActionPlaceHolder (const QString &id, const QString &user_text, const QKeySequence &key_sequence=QKeySequence(), const QList< int > &context=QList< int >(), const QIcon &icon=QIcon())=0 |
| Registers an action placeholder with the action manager.
|
virtual Command * | registerShortcut (const QString &id, const QString &user_text, QShortcut *shortcut, const QList< int > &active_contexts=QList< int >())=0 |
| Function to register a shortcut in the action manager.
|
virtual void | restoreDefaultShortcuts ()=0 |
| Restores the default shortcut configuration.
|
virtual bool | saveShortcutMapping (const QString &file_name, Qtilities::ExportVersion version=Qtilities::Qtilities_Latest)=0 |
| Exports the current shortcut configuraiton.
|
virtual void | unregisterCommandsForContext (int context)=0 |
| Unregisters all commands for the specified context id.
|
Interface used to communicate with the action manager.
For more information see the Action Management article.
virtual Command* Qtilities::CoreGui::Interfaces::IActionManager::registerActionPlaceHolder |
( |
const QString & |
id, |
|
|
const QString & |
user_text, |
|
|
const QKeySequence & |
key_sequence = QKeySequence() , |
|
|
const QList< int > & |
context = QList< int >() , |
|
|
const QIcon & |
icon = QIcon() |
|
) |
| |
|
pure virtual |
Registers an action placeholder with the action manager.
This function is used to create a placeholder for future action types in the system. This is usefull in cases where the actual backend action is not registered at application startup. An example of this would be actions contained in an object produced by a factory. For these scenarios you must register an place holder for the action at startup (to allow the action to be visible in the command editor, and to allow the action to be set according to a previous shortcut mapping scheme at application startup). If you want to use the registerActionPlaceHolder function in this way, leave the context as default. This will create the action place holder and you can register backend actions at a later time using the registerAction() call.
You can also use this function if you want to create a command which is not a multi-backed proxy action. In that case you connect directly to the command->action() triggered() signal to access the action. If you want to use the registerActionPlaceHolder() function in this way you must provide an context for the action to force the function to create a default backend action for you for the specified context.
- Parameters:
-
id | The internal id used to represent the action. This is the name used to display the action in the command editor. |
user_text | The user visible text that will be used for this command. |
shortcut | A shortcut to be associated with the command. |
context | Pass an empty QList<int>() if you do want to use the action as an mutli backed action, pass the needed context otherwise. |
icon | An icon to use in this placeholder. |
- Returns:
- The command created for the given id. If a command with the given id already exists, the existing command is returned.
Implemented in Qtilities::CoreGui::ActionManager.