AuboStudio SDK  0.6.3
undo_redo_manager.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_UNDO_REDO_MANAGER_H
2#define AUBO_SCOPE_UNDO_REDO_MANAGER_H
3
4#include <functional>
6
7namespace arcs {
8namespace aubo_scope {
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{
29public:
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
49private:
50 friend class DataSwitch;
52 void *d_{ nullptr };
53};
54} // namespace aubo_scope
55} // namespace arcs
56
57#endif
#define ARCS_ABI_EXPORT
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
UndoRedoManager(UndoRedoManager &f)
UndoRedoManager(UndoRedoManager &&f)
void recordChanges(const std::string &text, std::function< void()> undoableChanges)