source: molecuilder/src/Actions/Action.hpp@ 031ec24

Last change on this file since 031ec24 was 795b4d, checked in by Tillmann Crueger <crueger@…>, 16 years ago

Moved method to rename molecules to a seperate Action

  • Property mode set to 100644
File size: 730 bytes
Line 
1/*
2 * Action.h
3 *
4 * Created on: Dec 8, 2009
5 * Author: crueger
6 */
7
8#ifndef ACTION_H_
9#define ACTION_H_
10
11#include <string>
12
13/**
14 * Base class for all actions.
15 *
16 * Actions describe something that has to be done.
17 * Actions can be passed around, stored, performed and undone (Command-Pattern).
18 *
19 * TODO: Add queues of actions that have been performed to allow easy implementation of multiple-step undo
20 */
21class Action
22{
23protected:
24public:
25 Action(std::string _name,bool _doRegister=true);
26 virtual ~Action();
27
28 virtual void call()=0;
29 virtual void undo()=0;
30 virtual bool canUndo()=0;
31 //virtual bool shouldUndo()=0;
32
33 virtual const std::string getName();
34
35private:
36 std::string name;
37};
38
39#endif /* ACTION_H_ */
Note: See TracBrowser for help on using the repository browser.