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

## Signals

void | actionsChanged ()
void | activeChanged (bool value)

## Public Member Functions

| ActionContext (QObject *parent=0)
QSet< Action * > | actions () const
bool | active () const
Q_INVOKABLE void | addAction (lomiri::action::Action *action)
Q_INVOKABLE void | removeAction (lomiri::action::Action *action)
void | setActive (bool value)

## Properties

bool | active

## Detailed Description

ActionContext groups actions together and by providing multiple contexts the developer is able to control the visibility of the actions. The ActionManager then exposes the actions from these different contexts. See Action Contexts for more details.

## Constructor & Destructor Documentation

## ActionContext()

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

explicit

Creates a new ActionContext. ActionContext has to be added to the ActionManager and set active to make it's actions vailable for external components.

Parameters

  parent | parent QObject or 0

## Member Function Documentation

## actions()

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

Returns
  The set of actions in the context.

## actionsChanged

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

signal

Notifies that the actions inside a context have changed from a call to addAction() or removeAction().

## addAction()

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

Adds an action to the context.

Parameters

  action | Action to be added to the context

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

ActionContext monitors if the action is deleted and does the appropriate cleanup when necessary, so it is not mandatory to call removeAction() before the action is destroyed.

Note
  action must not be 0

## removeAction()

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

Removes an action from the context.

Parameters

  action | Action to be removed to the context

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

Note
  action must not be 0

## Property Documentation

## active

bool lomiri::action::ActionContext::active

read write

If true the context is active. If false the context is inactive.

When context has been added to the ActionManager setting this value controls whether or not the actions in a context are available to external components.

The ActionManager monitors the active property of each of the local contexts that has been added to it. There can be only one active local context at a time. When one of the local contexts sets itself active the manager will notice this, export the actions from that given context and set the previously active local context as inactive. This way a call to setActive() on a local context is sufficient to manage the active local context of the manager and no additional calls are necessary to manually inactivate the other contexts.

Initial Value:\n false

Accessors:\n active(), setActive()

Notify:\n activeChanged()

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

- lomiri-action-context.h
- lomiri-action-context.cpp