]> Shamusworld >> Repos - architektonas/blob - src/base/undocycle.h
Bugfixes related to removing Snapper class.
[architektonas] / src / base / undocycle.h
1 #ifndef __UNDOLISTITEM_H__
2 #define __UNDOLISTITEM_H__
3
4 #include <iostream>
5 #include <QtCore>
6
7 class Undoable;
8
9 /**
10  * An Undo Cycle represents an action that was triggered and can
11  * be undone. It stores all the pointers to the Undoables affected by
12  * the action. Undoables are entities in a container that can be
13  * created and deleted.
14  *
15  * Undo Cycles are stored within classes derrived from Undo.
16  *
17  * @see Undoable
18  * @see Undo
19  *
20  * @author Andrew Mustun
21  */
22 class UndoCycle
23 {
24         friend class Undo;
25
26         public:
27                 UndoCycle(/*RS2::UndoType type*/);
28                 void addUndoable(Undoable * u);
29                 void removeUndoable(Undoable * u);
30                 Undoable * getFirstUndoable();
31                 Undoable * getNextUndoable();
32                 friend std::ostream & operator<<(std::ostream & os, UndoCycle & i);
33
34         private:
35                 //! Undo type:
36                 //RS2::UndoType type;
37                 //! List of entity id's that were affected by this action
38 //              Q3PtrList<Undoable> undoables;
39                 QList<Undoable *> undoables;
40                 QListIterator<Undoable *> undoableIterator;
41 };
42
43 #endif