QElectroTech  0.8-dev
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ModifyTemplateGridCommand Class Reference

#include <templatecommands.h>

Inheritance diagram for ModifyTemplateGridCommand:
Inheritance graph
Collaboration diagram for ModifyTemplateGridCommand:
Collaboration graph

Public Member Functions

 ModifyTemplateGridCommand (TitleBlockTemplate *=nullptr, QUndoCommand *=nullptr)
 
 ~ModifyTemplateGridCommand () override
 
int index () const
 
void setIndex (int)
 
QList< TitleBlockCell * > cells () const
 
void setCells (const QList< TitleBlockCell * > &)
 
TitleBlockDimension dimension () const
 
void setDimension (const TitleBlockDimension &)
 
int type () const
 
void setType (bool)
 
bool isInsertion () const
 
void setInsertion (bool)
 
void undo () override
 
void redo () override
 
- Public Member Functions inherited from TitleBlockTemplateCommand
 TitleBlockTemplateCommand (TitleBlockTemplate *=nullptr, QUndoCommand *=nullptr)
 
 ~TitleBlockTemplateCommand () override
 
TitleBlockTemplatetitleBlockTemplate () const
 
void setTitleBlockTemplate (TitleBlockTemplate *)
 
TitleBlockTemplateViewview () const
 
void setView (TitleBlockTemplateView *)
 
void refreshView ()
 
void refreshLayout ()
 

Static Public Member Functions

static ModifyTemplateGridCommandaddRow (TitleBlockTemplate *, int=-1)
 
static ModifyTemplateGridCommandaddColumn (TitleBlockTemplate *, int=-1)
 
static ModifyTemplateGridCommanddeleteRow (TitleBlockTemplate *, int=-1)
 
static ModifyTemplateGridCommanddeleteColumn (TitleBlockTemplate *, int=-1)
 

Private Member Functions

 ModifyTemplateGridCommand (const ModifyTemplateGridCommand &)
 
void updateText ()
 
void apply (bool=false)
 

Private Attributes

int index_
 Index of the inserted/deleted row/column. More...
 
QList< TitleBlockCell * > cells_
 Cells composing the inserted/deleted row/column. More...
 
bool type_
 true for a row, false for a column More...
 
TitleBlockDimension dimension_
 width/height of the column/row, which interpretation depends on type_ More...
 
bool insertion_
 

Additional Inherited Members

- Protected Attributes inherited from TitleBlockTemplateCommand
TitleBlockTemplatetbtemplate_
 Modified TitleBlock Template. More...
 
TitleBlockTemplateViewview_
 This class may trigger a view update. More...
 

Detailed Description

This class represents the action of adding or deleting a row or column within a title block template.

Constructor & Destructor Documentation

◆ ModifyTemplateGridCommand() [1/2]

ModifyTemplateGridCommand::ModifyTemplateGridCommand ( TitleBlockTemplate tbtemplate = nullptr,
QUndoCommand *  parent = nullptr 
)

Construct a default ModifyTemplateGridCommand, i.e. a command adding a 25px row at the bottom of the template.

Parameters
tbtemplateModified title block template
parentParent QUndoCommand
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~ModifyTemplateGridCommand()

ModifyTemplateGridCommand::~ModifyTemplateGridCommand ( )
override

Destructor

◆ ModifyTemplateGridCommand() [2/2]

ModifyTemplateGridCommand::ModifyTemplateGridCommand ( const ModifyTemplateGridCommand )
private

Member Function Documentation

◆ addColumn()

ModifyTemplateGridCommand * ModifyTemplateGridCommand::addColumn ( TitleBlockTemplate tbtemplate,
int  index = -1 
)
static

This static method is a convenience to create a ModifyTemplateGridCommand that adds a column to tbtemplate at index.

Parameters
tbtemplateModified title block template.
indexIndex where the column should be inserted.
Returns
a ModifyTemplateGridCommand object, or 0 if something went wrong.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addRow()

ModifyTemplateGridCommand * ModifyTemplateGridCommand::addRow ( TitleBlockTemplate tbtemplate,
int  index = -1 
)
static

This static method is a convenience to create a ModifyTemplateGridCommand that adds a row to tbtemplate at index.

Parameters
tbtemplateModified title block template
indexIndex where the row should be inserted.
Returns
a ModifyTemplateGridCommand object, or 0 if something went wrong.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply()

void ModifyTemplateGridCommand::apply ( bool  undo = false)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cells()

QList< TitleBlockCell * > ModifyTemplateGridCommand::cells ( ) const
Returns
a list of pointers to cells composing the inserted/deleted row/column.
Here is the caller graph for this function:

◆ deleteColumn()

ModifyTemplateGridCommand * ModifyTemplateGridCommand::deleteColumn ( TitleBlockTemplate tbtemplate,
int  index = -1 
)
static

This static method is a convenience to create a ModifyTemplateGridCommand that removes the column at index from tbtemplate.

Parameters
tbtemplateModified title block template.
indexIndex of the removed column.
Returns
a ModifyTemplateGridCommand object, or 0 if something went wrong.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteRow()

ModifyTemplateGridCommand * ModifyTemplateGridCommand::deleteRow ( TitleBlockTemplate tbtemplate,
int  index = -1 
)
static

This static method is a convenience to create a ModifyTemplateGridCommand that removes the row at index from tbtemplate.

Parameters
tbtemplateModified title block template.
indexIndex of the removed row.
Returns
a ModifyTemplateGridCommand object, or 0 if something went wrong.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dimension()

TitleBlockDimension ModifyTemplateGridCommand::dimension ( ) const
Returns
the dimension of the inserted/deleted row/column.
Here is the caller graph for this function:

◆ index()

int ModifyTemplateGridCommand::index ( ) const
Returns
the index of the inserted/deleted row/column
Here is the caller graph for this function:

◆ isInsertion()

bool ModifyTemplateGridCommand::isInsertion ( ) const
Returns
true if the row/column is inserted, false if it is deleted

◆ redo()

void ModifyTemplateGridCommand::redo ( )
override

Redo the change.

Here is the call graph for this function:

◆ setCells()

void ModifyTemplateGridCommand::setCells ( const QList< TitleBlockCell * > &  cells)

Set the cells composing the inserted/deleted row/column.

Parameters
cellsList of pointers to cells composing the inserted/deleted row/column.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDimension()

void ModifyTemplateGridCommand::setDimension ( const TitleBlockDimension dimension)

Set the dimension of the inserted/deleted row/column

Parameters
dimensionDimension of the inserted/deleted row/column
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setIndex()

void ModifyTemplateGridCommand::setIndex ( int  index)

Set the index of the inserted/deleted row/column.

Parameters
indexIndex of the inserted/deleted row/column.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setInsertion()

void ModifyTemplateGridCommand::setInsertion ( bool  insertion)
Parameters
insertiontrue if the row/column is inserted, false if it is deleted
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setType()

void ModifyTemplateGridCommand::setType ( bool  type)

Indicates whether this object inserts/deletes a row or a column.

Parameters
typetrue if this object is about inserting/deleting a row, false for a column.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ type()

int ModifyTemplateGridCommand::type ( ) const
Returns
true if this object is about inserting/deleting a row, false for a column.
Here is the caller graph for this function:

◆ undo()

void ModifyTemplateGridCommand::undo ( )
override

Undo the change.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateText()

void ModifyTemplateGridCommand::updateText ( )
private

Update the text describing what the command does.

Here is the caller graph for this function:

Member Data Documentation

◆ cells_

QList<TitleBlockCell *> ModifyTemplateGridCommand::cells_
private

Cells composing the inserted/deleted row/column.

◆ dimension_

TitleBlockDimension ModifyTemplateGridCommand::dimension_
private

width/height of the column/row, which interpretation depends on type_

◆ index_

int ModifyTemplateGridCommand::index_
private

Index of the inserted/deleted row/column.

◆ insertion_

bool ModifyTemplateGridCommand::insertion_
private

◆ type_

bool ModifyTemplateGridCommand::type_
private

true for a row, false for a column


The documentation for this class was generated from the following files: