Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes
Interaction::Action Class Reference

Public Types

using ActionFunctionOnItem = std::function< void(Visualization::Item *item)>
 
using ActionFunctionOnNode = std::function< void(Model::Node *node)>
 
using FilterFunctionOnNode = std::function< bool(Model::Node *node)>
 

Public Member Functions

 Action (const QString &shortcut, const QString &name)
 
 Action (const QString &shortcut, const QString &name, ActionFunctionOnItem action)
 
 Action (const QString &shortcut, const QString &name, ActionFunctionOnItem action, FilterFunctionOnNode filter)
 
 Action (const QString &shortcut, const QString &name, ActionFunctionOnNode action)
 
 Action (const QString &shortcut, const QString &name, ActionFunctionOnNode action, FilterFunctionOnNode filter)
 
virtual ~Action ()
 
virtual bool canBeAppliedTo (Model::Node *node) const
 
virtual void execute (Model::Node *node)
 
virtual void execute (Visualization::Item *itemWithNode)
 
bool isPrefix (const QString &str) const
 
const QString & name () const
 
const QString & shortcut () const
 

Static Public Member Functions

static QList< Action * > & actions (int nodeTypeId)
 
static QList< Action * > actions (Model::Node *node)
 
template<typename T >
static void add (Action *action)
 

Static Private Member Functions

static QString calculateSuitableShortcut (const QString &name, const QStringList &list)
 
static void createStandardActionsForCompositeNode (Model::CompositeNode *node, QList< Action * > &list)
 
static void createStandardRemoveAction (QList< Action * > &list)
 

Private Attributes

ActionFunctionOnItem actionOnItem_
 
ActionFunctionOnNode actionOnNode_
 
FilterFunctionOnNode filterOnNode_
 
QString name_
 
QString shortcut_
 

Member Typedef Documentation

◆ ActionFunctionOnItem

◆ ActionFunctionOnNode

using Interaction::Action::ActionFunctionOnNode = std::function<void (Model::Node* node)>

◆ FilterFunctionOnNode

using Interaction::Action::FilterFunctionOnNode = std::function<bool (Model::Node* node)>

Constructor & Destructor Documentation

◆ Action() [1/5]

Interaction::Action::Action ( const QString &  shortcut,
const QString &  name 
)

◆ Action() [2/5]

Interaction::Action::Action ( const QString &  shortcut,
const QString &  name,
ActionFunctionOnNode  action 
)

◆ Action() [3/5]

Interaction::Action::Action ( const QString &  shortcut,
const QString &  name,
ActionFunctionOnNode  action,
FilterFunctionOnNode  filter 
)

◆ Action() [4/5]

Interaction::Action::Action ( const QString &  shortcut,
const QString &  name,
ActionFunctionOnItem  action 
)

◆ Action() [5/5]

Interaction::Action::Action ( const QString &  shortcut,
const QString &  name,
ActionFunctionOnItem  action,
FilterFunctionOnNode  filter 
)

◆ ~Action()

Interaction::Action::~Action ( )
virtual

Member Function Documentation

◆ actions() [1/2]

QList< Action * > & Interaction::Action::actions ( int  nodeTypeId)
static

◆ actions() [2/2]

QList< Action * > Interaction::Action::actions ( Model::Node node)
static

◆ add()

template<typename T >
void Interaction::Action::add ( Action action)
inlinestatic

◆ calculateSuitableShortcut()

QString Interaction::Action::calculateSuitableShortcut ( const QString &  name,
const QStringList &  list 
)
staticprivate

◆ canBeAppliedTo()

bool Interaction::Action::canBeAppliedTo ( Model::Node node) const
virtual

◆ createStandardActionsForCompositeNode()

void Interaction::Action::createStandardActionsForCompositeNode ( Model::CompositeNode node,
QList< Action * > &  list 
)
staticprivate

◆ createStandardRemoveAction()

void Interaction::Action::createStandardRemoveAction ( QList< Action * > &  list)
staticprivate

◆ execute() [1/2]

void Interaction::Action::execute ( Model::Node node)
virtual

◆ execute() [2/2]

void Interaction::Action::execute ( Visualization::Item itemWithNode)
virtual

◆ isPrefix()

bool Interaction::Action::isPrefix ( const QString &  str) const
inline

◆ name()

const QString & Interaction::Action::name ( ) const
inline

◆ shortcut()

const QString & Interaction::Action::shortcut ( ) const
inline

Member Data Documentation

◆ actionOnItem_

ActionFunctionOnItem Interaction::Action::actionOnItem_
private

◆ actionOnNode_

ActionFunctionOnNode Interaction::Action::actionOnNode_
private

◆ filterOnNode_

FilterFunctionOnNode Interaction::Action::filterOnNode_
private

◆ name_

QString Interaction::Action::name_
private

◆ shortcut_

QString Interaction::Action::shortcut_
private