Split out commands into their own file
This commit is contained in:
117
document.h
117
document.h
@@ -23,7 +23,6 @@
|
||||
#include <QFile>
|
||||
#include <QObject>
|
||||
#include <QTextStream>
|
||||
#include <QUndoCommand>
|
||||
#include <QUndoStack>
|
||||
#include <vector>
|
||||
#include "levelonepage.h"
|
||||
@@ -89,120 +88,4 @@ private:
|
||||
LevelOnePage *m_selectionSubPage;
|
||||
};
|
||||
|
||||
|
||||
class OverwriteCharacterCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
OverwriteCharacterCommand(TeletextDocument *, unsigned char, QUndoCommand *parent = 0);
|
||||
|
||||
void redo() override;
|
||||
void undo() override;
|
||||
|
||||
private:
|
||||
TeletextDocument *m_teletextDocument;
|
||||
unsigned char m_oldCharacter, m_newCharacter;
|
||||
int m_subPageIndex, m_row, m_column;
|
||||
};
|
||||
|
||||
class ToggleMosaicBitCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
enum { Id = 2 };
|
||||
|
||||
ToggleMosaicBitCommand(TeletextDocument *, unsigned char, QUndoCommand *parent = 0);
|
||||
|
||||
void redo() override;
|
||||
void undo() override;
|
||||
bool mergeWith(const QUndoCommand *) override;
|
||||
int id() const override { return Id; }
|
||||
|
||||
private:
|
||||
TeletextDocument *m_teletextDocument;
|
||||
unsigned char m_oldCharacter, m_newCharacter;
|
||||
int m_subPageIndex, m_row, m_column;
|
||||
};
|
||||
|
||||
class BackspaceCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
BackspaceCommand(TeletextDocument *, QUndoCommand *parent = 0);
|
||||
|
||||
void redo() override;
|
||||
void undo() override;
|
||||
|
||||
private:
|
||||
TeletextDocument *m_teletextDocument;
|
||||
unsigned char m_deletedCharacter;
|
||||
int m_subPageIndex, m_row, m_column;
|
||||
};
|
||||
|
||||
class InsertSubPageCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
InsertSubPageCommand(TeletextDocument *, bool, bool, QUndoCommand *parent = 0);
|
||||
|
||||
void redo() override;
|
||||
void undo() override;
|
||||
|
||||
private:
|
||||
TeletextDocument *m_teletextDocument;
|
||||
int m_newSubPageIndex;
|
||||
bool m_copySubPage;
|
||||
};
|
||||
|
||||
class InsertRowCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
InsertRowCommand(TeletextDocument *, bool, QUndoCommand *parent = 0);
|
||||
|
||||
void redo() override;
|
||||
void undo() override;
|
||||
|
||||
private:
|
||||
TeletextDocument *m_teletextDocument;
|
||||
int m_subPageIndex, m_row;
|
||||
bool m_copyRow;
|
||||
unsigned char m_deletedBottomRow[40];
|
||||
};
|
||||
|
||||
class DeleteRowCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
DeleteRowCommand(TeletextDocument *, QUndoCommand *parent = 0);
|
||||
|
||||
void redo() override;
|
||||
void undo() override;
|
||||
|
||||
private:
|
||||
TeletextDocument *m_teletextDocument;
|
||||
int m_subPageIndex, m_row;
|
||||
unsigned char m_deletedRow[40];
|
||||
};
|
||||
|
||||
class SetColourCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
SetColourCommand(TeletextDocument *, int, int, QUndoCommand *parent = 0);
|
||||
|
||||
void redo() override;
|
||||
void undo() override;
|
||||
|
||||
private:
|
||||
TeletextDocument *m_teletextDocument;
|
||||
int m_subPageIndex, m_colourIndex, m_oldColour, m_newColour;
|
||||
};
|
||||
|
||||
class ResetCLUTCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
ResetCLUTCommand(TeletextDocument *, int, QUndoCommand *parent = 0);
|
||||
|
||||
void redo() override;
|
||||
void undo() override;
|
||||
|
||||
private:
|
||||
TeletextDocument *m_teletextDocument;
|
||||
int m_subPageIndex, m_colourTable;
|
||||
int m_oldColourEntry[8];
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user