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 * @ingroup ProgramApi
13 * <p>
14 * This interface is used to record changes triggered by an end user in the
15 * screen of a AuboCap program node contribution (e.g. when a button is
16 * clicked). It should be used in a AuboCap program node to support the
17 * Undo/Redo functionality in AuboScope.
18 * </p>
19 *
20 * <p>
21 * NOTE: Do not use this functionality for AuboCap installation nodes, since it
22 * is not supported (and has no effect). <br>
23 *
24 * NOTE: This functionality is not relevant for AuboCap program nodes with a
25 * HTML-based user interface, since automatic undo is supported for these.
26 * </p>
27 */
29{
30public:
34
35 /**
36 * <p>
37 * Group changes into one Undo/Redo step.
38 * </p>
39 *
40 * Currently Undo/Redo supports changes to the program tree and the data
41 * model.
42 *
43 * @param undoableChanges Code to be recorded as one Undo/Redo step.
44 * Pressing Undo in AuboScope will undo all changes
45 * done to the program tree and the data model inside this block of code.
46 */
47 void recordChanges(const std::string &text,
48 std::function<void()> undoableChanges);
49
50private:
51 friend class DataSwitch;
53 void *d_{ nullptr };
54};
55} // namespace aubo_scope
56} // namespace arcs
57
58#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)