2 #include <score/command/Command.hpp>
3 #include <score/command/Validity/ValidityChecker.hpp>
49 void disableActions();
56 QString undoText()
const;
59 QString redoText()
const;
64 int currentIndex()
const;
66 void markCurrentIndexAsSaved();
68 bool isAtSavedIndex()
const;
70 QStack<score::Command*>& undoable() {
return m_undoable; }
71 QStack<score::Command*>& redoable() {
return m_redoable; }
72 const QStack<score::Command*>& undoable()
const {
return m_undoable; }
73 const QStack<score::Command*>& redoable()
const {
return m_redoable; }
82 E_SIGNAL(SCORE_LIB_BASE_EXPORT, localCommand, cmd)
87 void localUndo() E_SIGNAL(SCORE_LIB_BASE_EXPORT, localUndo)
92 void localRedo() E_SIGNAL(SCORE_LIB_BASE_EXPORT, localRedo)
94 void localIndexChanged(
int v) E_SIGNAL(SCORE_LIB_BASE_EXPORT, localIndexChanged, v)
96 void canUndoChanged(
bool b) E_SIGNAL(SCORE_LIB_BASE_EXPORT, canUndoChanged, b)
97 void canRedoChanged(
bool b) E_SIGNAL(SCORE_LIB_BASE_EXPORT, canRedoChanged, b)
99 void undoTextChanged(QString b) E_SIGNAL(SCORE_LIB_BASE_EXPORT, undoTextChanged, b)
100 void redoTextChanged(QString b) E_SIGNAL(SCORE_LIB_BASE_EXPORT, redoTextChanged, b)
102 void indexChanged(
int b) E_SIGNAL(SCORE_LIB_BASE_EXPORT, indexChanged, b)
104 void stackChanged() E_SIGNAL(SCORE_LIB_BASE_EXPORT, stackChanged)
106 void saveIndexChanged(
bool b) E_SIGNAL(SCORE_LIB_BASE_EXPORT, saveIndexChanged, b)
110 void sig_undo() E_SIGNAL(SCORE_LIB_BASE_EXPORT, sig_undo)
111 void sig_redo() E_SIGNAL(SCORE_LIB_BASE_EXPORT, sig_redo)
112 void sig_push() E_SIGNAL(SCORE_LIB_BASE_EXPORT, sig_push)
113 void sig_indexChanged() E_SIGNAL(SCORE_LIB_BASE_EXPORT, sig_indexChanged)
115 void setIndex(
int index);
116 W_INVOKABLE(setIndex)
117 void setIndexQuiet(
int index);
118 W_INVOKABLE(setIndexQuiet)
122 W_INVOKABLE(undoQuiet)
124 W_INVOKABLE(redoQuiet)
133 W_INVOKABLE(redoAndPush)
149 W_INVOKABLE(redoAndPushQuiet)
151 W_INVOKABLE(pushQuiet)
168 template <
typename Callable>
176 void updateStack(Callable&& c)
178 bool pre_canUndo{canUndo()}, pre_canRedo{canRedo()};
184 if(pre_canUndo != canUndo())
185 canUndoChanged(canUndo());
187 if(pre_canRedo != canRedo())
188 canRedoChanged(canRedo());
191 undoTextChanged(m_undoable.top()->description());
196 redoTextChanged(m_redoable.top()->description());
200 indexChanged(m_undoable.size() - 1);
204 void setSavedIndex(
int index);
206 void validateDocument()
const;
209 QStack<score::Command*> m_undoable;
210 QStack<score::Command*> m_redoable;
214 DocumentValidator m_checker;
Abstraction over the backup of commands.
Definition: CommandBackupFile.hpp:34
The Command class.
Definition: Command.hpp:34
Definition: CommandStack.hpp:26
void localCommand(score::Command *cmd)
Emitted when a command was pushed on the stack.
The Document class is the central part of the software.
Definition: Document.hpp:51
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Serialized command stack data for backup / restore.
Definition: CommandBackupFile.hpp:17
Definition: DocumentContext.hpp:18