5 #include "rs_undocycle.h"
8 * Undo / redo functionality. The internal undo list consists of
9 * RS_UndoCycle entries.
12 * @author Andrew Mustun
20 void addUndoCycle(RS_UndoCycle * i);
25 virtual RS_UndoCycle * getUndoCycle();
26 virtual RS_UndoCycle * getRedoCycle();
28 virtual int countUndoCycles();
29 virtual int countRedoCycles();
31 virtual void startUndoCycle();
32 virtual void addUndoable(RS_Undoable * u);
33 virtual void endUndoCycle();
36 * Must be overwritten by the implementing class and delete
37 * the given Undoable (unrecoverable). This method is called
38 * for Undoables that are no longer in the undo buffer.
40 virtual void removeUndoable(RS_Undoable * u) = 0;
42 friend std::ostream & operator<<(std::ostream & os, RS_Undo & a);
45 static bool test(void);
49 //! List of undo list items. every item is something that can be undone.
50 // Q3PtrList<RS_UndoCycle> undoList;
51 QList<RS_UndoCycle *> undoList;
54 * Index that points to the current position in the undo list.
55 * The item it points on will be undone the next time undo is called.
56 * The item after will be redone (if there is an item) when redo
64 RS_UndoCycle * currentCycle;
69 * Stub for testing the RS_Undo class.
71 class RS_UndoStub : public RS_Undo
73 virtual void removeUndoable(RS_Undoable * u)