7 #include "CmdAbstract.h" 8 #include "CmdFactory.h" 9 #include "CmdMediator.h" 10 #include "CmdRedoForTest.h" 11 #include "CmdStackShadow.h" 12 #include "CmdUndoForTest.h" 14 #include "DocumentSerialize.h" 16 #include "MainWindow.h" 17 #include <QUndoCommand> 18 #include <QXmlStreamReader> 24 LOG4CPP_INFO_S ((*mainCat)) <<
"CmdStackShadow::CmdStackShadow";
29 LOG4CPP_INFO_S ((*mainCat)) <<
"CmdStackShadow::canRedo";
31 bool canRedo = (m_cmdList.count () > 0);
38 QXmlStreamReader &reader)
40 LOG4CPP_INFO_S ((*mainCat)) <<
"CmdStackShadow::loadCommands";
43 m_mainWindow = &mainWindow;
51 while (!reader.atEnd() && !reader.hasError()) {
53 if ((loadNextFromReader (reader) == QXmlStreamReader::StartElement) &&
54 (reader.name() == DOCUMENT_SERIALIZE_CMD)) {
57 m_cmdList.push_back (factory.createCmd (mainWindow,
66 LOG4CPP_INFO_S ((*mainCat)) <<
"CmdStackShadow::slotRedo";
68 if (m_cmdList.count() > 0) {
71 QUndoCommand *cmd =
dynamic_cast<QUndoCommand*
> (m_cmdList.front());
74 m_cmdList.pop_front();
76 if (m_mainWindow != 0) {
81 if (cmdRedoForTest != 0) {
87 }
else if (cmdUndoForTest != 0) {
105 LOG4CPP_INFO_S ((*mainCat)) <<
"CmdStackShadow::slotUndo";
107 CmdListInternal::iterator itr;
108 for (itr = m_cmdList.begin(); itr != m_cmdList.end(); itr++) {
bool canRedo() const
Return true if there is a command available.
Factory for CmdAbstractBase objects.
void signalRedo()
Signal used to emulate a shift-control-z redo command from user during testing.
Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand.
Command for performing Undo during testing.
Command for performing Redo during testing.
void slotRedo()
Move next command from list to CmdMediator. Noop if there are no more commands.
CmdMediator * cmdMediator()
Accessor for commands to process the Document.
CmdStackShadow()
Single constructor.
void slotUndo()
Throw away every command since trying to reconcile two different command stacks after an undo is too ...
Storage of one imported image and the data attached to that image.
void signalUndo()
Signal used to emulate a shift-z undo command from user during testing.
void loadCommands(MainWindow &mainWindow, Document &document, QXmlStreamReader &reader)
Load commands from serialized xml.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...