21#ifndef __ANTARES_LIBS_STUDY_ACTION_ACTION_H__
22#define __ANTARES_LIBS_STUDY_ACTION_ACTION_H__
25#include <yuni/core/tree/treeN.h>
26#include <yuni/core/string.h>
28#include <antares/study/study.h>
37class IAction :
public Yuni::Core::TreeN<IAction>
43 using Ptr = AncestorType::Ptr;
84 void datagridCaption(Yuni::String& title);
104 virtual bool bold()
const;
114 virtual bool canDoSomething()
const;
116 virtual bool allowUpdate()
const;
117 virtual bool allowSkip()
const;
118 virtual bool allowOverwrite()
const;
119 virtual bool shouldPrepareRootNode()
const;
129 void behavior(Behavior newBehavior);
142 virtual void behaviorToText(Behavior
behavior, Yuni::String& out);
171 void internalDump(Yuni::String& tmp, uint level)
const;
virtual void createPostActionsWL(const IAction::Ptr &node)
Create post actions (if any)
Definition action.hxx:84
std::vector< Ptr > Vector
Vector.
Definition action.h:48
bool perform(Context &ctx, bool recursive=true)
Perform the action.
Definition action.cpp:131
virtual bool bold() const
Get if the action should be represented with a bold font.
Definition action.hxx:28
IAction()
Default constructor.
Definition action.cpp:31
AncestorType::Ptr Ptr
The most suitable smart ptr for the class.
Definition action.h:43
bool prepare(Context &ctx)
Make preparations for the execution.
Definition action.cpp:94
Behavior behavior() const
Get the behavior.
Definition action.hxx:38
AncestorType::iterator iterator
iterator
Definition action.h:51
virtual void prepareSkipWL(Context &)
Prepare the execution (when the behavior says that the action should be skipped)
Definition action.h:154
virtual void registerViewsWL(Context &)
Register all views.
Definition action.h:160
virtual ~IAction()
Destructor.
Definition action.cpp:35
bool prepareRootNode(Context &ctx)
Look for the root node and make preparations for the execution.
Definition action.cpp:121
void dump() const
Dump the tree from this node to the stdcout.
Definition action.cpp:57
Yuni::Core::TreeN< IAction > AncestorType
The ancestor.
Definition action.h:41
ActionInformations pInfos
All data related to the action.
Definition action.h:168
virtual bool autoExpand() const
Auto-expand.
Definition action.hxx:33
void registerViews(Context &ctx)
Register if possible the action into the appropriate view.
Definition action.cpp:113
bool prepareStack(Vector &vector)
Prepare the whole list of actions to execute in the given order.
Definition action.cpp:158
virtual bool prepareWL(Context &ctx)=0
Prepare the execution.
virtual bool visible() const
Get if the action should be visible to the user.
Definition action.hxx:79
Yuni::String message() const
Get the message of the action.
Definition action.cpp:45
virtual bool performWL(Context &ctx)=0
Perform the action.
AncestorType::ThreadingPolicy ThreadingPolicy
The threading policy.
Definition action.h:45
Yuni::String caption() const
Get the caption of the action.
Definition action.cpp:39
void createPostActions(const IAction::Ptr &node)
Create post actions if required.
Definition action.cpp:178