/* * ActionSequenze.hpp * * Created on: Dec 17, 2009 * Author: crueger */ #ifndef ACTIONSEQUENZE_HPP_ #define ACTIONSEQUENZE_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "Actions/Action.hpp" #include namespace MoleCuilder { /** * Store Actions for later use. */ class ActionSequence { friend class MakroAction; public: typedef std::deque actionSet; typedef std::deque stateSet; ActionSequence(); virtual ~ActionSequence(); void addAction(Action*); Action* removeLastAction(); unsigned int getLoop() const { return loop; } void callAll(); bool canUndo(); bool shouldUndo(); void outputAsCLI(std::ostream &ost) const; void outputAsPython(std::ostream &ost, const std::string &prefix) const; protected: stateSet callAll(bool); // Dummy parameter to allow overloading Dialog* fillAllDialogs(Dialog *dialog); stateSet undoAll(stateSet); stateSet redoAll(stateSet); void setLoop(unsigned int _loop) { loop = _loop; } private: actionSet actions; //!> how often the sequence is repeated unsigned int loop; }; } #endif /* ACTIONSEQUENZE_HPP_ */