ModeManager Class

class Core::ModeManager

The ModeManager class manages the activation of modes and the actions in the mode selector's tool bar. More...

Header: #include <coreplugin/modemanager.h>

Static Public Members

void activateMode(Utils::Id id)
void addAction(QAction *action, int priority)
Core::IMode *currentMode()
Utils::Id currentModeId()
Core::ModeManager *instance()

Detailed Description

Modes are implemented with the IMode class. Use the ModeManager to force activation of a mode, or to be notified when the active mode changed.

The ModeManager also manages the actions that are visible in the mode selector's toolbar. Adding actions to the tool bar should be done very sparingly.

Member Function Documentation

[static] void ModeManager::activateMode(Utils::Id id)

Makes the mode with ID id the current mode.

See also currentMode(), currentModeId(), currentModeAboutToChange(), and currentModeChanged().

[static] void ModeManager::addAction(QAction *action, int priority)

Adds the action to the mode selector's tool bar. Actions are sorted by priority in descending order. Use this functionality very sparingly.

[static] Core::IMode *ModeManager::currentMode()

Returns a pointer to the current mode.

See also activateMode() and currentModeId().

[static] Utils::Id ModeManager::currentModeId()

Returns the id of the current mode.

See also activateMode() and currentMode().

[static] Core::ModeManager *ModeManager::instance()

Returns the pointer to the instance. Only use for connecting to signals.