/* * MethodAction.hpp * * Created on: Dec 11, 2009 * Author: crueger */ #ifndef METHODACTION_HPP_ #define METHODACTION_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include "Actions/Action.hpp" /** * Wrapper class that allows the construction of Actions from any kind of Method */ class MethodAction : public Action { public: MethodAction(const ActionTraits &_trait,boost::function _executeMethod,bool _doRegister=true); virtual ~MethodAction(); virtual bool canUndo(); virtual bool shouldUndo(); protected: virtual Dialog * fillDialog(Dialog *dialog); private: virtual void getParametersfromValueStorage(); virtual Action::state_ptr performCall(); virtual Action::state_ptr performUndo(Action::state_ptr); virtual Action::state_ptr performRedo(Action::state_ptr); boost::function executeMethod; //!< this stores the method to be called }; #endif /* METHODACTION_HPP_ */