score::ActionCondition Struct Reference

The ActionCondition struct. More...

Inheritance diagram for score::ActionCondition:
Scenario::EnableWhenScenarioInterfaceInstantObject Scenario::EnableWhenScenarioInterfaceObject Scenario::EnableWhenScenarioModelObject score::CustomActionCondition score::DocumentActionCondition score::FocusActionCondition score::SelectionActionCondition score::EnableActionIfDocument

Detailed Description

The ActionCondition struct.

Base class for conditions on actions. This mechanism allows to enable / disable a set of actions when a specific event occurs in the software.

For instance, some actions should be enabled only when some particular group of elements are enabled.

See also
score::ActionManager

Public Member Functions

 ActionCondition (StringKey< ActionCondition > k)
 
virtual void action (ActionManager &mgr, MaybeDocument)
 action This function will be called whenever a particular event happen. More...
 
void setEnabled (score::ActionManager &mgr, bool b)
 setEnabled Sets the state of all the matching actions More...
 
template<typename Action_T >
void add ()
 add Register an action for this condition. More...
 
StringKey< ActionConditionkey () const
 

Member Function Documentation

◆ action()

void score::ActionCondition::action ( ActionManager mgr,
MaybeDocument   
)
virtual

action This function will be called whenever a particular event happen.

The default implementation does nothing.

Reimplemented in score::EnableActionIfDocument.

◆ add()

template<typename Action_T >
void score::ActionCondition::add ( )
inline

add Register an action for this condition.

See also
SCORE_DECLARE_ACTION

◆ setEnabled()

void score::ActionCondition::setEnabled ( score::ActionManager mgr,
bool  b 
)

setEnabled Sets the state of all the matching actions

This function should be called by implementations of the ActionCondition::action function.

It will enable or disable all the actions registered for this condition.


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