Choreonoid  1.8
UnifiedEditHistory.h
Go to the documentation of this file.
1 #ifndef CNOID_BASE_UNIFIED_EDIT_HISTORY_H
2 #define CNOID_BASE_UNIFIED_EDIT_HISTORY_H
3 
4 #include <cnoid/Referenced>
5 #include <cnoid/Signal>
6 #include <string>
7 #include "exportdecl.h"
8 
9 namespace cnoid {
10 
11 class ExtensionManager;
12 
13 class EditRecord;
14 typedef ref_ptr<EditRecord> EditRecordPtr;
15 
16 class CNOID_EXPORT UnifiedEditHistory
17 {
18 public:
19  static void initializeClass(ExtensionManager* ext);
20  static UnifiedEditHistory* instance();
21 
22  int numRecords() const;
23 
25  EditRecord* record(int index);
26 
27  void addRecord(EditRecordPtr record);
28  void beginEditGroup(const std::string& label);
29  void endEditGroup();
30 
31  int currentPosition() const;
32  bool undo();
33  bool redo();
34 
35  void clear();
36 
37  SignalProxy<void()> sigHistoryUpdated();
38  SignalProxy<void(int position)> sigCurrentPositionChanged();
39 
40 private:
43 
44  class Impl;
45  Impl* impl;
46 };
47 
48 }
49 
50 #endif
cnoid::ExtensionManager
Definition: ExtensionManager.h:23
cnoid::EditRecord
Definition: EditRecord.h:11
cnoid::UnifiedEditHistory
Definition: UnifiedEditHistory.h:16
cnoid::ref_ptr
Definition: Referenced.h:103
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::EditRecordPtr
ref_ptr< EditRecord > EditRecordPtr
Definition: EditRecord.h:35
cnoid::SignalProxy
Definition: Signal.h:470