Loading...
Searching...
No Matches
lomiri::action::ActionManager Class Reference
Inheritance diagram for lomiri::action::ActionManager:

## Signals

void | actionsChanged ()
void | localContextsChanged ()
| Q_REVISION (1) void quit()

## Public Member Functions

| ActionManager (QObject *parent=0)
QSet< Action * > | actions () const
Q_INVOKABLE void | addAction (lomiri::action::Action *action)
Q_INVOKABLE void | addLocalContext (lomiri::action::ActionContext *context)
Q_INVOKABLE lomiri::action::ActionContext * | globalContext ()
QSet< ActionContext * > | localContexts () const
Q_INVOKABLE void | removeAction (lomiri::action::Action *action)
Q_INVOKABLE void | removeLocalContext (lomiri::action::ActionContext *context)

## Properties

lomiri::action::ActionContext * | globalContext

## Detailed Description

ActionManager exports the application actions to the external components. See Platform Integration and Action Contexts for more details.

## Constructor & Destructor Documentation

## ActionManager()

ActionManager::ActionManager | ( | QObject * | parent = `0` | ) |

explicit

Parameters

  parent | parent QObject or 0

Creates a new ActionManager.

Also creates a global context which can be accessed with ActionManager::globalContext

## Member Function Documentation

## actions()

QSet< Action * > ActionManager::actions | ( |  | ) | const

Returns
  The set of actions the manager is currently aware of.

If an action is part of multiple contexts it's still only included once in the set.

## actionsChanged

void lomiri::action::ActionManager::actionsChanged | ( |  | ) |

signal

An action was either added or removed from the global context or any of the local contexts the manager is currently tracking.

## addAction()

void ActionManager::addAction | ( | lomiri::action::Action * | action | ) |

Parameters

  action | action to be added

this is a shorthand for

manager->globalContext()->addAction(action);

See also
  ActionContext::addAction()

## addLocalContext()

void ActionManager::addLocalContext | ( | lomiri::action::ActionContext * | context | ) |

Parameters

  context | context to be added

Adds a local context.

Calling this function multiple times with the same context does not have any side effects; the context gets added only once.

ActionManager monitors if the context is deleted and does the appropriate cleanup when necessary, so it is not mandatory to call removeLocalContext() before the context is destroyed.

Note
  If context::active is true when added, the context is made the current active one.
  context must not be 0.

## localContexts()

QSet< ActionContext * > ActionManager::localContexts | ( |  | ) | const

Returns
  The set of local contexts the manager is aware of.

## localContextsChanged

void lomiri::action::ActionManager::localContextsChanged | ( |  | ) |

signal

A local context was either added or removed.

## removeAction()

void ActionManager::removeAction | ( | lomiri::action::Action * | action | ) |

Parameters

  action | action to be removed

this is a shorthand for

manager->globalContext()->removeAction(action);

See also
  ActionContext::removeAction()

## removeLocalContext()

void ActionManager::removeLocalContext | ( | lomiri::action::ActionContext * | context | ) |

Parameters

  context | context to be removed

Removes a local context.

Calling this function multiple times with the same context does not have any side effects; the context gets removed only if it was previously added with addLocalContext().

Note
  if the removed context is the current active one after the removal there is no active local context.
  context must not be 0

## Property Documentation

## globalContext

ActionContext * ActionManager::globalContext

read

The globalContext of the Application.

Note
  Setting the ActionContext::active on the global context has no effect;

Accessors:\n globalContext()

The documentation for this class was generated from the following files:

- lomiri-action-manager.h
- lomiri-action-manager.cpp