AuboCaps  0.6.0
undo_redo_manager.h
Go to the documentation of this file.
1 #ifndef AUBO_SCOPE_UNDO_REDO_MANAGER_H
2 #define AUBO_SCOPE_UNDO_REDO_MANAGER_H
3 
4 #include <functional>
6 
7 namespace arcs {
8 namespace aubo_scope {
9 ARCS_CLASS_FORWARD(UndoRedoManager);
10 
11 /**
12  * <p>
13  * This interface is used to record changes triggered by an end user in the
14  * screen of a AuboCap program node contribution (e.g. when a button is
15  * clicked). It should be used in a AuboCap program node to support the
16  * Undo/Redo functionality in AuboScope.
17  * </p>
18  *
19  * <p>
20  * NOTE: Do not use this functionality for AuboCap installation nodes, since it
21  * is not supported (and has no effect). <br>
22  *
23  * NOTE: This functionality is not relevant for AuboCap program nodes with a
24  * HTML-based user interface, since automatic undo is supported for these.
25  * </p>
26  */
28 {
29 public:
32  virtual ~UndoRedoManager();
33 
34  /**
35  * <p>
36  * Group changes into one Undo/Redo step.
37  * </p>
38  *
39  * Currently Undo/Redo supports changes to the program tree and the data
40  * model.
41  *
42  * @param undoableChanges Code to be recorded as one Undo/Redo step.
43  * Pressing Undo in AuboScope will undo all changes
44  * done to the program tree and the data model inside this block of code.
45  */
46  void recordChanges(const std::string &text,
47  std::function<void()> undoableChanges);
48 
49 private:
50  friend class DataSwitch;
52  void *d_{ nullptr };
53 };
54 } // namespace aubo_scope
55 } // namespace arcs
56 
57 #endif
ARCS_CLASS_FORWARD(GripForceCapability)
#define ARCS_ABI_EXPORT
Definition: class_forward.h:16