ASPiK SDK
uiundomanager.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #ifndef __uiundomanager__
6 #define __uiundomanager__
7 
8 #include "../../lib/vstguibase.h"
9 
10 #if VSTGUI_LIVE_EDITING
11 
12 #include "../../lib/idependency.h"
13 #include <list>
14 #include <deque>
15 
16 namespace VSTGUI {
17 class IAction;
18 class UIGroupAction;
19 
20 //----------------------------------------------------------------------------------------------------
21 class UIUndoManager : public CBaseObject, protected std::list<IAction*>, public IDependency
22 {
23 public:
24  UIUndoManager ();
25  ~UIUndoManager () override;
26 
27  void pushAndPerform (IAction* action);
28 
29  UTF8StringPtr getUndoName ();
30  UTF8StringPtr getRedoName ();
31 
32  void performUndo ();
33  void performRedo ();
34  bool canUndo ();
35  bool canRedo ();
36 
37  void startGroupAction (UTF8StringPtr name);
38  void endGroupAction ();
39  void cancelGroupAction ();
40 
41  void clear ();
42 
43  void markSavePosition ();
44  bool isSavePosition () const;
45 
46  static IdStringPtr kMsgChanged;
47 protected:
48  iterator position;
49  iterator savePosition;
50  using GroupActionDeque = std::deque<UIGroupAction*>;
51  GroupActionDeque groupQueue;
52 };
53 
54 } // namespace
55 
56 #endif // VSTGUI_LIVE_EDITING
57 
58 #endif // __uiundomanager__
Definition: customcontrols.cpp:8
Definition: xmltok.h:112