18 #ifndef TITLEBLOCK_SLASH_TEMPLATE_COMMANDS_H 19 #define TITLEBLOCK_SLASH_TEMPLATE_COMMANDS_H 20 #define MODIFY_TITLE_BLOCK_CELL_COMMAND_ID 6378 22 #include <QUndoCommand> 43 int id()
const override;
44 bool mergeWith(
const QUndoCommand *)
override;
112 QList<TitleBlockCell *>
cells()
const;
113 void setCells(
const QList<TitleBlockCell *> &);
120 void undo()
override;
121 void redo()
override;
125 void apply(
bool =
false);
158 void undo()
override;
159 void redo()
override;
187 void undo()
override;
188 void redo()
override;
221 void undo()
override;
222 void redo()
override;
249 void undo()
override;
250 void redo()
override;
275 void undo()
override;
276 void redo()
override;
277 virtual void setCutCells(
const QList<TitleBlockCell *> &);
284 QHash<TitleBlockCell *, TitleBlockCell::TemplateCellType>
cut_cells_;
300 void undo()
override;
301 void redo()
override;
int applied_col_span_before_
the applied_col_span attribute of the spanning cell before the merge
void setDimensionAfter(const TitleBlockDimension &)
QList< TitleBlockCell * > cells_
Cells composing the inserted/deleted row/column.
virtual void updateText()
TitleBlockCell * spanning_cell_
the cell spanning over the other ones
void setDimension(const TitleBlockDimension &)
~SplitCellsCommand() override
TitleBlockTemplateCommand(TitleBlockTemplate *=nullptr, QUndoCommand *=nullptr)
~PasteTemplateCellsCommand() override
TitleBlockTemplate * tbtemplate_
Modified TitleBlock Template.
virtual void updateText()
TitleBlockDimension after_
Size of the row/column after it is changed.
TitleBlockTemplate * titleBlockTemplate() const
QHash< TitleBlockCell *, TitleBlockCell::TemplateCellType > cut_cells_
Cut cells.
int col_span_before_
the col_span attribute of the spanning cell before the merge
int row_span_before_
the row_span attribute of the spanning cell before the merge
void setCell(TitleBlockCell *)
QHash< TitleBlockCell *, TitleBlockCell > erased_cells_
Existing cells impacted by the paste operation.
QHash< TitleBlockCell *, TitleBlockCell > pasted_cells_
Pasted cells.
int span_state_before_
the span_state attribute of the spanning cell before splitting
void setView(TitleBlockTemplateView *)
TitleBlockCell * modified_cell_
modified cell
bool mergeWith(const QUndoCommand *) override
QHash< QString, QVariant > new_values_
values after the cell has been modified
int index_
Index of the inserted/deleted row/column.
virtual void addErasedCell(TitleBlockCell *, const TitleBlockCell &)
TitleBlockTemplateView * view() const
ModifyTitleBlockCellCommand(TitleBlockCell *, QUndoCommand *=nullptr)
static bool canMerge(const TitleBlockTemplateCellsSet &, TitleBlockTemplate *)
void setDimensionBefore(const TitleBlockDimension &)
int applied_col_span_before_
the applied_col_span attribute of the spanning cell before splitting
void setView(TitleBlockTemplateView *)
static bool canSplit(const TitleBlockTemplateCellsSet &splitted_cells, TitleBlockTemplate *tbtemplate)
int applied_row_span_before_
the applied_row_span attribute of the spanning cell before the merge
~TitleBlockTemplateCommand() override
virtual void setCutCells(const QList< TitleBlockCell *> &)
int applied_row_span_before_
the applied_row_span attribute of the spanning cell before splitting
TitleBlockTemplateView * view() const
TitleBlockDimension dimension() const
QHash< TitleBlockCell *, TitleBlockCell * > spanner_cells_before_merge_
CutTemplateCellsCommand(TitleBlockTemplate *, QUndoCommand *=nullptr)
bool type_
true for a row, false for a column
TitleBlockDimension dimension_
width/height of the column/row, which interpretation depends on type_
QHash< QString, QVariant > old_values_
values before the cell is modified
~ModifyTemplateDimension() override
int span_state_before_
the span_state attribute of the spanning cell before the merge
int row_span_before_
the row_span attribute of the spanning cell before splitting
PasteTemplateCellsCommand(TitleBlockTemplate *, QUndoCommand *=nullptr)
~MergeCellsCommand() override
static TitleBlockCell * getBottomRightCell(const TitleBlockTemplateCellsSet &)
int row_span_after_
the row_span attribute of the spanning cell after the merge
void setCells(const QList< TitleBlockCell *> &)
static ModifyTemplateGridCommand * deleteRow(TitleBlockTemplate *, int=-1)
~ModifyTitleBlockCellCommand() override
static ModifyTemplateGridCommand * addRow(TitleBlockTemplate *, int=-1)
void apply(const TitleBlockDimension &)
int col_span_after_
the col_span attribute of the spanning cell after the merge
MergeCellsCommand(const TitleBlockTemplateCellsSet &, TitleBlockTemplate *=nullptr, QUndoCommand *=nullptr)
static ModifyTemplateGridCommand * deleteColumn(TitleBlockTemplate *, int=-1)
ModifyTemplateGridCommand(TitleBlockTemplate *=nullptr, QUndoCommand *=nullptr)
static ModifyTemplateGridCommand * addColumn(TitleBlockTemplate *, int=-1)
QSet< TitleBlockCell * > spanned_cells_
the spanned cells
bool type_
true for a row, false for a column
~ModifyTemplateGridCommand() override
void setTitleBlockTemplate(TitleBlockTemplate *)
virtual void addPastedCell(TitleBlockCell *, const TitleBlockCell &)
TitleBlockDimension before_
Size of the row/column before it is changed.
virtual void addCell(TitleBlockCell *, const TitleBlockCell &, const TitleBlockCell &)
SplitCellsCommand(const TitleBlockTemplateCellsSet &, TitleBlockTemplate *=nullptr, QUndoCommand *=nullptr)
TitleBlockTemplateView * view_
This class may trigger a view update.
~CutTemplateCellsCommand() override
ModifyTemplateDimension(TitleBlockTemplate *=nullptr, QUndoCommand *=nullptr)
int col_span_before_
the col_span attribute of the spanning cell before splitting
TitleBlockTemplateView * view_
This class may trigger a view update.
TitleBlockDimension dimensionAfter() const
QList< TitleBlockCell * > cells() const
TitleBlockDimension dimensionBefore() const
TitleBlockCell * spanning_cell_
the cell spanning over the other ones
int index_
Index of the resized row/column.
TitleBlockCell * cell() const
void addModification(const QString &, const QVariant &, bool=false)
QHash< TitleBlockCell *, QPair< int, int > > spans_before_
Spans before operation.