]> Shamusworld >> Repos - architektonas/blob - src/base/rs_undoable.h
1bd2ae0278e2b932516f964ab758e48d056cdf7e
[architektonas] / src / base / rs_undoable.h
1 #ifndef RS_UNDOABLE_H
2 #define RS_UNDOABLE_H
3
4 #include "rs_flags.h"
5
6 class RS_UndoCycle;
7
8 /**
9  * Base class for something that can be added and deleted and every
10  * addition and deletion can be undone.
11  *
12  * @see RS_Undo
13  * @author Andrew Mustun
14  */
15 class RS_Undoable: public RS_Flags
16 {
17         public:
18                 RS_Undoable();
19                 virtual ~RS_Undoable();
20
21                 virtual RS2::UndoableType undoRtti();
22                 virtual void setUndoCycle(RS_UndoCycle * cycle);
23                 virtual void changeUndoState();
24                 virtual void setUndoState(bool undone);
25                 virtual bool isUndone() const;
26                 virtual void undoStateChanged(bool /*undone*/);
27                 //friend std::ostream& operator << (std::ostream& os, RS_Undoable& a);
28
29         private:
30                 RS_UndoCycle * cycle;
31 };
32
33 #endif