19 #ifndef QTSPELL_UNDOREDOSTACK_HPP 20 #define QTSPELL_UNDOREDOSTACK_HPP 30 class UndoRedoStack :
public QObject
34 UndoRedoStack(TextEditProxy* textEdit);
35 void handleContentsChange(
int pos,
int removed,
int added);
43 void undoAvailable(
bool);
44 void redoAvailable(
bool);
48 struct UndoableInsert;
49 struct UndoableDelete;
51 bool m_actionInProgress =
false;
52 TextEditProxy* m_textEdit =
nullptr;
53 QStack<Action*> m_undoStack;
54 QStack<Action*> m_redoStack;
56 bool insertMergeable(
const UndoableInsert* prev,
const UndoableInsert* cur)
const;
57 bool deleteMergeable(
const UndoableDelete* prev,
const UndoableDelete* cur)
const;
62 #endif // QTSPELL_UNDOREDOSTACK_HPP