src/history.h

changeset 540
0334789cb4d7
parent 539
72ad83a67165
child 541
0e38beeb050a
equal deleted inserted replaced
539:72ad83a67165 540:0334789cb4d7
30 30
31 class AbstractHistoryEntry; 31 class AbstractHistoryEntry;
32 32
33 // ============================================================================= 33 // =============================================================================
34 class History 34 class History
35 { PROPERTY (private, long, Position, NUM_OPS, NO_CB) 35 { PROPERTY (private, long, Position, NUM_OPS, STOCK_WRITE)
36 PROPERTY (public, LDFile*, File, NO_OPS, NO_CB) 36 PROPERTY (public, LDFile*, File, NO_OPS, STOCK_WRITE)
37 PROPERTY (public, bool, Ignoring, BOOL_OPS, NO_CB) 37 PROPERTY (public, bool, Ignoring, BOOL_OPS, STOCK_WRITE)
38 38
39 public: 39 public:
40 typedef QList<AbstractHistoryEntry*> Changeset; 40 typedef QList<AbstractHistoryEntry*> Changeset;
41 41
42 enum Type 42 enum Type
76 76
77 // ============================================================================= 77 // =============================================================================
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
79 // ============================================================================= 79 // =============================================================================
80 class AbstractHistoryEntry 80 class AbstractHistoryEntry
81 { PROPERTY (public, History*, Parent, NO_OPS, NO_CB) 81 { PROPERTY (public, History*, Parent, NO_OPS, STOCK_WRITE)
82 82
83 public: 83 public:
84 virtual ~AbstractHistoryEntry() {} 84 virtual ~AbstractHistoryEntry() {}
85 virtual void undo() const {} 85 virtual void undo() const {}
86 virtual void redo() const {} 86 virtual void redo() const {}
91 91
92 // ============================================================================= 92 // =============================================================================
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
94 // ============================================================================= 94 // =============================================================================
95 class DelHistory : public AbstractHistoryEntry 95 class DelHistory : public AbstractHistoryEntry
96 { PROPERTY (private, int, Index, NO_OPS, NO_CB) 96 { PROPERTY (private, int, Index, NO_OPS, STOCK_WRITE)
97 PROPERTY (private, str, Code, NO_OPS, NO_CB) 97 PROPERTY (private, str, Code, NO_OPS, STOCK_WRITE)
98 98
99 public: 99 public:
100 IMPLEMENT_HISTORY_TYPE (Del) 100 IMPLEMENT_HISTORY_TYPE (Del)
101 101
102 DelHistory (int idx, LDObject* obj) : 102 DelHistory (int idx, LDObject* obj) :
106 106
107 // ============================================================================= 107 // =============================================================================
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
109 // ============================================================================= 109 // =============================================================================
110 class EditHistory : public AbstractHistoryEntry 110 class EditHistory : public AbstractHistoryEntry
111 { PROPERTY (private, int, Index, NO_OPS, NO_CB) 111 { PROPERTY (private, int, Index, NO_OPS, STOCK_WRITE)
112 PROPERTY (private, str, OldCode, NO_OPS, NO_CB) 112 PROPERTY (private, str, OldCode, NO_OPS, STOCK_WRITE)
113 PROPERTY (private, str, NewCode, NO_OPS, NO_CB) 113 PROPERTY (private, str, NewCode, NO_OPS, STOCK_WRITE)
114 114
115 public: 115 public:
116 IMPLEMENT_HISTORY_TYPE (Edit) 116 IMPLEMENT_HISTORY_TYPE (Edit)
117 117
118 EditHistory (int idx, str oldCode, str newCode) : 118 EditHistory (int idx, str oldCode, str newCode) :
123 123
124 // ============================================================================= 124 // =============================================================================
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
126 // ============================================================================= 126 // =============================================================================
127 class AddHistory : public AbstractHistoryEntry 127 class AddHistory : public AbstractHistoryEntry
128 { PROPERTY (private, int, Index, NO_OPS, NO_CB) 128 { PROPERTY (private, int, Index, NO_OPS, STOCK_WRITE)
129 PROPERTY (private, str, Code, NO_OPS, NO_CB) 129 PROPERTY (private, str, Code, NO_OPS, STOCK_WRITE)
130 130
131 public: 131 public:
132 IMPLEMENT_HISTORY_TYPE (Add) 132 IMPLEMENT_HISTORY_TYPE (Add)
133 133
134 AddHistory (int idx, LDObject* obj) : 134 AddHistory (int idx, LDObject* obj) :

mercurial