18#ifndef TITLEBLOCK_TEMPLATE_H
19#define TITLEBLOCK_TEMPLATE_H
77 bool insertRow(
int,
const QList<TitleBlockCell *> &,
int = -1);
78 QList<TitleBlockCell *>
takeRow(
int);
84 const QList<TitleBlockCell *> &,
int = -1);
91 QHash<TitleBlockCell *, QPair<int, int> >
getAllSpans()
const;
96 const QString & =
"svg",
97 const QString & =
"xml");
101 bool renameLogo(
const QString &,
const QString &);
103 QList<QString>
logos()
const;
104 QString
logoType(
const QString &)
const;
105 QSvgRenderer *
vectorLogo(
const QString &)
const;
118 const QRect &)
const;
130 bool loadLogos(
const QDomElement &,
bool =
false);
137 void saveLogo(
const QString &, QDomElement &)
const;
149 int lengthRange(
int,
int,
const QList<int> &)
const;
160 const QRectF &)
const;
Definition diagramcontext.h:57
Definition titleblockcell.h:26
The TitleBlockTemplate class This class represents an title block template for an electric diagram....
Definition titleblocktemplate.h:37
QString logoType(const QString &) const
TitleBlockTemplate::logoType.
Definition titleblocktemplate.cpp:1460
void exportCellToXml(TitleBlockCell *, QDomElement &) const
TitleBlockTemplate::exportCellToXml.
Definition titleblocktemplate.cpp:184
void applyRowColNums()
TitleBlockTemplate::applyRowColNums Ensure all cells have the right col+row numbers.
Definition titleblocktemplate.cpp:2088
int maximumWidth()
TitleBlockTemplate::maximumWidth.
Definition titleblocktemplate.cpp:989
QHash< QString, QString > storage_logos_
storage_logos_ : Logos applied storage type (e.g. "xml" or "base64")
Definition titleblocktemplate.h:187
int height() const
TitleBlockTemplate::height.
Definition titleblocktemplate.cpp:1016
QList< TitleBlockCell * > createRow()
TitleBlockTemplate::createRow.
Definition titleblocktemplate.cpp:1098
void applyCellSpan(TitleBlockCell *)
TitleBlockTemplate::applyCellSpan Ensure the spans of the provided cell are applied within the grid s...
Definition titleblocktemplate.cpp:2054
void saveGrid(QDomElement &) const
TitleBlockTemplate::saveGrid Export this template's cells grid as XML.
Definition titleblocktemplate.cpp:588
bool checkCell(const QDomElement &, TitleBlockCell **=nullptr)
TitleBlockTemplate::checkCell Load the essential attributes of a cell: row and column indices and spa...
Definition titleblocktemplate.cpp:672
QList< TitleBlockDimension > columns_width_
columns_width_ : columns widths –
Definition titleblocktemplate.h:207
bool loadFromXmlFile(const QString &)
TitleBlockTemplate::loadFromXmlFile Load a titleblock template from an XML file.
Definition titleblocktemplate.cpp:94
bool saveToXmlElement(QDomElement &) const
TitleBlockTemplate::saveToXmlElement Save the title block template as XML.
Definition titleblocktemplate.cpp:165
void forgetSpanning()
TitleBlockTemplate::forgetSpanning Set the spanner_cell attribute of every cell to 0.
Definition titleblocktemplate.cpp:1937
bool moveRow(int, int)
TitleBlockTemplate::moveRow Move a row within this template.
Definition titleblocktemplate.cpp:1032
void renderTextCell(QPainter &, const QString &, const TitleBlockCell &, const QRectF &) const
TitleBlockTemplate::renderTextCell This method uses a painter to render the text of a cell into the c...
Definition titleblocktemplate.cpp:1792
void applyCellSpans()
TitleBlockTemplate::applyCellSpans Forget any previously applied span, then apply again all spans def...
Definition titleblocktemplate.cpp:1975
bool renameLogo(const QString &, const QString &)
TitleBlockTemplate::renameLogo Rename the logo_name logo to new_name.
Definition titleblocktemplate.cpp:1408
QList< int > rows_heights_
rows heights – simple integers
Definition titleblocktemplate.h:202
bool addLogo(const QString &, QByteArray *, const QString &="svg", const QString &="xml")
TitleBlockTemplate::addLogo.
Definition titleblocktemplate.cpp:1278
TitleBlockCell * cell(int, int) const
TitleBlockTemplate::cell.
Definition titleblocktemplate.cpp:1179
void renderTextCellDxf(QString &, const QString &, const TitleBlockCell &, qreal, qreal, qreal, qreal, int) const
TitleBlockTemplate::renderTextCellDxf.
Definition titleblocktemplate.cpp:1847
QString name_
name_ : name identifying the Title Block Template within its parent collection
Definition titleblocktemplate.h:177
bool moveColumn(int, int)
TitleBlockTemplate::moveColumn Move the column at index "from" to index "to".
Definition titleblocktemplate.cpp:1110
bool loadLogos(const QDomElement &, bool=false)
TitleBlockTemplate::loadLogos Import the logos from a given XML titleblock template.
Definition titleblocktemplate.cpp:280
QList< TitleBlockCell * > registered_cells_
registered_cells_ : Cells objects created rattached to this template, but not mandatorily used
Definition titleblocktemplate.h:212
int minimumWidth()
Definition titleblocktemplate.cpp:963
void initCells()
TitleBlockTemplate::initCells Initialize the internal cells grid with the row and column counts....
Definition titleblocktemplate.cpp:733
QHash< TitleBlockCell *, QPair< int, int > > getAllSpans() const
TitleBlockTemplate::getAllSpans Export the span parameters of all cell in the current grid.
Definition titleblocktemplate.cpp:1237
void setAllSpans(const QHash< TitleBlockCell *, QPair< int, int > > &)
TitleBlockTemplate::setAllSpans Restore a set of span parameters.
Definition titleblocktemplate.cpp:1260
QHash< QString, QByteArray > data_logos_
data_logos_ : Logos raw data
Definition titleblocktemplate.h:182
QString finalTextForCell(const TitleBlockCell &, const DiagramContext &) const
TitleBlockTemplate::finalTextForCell.
Definition titleblocktemplate.cpp:1709
QList< int > rowsHeights() const
TitleBlockTemplate::rowsHeights.
Definition titleblocktemplate.cpp:923
QStringList listOfVariables()
TitleBlockTemplate::listOfVariables Get list of variables.
Definition titleblocktemplate.cpp:1756
bool checkCellSpan(TitleBlockCell *)
TitleBlockTemplate::checkCellSpan Check whether a given cell can be spanned according to its row_span...
Definition titleblocktemplate.cpp:1998
void loadInformation(const QDomElement &)
TitleBlockTemplate::loadInformation Import text informations from a given XML title block template.
Definition titleblocktemplate.cpp:262
void parseColumns(const QString &)
TitleBlockTemplate::parseColumns Parse the columns widths.
Definition titleblocktemplate.cpp:428
void parseRows(const QString &)
TitleBlockTemplate::parseRows Parse the rows heights.
Definition titleblocktemplate.cpp:389
bool loadGrid(const QDomElement &)
Definition titleblocktemplate.cpp:357
void loadCell(const QDomElement &)
TitleBlockTemplate::loadCell Load a cell into this template.
Definition titleblocktemplate.cpp:509
QHash< QString, QSvgRenderer * > vector_logos_
vector_logos_ : Rendered objects for vector logos
Definition titleblocktemplate.h:196
bool insertColumn(const TitleBlockDimension &, const QList< TitleBlockCell * > &, int=-1)
TitleBlockTemplate::insertColumn.
Definition titleblocktemplate.cpp:1137
static QFont fontForCell(const TitleBlockCell &)
TitleBlockTemplate::fontForCell.
Definition titleblocktemplate.cpp:84
TitleBlockTemplate(const TitleBlockTemplate &)
int rowDimension(int)
TitleBlockTemplate::rowDimension.
Definition titleblocktemplate.cpp:779
int width(int)
TitleBlockTemplate::width.
Definition titleblocktemplate.cpp:1004
QString name() const
TitleBlockTemplate::name.
Definition titleblocktemplate.cpp:752
void render(QPainter &, const DiagramContext &, int) const
TitleBlockTemplate::render Render the titleblock.
Definition titleblocktemplate.cpp:1508
void rowColsChanged()
TitleBlockTemplate::rowColsChanged Take care of consistency and span-related problematics when adding...
Definition titleblocktemplate.cpp:2103
void saveCell(TitleBlockCell *, QDomElement &, bool=false) const
TitleBlockTemplate::saveCell Export a specific cell as XML.
Definition titleblocktemplate.cpp:634
~TitleBlockTemplate() override
TitleBlockTemplate::~TitleBlockTemplate Destructor.
Definition titleblocktemplate.cpp:43
QString interpreteVariables(const QString &, const DiagramContext &) const
TitleBlockTemplate::interpreteVariables.
Definition titleblocktemplate.cpp:1736
int columnTypeTotal(QET::TitleBlockColumnLength)
TitleBlockTemplate::columnTypeTotal.
Definition titleblocktemplate.cpp:948
QString information_
Definition titleblocktemplate.h:178
void setColumnDimension(int, const TitleBlockDimension &)
TitleBlockTemplate::setColumnDimension Set the width of a column.
Definition titleblocktemplate.cpp:820
TitleBlockCell * createCell(const TitleBlockCell *=nullptr)
TitleBlockTemplate::createCell Create a new cell and associate it with this template,...
Definition titleblocktemplate.cpp:56
int rowsCount() const
TitleBlockTemplate::rowsCount.
Definition titleblocktemplate.cpp:842
void saveInformation(QDomElement &) const
TitleBlockTemplate::saveInformation Export this template's extra information.
Definition titleblocktemplate.cpp:521
QList< TitleBlockCell * > createCellsList(int)
TitleBlockTemplate::createCellsList.
Definition titleblocktemplate.cpp:72
QSet< TitleBlockCell * > spannedCells(const TitleBlockCell *, bool=false) const
TitleBlockTemplate::spannedCells.
Definition titleblocktemplate.cpp:1198
int columnsCount() const
TitleBlockTemplate::columnsCount.
Definition titleblocktemplate.cpp:833
void setRowDimension(int, const TitleBlockDimension &)
TitleBlockTemplate::setRowDimension Set the height of a row.
Definition titleblocktemplate.cpp:793
TitleBlockTemplate * clone() const
TitleBlockTemplate::clone.
Definition titleblocktemplate.cpp:196
QList< int > columnsWidth(int) const
TitleBlockTemplate::columnsWidth.
Definition titleblocktemplate.cpp:852
QList< QString > logos() const
TitleBlockTemplate::logos.
Definition titleblocktemplate.cpp:1448
bool removeLogo(const QString &)
TitleBlockTemplate::removeLogo.
Definition titleblocktemplate.cpp:1382
void setLogoStorage(const QString &, const QString &)
TitleBlockTemplate::setLogoStorage Set the kind of storage for the logo_name logo.
Definition titleblocktemplate.cpp:1437
QHash< QString, QPixmap > bitmap_logos_
bitmap_logos_ : Pixmaps for bitmap logos
Definition titleblocktemplate.h:200
void saveLogo(const QString &, QDomElement &) const
TitleBlockTemplate::saveLogo Export a specific logo as XML.
Definition titleblocktemplate.cpp:557
int columnTypeCount(QET::TitleBlockColumnLength)
TitleBlockTemplate::columnTypeCount.
Definition titleblocktemplate.cpp:933
TitleBlockDimension columnDimension(int)
TitleBlockTemplate::columnDimension.
Definition titleblocktemplate.cpp:806
QHash< QString, QString > type_logos_
type_logos_ : Logos types (e.g. "png", "jpeg", "svg")
Definition titleblocktemplate.h:192
QSvgRenderer * vectorLogo(const QString &) const
TitleBlockTemplate::vectorLogo.
Definition titleblocktemplate.cpp:1475
QList< QList< TitleBlockCell * > > cells_
Cells grid.
Definition titleblocktemplate.h:213
QString information() const
TitleBlockTemplate::information.
Definition titleblocktemplate.cpp:761
void renderDxf(QRectF &, const DiagramContext &, int, QString &, int) const
TitleBlockTemplate::renderDxf Render the titleblock in DXF.
Definition titleblocktemplate.cpp:1570
bool loadLogo(const QDomElement &)
TitleBlockTemplate::loadLogo Import the logo from a given XML logo description.
Definition titleblocktemplate.cpp:319
bool loadCells(const QDomElement &)
TitleBlockTemplate::loadCells Analyze an XML element, looking for grid cells. The grid cells are chec...
Definition titleblocktemplate.cpp:487
void addRow(int=-1)
TitleBlockTemplate::addRow Add a new 25px-wide row at the provided index.
Definition titleblocktemplate.cpp:1049
void saveLogos(QDomElement &) const
TitleBlockTemplate::saveLogos Export this template's logos as XML.
Definition titleblocktemplate.cpp:538
QPixmap bitmapLogo(const QString &) const
TitleBlockTemplate::bitmapLogo.
Definition titleblocktemplate.cpp:1490
void addColumn(int=-1)
TitleBlockTemplate::addColumn Add a new 50px-wide column at the provided index.
Definition titleblocktemplate.cpp:1125
QList< TitleBlockCell * > takeColumn(int)
TitleBlockTemplate::takeColumn Removes the column at index i.
Definition titleblocktemplate.cpp:1153
bool loadFromXmlElement(const QDomElement &)
TitleBlockTemplate::loadFromXmlElement.
Definition titleblocktemplate.cpp:121
int lengthRange(int, int, const QList< int > &) const
TitleBlockTemplate::lengthRange.
Definition titleblocktemplate.cpp:2118
QList< TitleBlockCell * > createColumn()
TitleBlockTemplate::createColumn.
Definition titleblocktemplate.cpp:1168
bool saveToXmlFile(const QString &)
TitleBlockTemplate::saveToXmlFile Save the title block template into an XML file.
Definition titleblocktemplate.cpp:145
void saveCells(QDomElement &) const
TitleBlockTemplate::saveCells Export this template's cells as XML (without the grid-related informati...
Definition titleblocktemplate.cpp:613
void renderCell(QPainter &, const TitleBlockCell &, const DiagramContext &, const QRect &) const
TitleBlockTemplate::renderCell Render a titleblock cell.
Definition titleblocktemplate.cpp:1657
QList< TitleBlockCell * > takeRow(int)
TitleBlockTemplate::takeRow Removes the row at index i.
Definition titleblocktemplate.cpp:1082
bool saveLogoToFile(const QString &, const QString &)
TitleBlockTemplate::saveLogoToFile.
Definition titleblocktemplate.cpp:1361
bool insertRow(int, const QList< TitleBlockCell * > &, int=-1)
TitleBlockTemplate::insertRow.
Definition titleblocktemplate.cpp:1063
void setInformation(const QString &)
TitleBlockTemplate::setInformation.
Definition titleblocktemplate.cpp:770
bool addLogoFromFile(const QString &, const QString &=QString())
TitleBlockTemplate::addLogoFromFile.
Definition titleblocktemplate.cpp:1332
TitleBlockColumnLength
enum used to specify the type of a length
Definition qet.h:141
Definition dimension.h:26