18#ifndef TITLEBLOCK_SLASH_TEMPLATE_COMMANDS_H
19#define TITLEBLOCK_SLASH_TEMPLATE_COMMANDS_H
20#define MODIFY_TITLE_BLOCK_CELL_COMMAND_ID 6378
21#include "../titleblockcell.h"
25#include <QUndoCommand>
44 int id()
const override;
45 bool mergeWith(
const QUndoCommand *)
override;
113 QList<TitleBlockCell *>
cells()
const;
114 void setCells(
const QList<TitleBlockCell *> &);
121 void undo()
override;
122 void redo()
override;
126 void apply(
bool =
false);
159 void undo()
override;
160 void redo()
override;
188 void undo()
override;
189 void redo()
override;
222 void undo()
override;
223 void redo()
override;
250 void undo()
override;
251 void redo()
override;
276 void undo()
override;
277 void redo()
override;
278 virtual void setCutCells(
const QList<TitleBlockCell *> &);
285 QHash<TitleBlockCell *, TitleBlockCell::TemplateCellType>
cut_cells_;
301 void undo()
override;
302 void redo()
override;
Definition templatecommands.h:266
virtual void setCutCells(const QList< TitleBlockCell * > &)
Definition templatecommands.cpp:961
void redo() override
Definition templatecommands.cpp:953
virtual void updateText()
Definition templatecommands.cpp:971
CutTemplateCellsCommand(const CutTemplateCellsCommand &)
void undo() override
Definition templatecommands.cpp:942
QHash< TitleBlockCell *, TitleBlockCell::TemplateCellType > cut_cells_
Cut cells.
Definition templatecommands.h:285
~CutTemplateCellsCommand() override
Definition templatecommands.cpp:935
Definition templatecommands.h:178
QHash< TitleBlockCell *, TitleBlockCell * > spanner_cells_before_merge_
Definition templatecommands.h:199
int col_span_after_
the col_span attribute of the spanning cell after the merge
Definition templatecommands.h:206
static bool canMerge(const TitleBlockTemplateCellsSet &, TitleBlockTemplate *)
Definition templatecommands.cpp:673
int span_state_before_
the span_state attribute of the spanning cell before the merge
Definition templatecommands.h:204
int applied_row_span_before_
the applied_row_span attribute of the spanning cell before the merge
Definition templatecommands.h:202
TitleBlockCell * spanning_cell_
the cell spanning over the other ones
Definition templatecommands.h:196
~MergeCellsCommand() override
Definition templatecommands.cpp:664
int applied_col_span_before_
the applied_col_span attribute of the spanning cell before the merge
Definition templatecommands.h:203
void redo() override
Definition templatecommands.cpp:723
static TitleBlockCell * getBottomRightCell(const TitleBlockTemplateCellsSet &)
Definition templatecommands.cpp:747
void undo() override
Definition templatecommands.cpp:701
int row_span_after_
the row_span attribute of the spanning cell after the merge
Definition templatecommands.h:205
int col_span_before_
the col_span attribute of the spanning cell before the merge
Definition templatecommands.h:201
bool isValid() const
Definition templatecommands.cpp:692
int row_span_before_
the row_span attribute of the spanning cell before the merge
Definition templatecommands.h:200
Definition templatecommands.h:141
TitleBlockDimension before_
Size of the row/column before it is changed.
Definition templatecommands.h:170
~ModifyTemplateDimension() override
Definition templatecommands.cpp:497
void apply(const TitleBlockDimension &)
Definition templatecommands.cpp:596
int type() const
Definition templatecommands.cpp:520
void setType(bool)
Definition templatecommands.cpp:529
TitleBlockDimension dimensionAfter() const
Definition templatecommands.cpp:552
void redo() override
Definition templatecommands.cpp:575
int index() const
Definition templatecommands.cpp:504
void undo() override
Definition templatecommands.cpp:567
void updateText()
Definition templatecommands.cpp:583
ModifyTemplateDimension(const ModifyTemplateDimension &)
void setIndex(int)
Definition templatecommands.cpp:513
int index_
Index of the resized row/column.
Definition templatecommands.h:168
TitleBlockDimension after_
Size of the row/column after it is changed.
Definition templatecommands.h:171
void setDimensionBefore(const TitleBlockDimension &)
Definition templatecommands.cpp:545
bool type_
true for a row, false for a column
Definition templatecommands.h:169
TitleBlockDimension dimensionBefore() const
Definition templatecommands.cpp:537
void setDimensionAfter(const TitleBlockDimension &)
Definition templatecommands.cpp:560
Definition templatecommands.h:94
void setInsertion(bool)
Definition templatecommands.cpp:409
TitleBlockDimension dimension_
width/height of the column/row, which interpretation depends on type_
Definition templatecommands.h:133
void setIndex(int)
Definition templatecommands.cpp:345
static ModifyTemplateGridCommand * deleteColumn(TitleBlockTemplate *, int=-1)
Definition templatecommands.cpp:299
QList< TitleBlockCell * > cells() const
Definition templatecommands.cpp:352
static ModifyTemplateGridCommand * addRow(TitleBlockTemplate *, int=-1)
Definition templatecommands.cpp:238
void redo() override
Definition templatecommands.cpp:425
TitleBlockDimension dimension() const
Definition templatecommands.cpp:368
ModifyTemplateGridCommand(const ModifyTemplateGridCommand &)
static ModifyTemplateGridCommand * addColumn(TitleBlockTemplate *, int=-1)
Definition templatecommands.cpp:259
void undo() override
Definition templatecommands.cpp:417
void setCells(const QList< TitleBlockCell * > &)
Definition templatecommands.cpp:361
int index() const
Definition templatecommands.cpp:336
QList< TitleBlockCell * > cells_
Cells composing the inserted/deleted row/column.
Definition templatecommands.h:131
void setDimension(const TitleBlockDimension &)
Definition templatecommands.cpp:377
bool insertion_
Definition templatecommands.h:134
void apply(bool=false)
Definition templatecommands.cpp:455
void setType(bool)
Definition templatecommands.cpp:393
int type() const
Definition templatecommands.cpp:384
int index_
Index of the inserted/deleted row/column.
Definition templatecommands.h:130
bool type_
true for a row, false for a column
Definition templatecommands.h:132
static ModifyTemplateGridCommand * deleteRow(TitleBlockTemplate *, int=-1)
Definition templatecommands.cpp:280
bool isInsertion() const
Definition templatecommands.cpp:401
void updateText()
Definition templatecommands.cpp:433
~ModifyTemplateGridCommand() override
Definition templatecommands.cpp:329
Definition templatecommands.h:34
void addModification(const QString &, const QVariant &, bool=false)
Definition templatecommands.cpp:146
ModifyTitleBlockCellCommand(const ModifyTitleBlockCellCommand &)
void redo() override
Definition templatecommands.cpp:88
void setCell(TitleBlockCell *)
Definition templatecommands.cpp:109
bool mergeWith(const QUndoCommand *) override
Definition templatecommands.cpp:60
void clear()
Definition templatecommands.cpp:132
TitleBlockTemplateView * view() const
Definition templatecommands.cpp:116
TitleBlockTemplateView * view_
This class may trigger a view update.
Definition templatecommands.h:57
~ModifyTitleBlockCellCommand() override
Definition templatecommands.cpp:42
TitleBlockCell * cell() const
Definition templatecommands.cpp:100
QHash< QString, QVariant > new_values_
values after the cell has been modified
Definition templatecommands.h:60
TitleBlockCell * modified_cell_
modified cell
Definition templatecommands.h:58
void setView(TitleBlockTemplateView *)
Definition templatecommands.cpp:125
void undo() override
Definition templatecommands.cpp:76
QHash< QString, QVariant > old_values_
values before the cell is modified
Definition templatecommands.h:59
int id() const override
Definition templatecommands.cpp:50
Definition templatecommands.h:291
~PasteTemplateCellsCommand() override
Definition templatecommands.cpp:990
void redo() override
Definition templatecommands.cpp:1024
PasteTemplateCellsCommand(const PasteTemplateCellsCommand &)
void undo() override
Definition templatecommands.cpp:1005
QHash< TitleBlockCell *, TitleBlockCell > pasted_cells_
Pasted cells.
Definition templatecommands.h:314
QHash< TitleBlockCell *, TitleBlockCell > erased_cells_
Existing cells impacted by the paste operation.
Definition templatecommands.h:316
QHash< TitleBlockCell *, QPair< int, int > > spans_before_
Spans before operation.
Definition templatecommands.h:312
virtual void updateText()
Definition templatecommands.cpp:997
virtual void addCell(TitleBlockCell *, const TitleBlockCell &, const TitleBlockCell &)
Definition templatecommands.cpp:1107
virtual void addErasedCell(TitleBlockCell *, const TitleBlockCell &)
Definition templatecommands.cpp:1097
virtual void addPastedCell(TitleBlockCell *, const TitleBlockCell &)
Definition templatecommands.cpp:1089
Definition templatecommands.h:212
int span_state_before_
the span_state attribute of the spanning cell before splitting
Definition templatecommands.h:233
void undo() override
Definition templatecommands.cpp:845
QSet< TitleBlockCell * > spanned_cells_
the spanned cells
Definition templatecommands.h:228
TitleBlockCell * spanning_cell_
the cell spanning over the other ones
Definition templatecommands.h:227
int applied_row_span_before_
the applied_row_span attribute of the spanning cell before splitting
Definition templatecommands.h:231
static bool canSplit(const TitleBlockTemplateCellsSet &splitted_cells, TitleBlockTemplate *tbtemplate)
Definition templatecommands.cpp:817
void redo() override
Definition templatecommands.cpp:867
bool isValid() const
Definition templatecommands.cpp:836
~SplitCellsCommand() override
Definition templatecommands.cpp:808
int applied_col_span_before_
the applied_col_span attribute of the spanning cell before splitting
Definition templatecommands.h:232
int col_span_before_
the col_span attribute of the spanning cell before splitting
Definition templatecommands.h:230
int row_span_before_
the row_span attribute of the spanning cell before splitting
Definition templatecommands.h:229
Definition titleblockcell.h:26
Definition templatecellsset.h:28
Definition templatecommands.h:67
void setView(TitleBlockTemplateView *)
Definition templatecommands.cpp:209
TitleBlockTemplate * tbtemplate_
Modified TitleBlock Template.
Definition templatecommands.h:86
void refreshView()
Definition templatecommands.cpp:216
void refreshLayout()
Definition templatecommands.cpp:225
TitleBlockTemplateView * view_
This class may trigger a view update.
Definition templatecommands.h:87
TitleBlockTemplateCommand(const TitleBlockTemplateCommand &)
void setTitleBlockTemplate(TitleBlockTemplate *)
Definition templatecommands.cpp:193
TitleBlockTemplate * titleBlockTemplate() const
Definition templatecommands.cpp:184
TitleBlockTemplateView * view() const
Definition templatecommands.cpp:200
~TitleBlockTemplateCommand() override
Definition templatecommands.cpp:177
The TitleBlockTemplate class This class represents an title block template for an electric diagram....
Definition titleblocktemplate.h:37
Definition templateview.h:33
Definition dimension.h:26