QElectroTech  0.8-dev
titleblockcell.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef TITLEBLOCK_CELL_H
19 #define TITLEBLOCK_CELL_H
20 #include "nameslist.h"
21 
27  public:
31  LogoCell
32  };
36  Restricted
37  };
38 
39  // Constructor, destructor
40  public:
42  virtual ~TitleBlockCell();
43 
44  // methods
45  public:
46  TemplateCellType type() const;
47  int horizontalAlign() const;
48  int verticalAlign() const;
49  void setAttribute(const QString &, const QVariant &);
50  QVariant attribute(const QString &);
51  static QString attributeName(const QString &);
52  bool spans() const;
53  void loadContentFromCell(const TitleBlockCell &);
54  void loadContentFromXml(const QDomElement &);
55  void saveContentToXml(QDomElement &);
56 
57 
58  // attributes
59  public:
61  int num_row;
62  int num_col;
63  int row_span;
64  int col_span;
65  int span_state;
69  QString value_name;
73  int alignment;
74  int font_size;
75  bool hadjust;
76  QString logo_reference;
77 };
78 #endif
TitleBlockCell::hadjust
bool hadjust
Whether to reduce the font size if the text does not fit in the cell.
Definition: titleblockcell.h:75
nameslist.h
TitleBlockCell::saveContentToXml
void saveContentToXml(QDomElement &)
TitleBlockCell::saveContentToXml.
Definition: titleblockcell.cpp:223
TitleBlockCell::num_col
int num_col
x coordinate of the cell within its parent title block template grid
Definition: titleblockcell.h:62
TitleBlockCell::verticalAlign
int verticalAlign() const
Definition: titleblockcell.cpp:43
TitleBlockCell::horizontalAlign
int horizontalAlign() const
Definition: titleblockcell.cpp:36
TitleBlockCell::loadContentFromXml
void loadContentFromXml(const QDomElement &)
Definition: titleblockcell.cpp:157
TitleBlockCell::TemplateCellType
TemplateCellType
Definition: titleblockcell.h:28
TitleBlockCell::TextCell
@ TextCell
Definition: titleblockcell.h:30
TitleBlockCell::attribute
QVariant attribute(const QString &)
Definition: titleblockcell.cpp:81
TitleBlockTemplate::fontForCell
static QFont fontForCell(const TitleBlockCell &)
TitleBlockTemplate::fontForCell.
Definition: titleblocktemplate.cpp:80
TitleBlockCell::loadContentFromCell
void loadContentFromCell(const TitleBlockCell &)
Definition: titleblockcell.cpp:142
TitleBlockCell::value
NamesList value
Text displayed by the cell.
Definition: titleblockcell.h:70
TitleBlockCell::Disabled
@ Disabled
the cell span parameters should not applied at all
Definition: titleblockcell.h:34
TitleBlockCell::EmptyCell
@ EmptyCell
Definition: titleblockcell.h:29
TitleBlockCell::type
TemplateCellType type() const
Definition: titleblockcell.cpp:29
TitleBlockCell::span_state
int span_state
how should row_span and col_span be applied given other cells in the parent template
Definition: titleblockcell.h:65
titleblockcell.h
TitleBlockCell::label
NamesList label
Label displayed by the cell.
Definition: titleblockcell.h:71
TitleBlockCell::col_span
int col_span
number of extra columns spanned by this cell
Definition: titleblockcell.h:64
NamesList::name
QString name(const QString &=QString()) const
Definition: nameslist.cpp:231
TitleBlockCell::display_label
bool display_label
Whether to display the label or not.
Definition: titleblockcell.h:72
TitleBlockCell::Enabled
@ Enabled
the cell span parameters should be applied without restriction
Definition: titleblockcell.h:35
TitleBlockCell::num_row
int num_row
y coordinate of the cell within its parent title block template grid
Definition: titleblockcell.h:61
TitleBlockCell::setAttribute
void setAttribute(const QString &, const QVariant &)
Definition: titleblockcell.cpp:52
TitleBlockCell::LogoCell
@ LogoCell
Definition: titleblockcell.h:31
NamesList::fromXml
void fromXml(const QDomElement &, const QHash< QString, QString > &=QHash< QString, QString >())
Definition: nameslist.cpp:113
NamesList
Definition: nameslist.h:30
TitleBlockCell::row_span
int row_span
number of extra rows spanned by this cell
Definition: titleblockcell.h:63
TitleBlockCell::attributeName
static QString attributeName(const QString &)
Definition: titleblockcell.cpp:108
TitleBlockCell::spanner_cell
TitleBlockCell * spanner_cell
Cell spanning this cell, if any.
Definition: titleblockcell.h:68
TitleBlockCell::spans
bool spans() const
Definition: titleblockcell.cpp:134
QET::attributeIsAnInteger
bool attributeIsAnInteger(const QDomElement &, const QString &, int *=nullptr)
Definition: qet.cpp:210
TitleBlockCell::cell_type
TemplateCellType cell_type
Cell type: empty, text, logo?
Definition: titleblockcell.h:60
TitleBlockCell::value_name
QString value_name
name of the cell; not displayed when the title block template is rendered
Definition: titleblockcell.h:69
TitleBlockCell::TitleBlockCell
TitleBlockCell()
Definition: titleblockcell.cpp:6
TitleBlockCell::applied_row_span
int applied_row_span
Actually applied row span.
Definition: titleblockcell.h:66
TitleBlockCell::TemplateCellSpanState
TemplateCellSpanState
Definition: titleblockcell.h:33
titleblocktemplate.h
TitleBlockCell::Restricted
@ Restricted
the cell span parameters should be applied with some restrictions
Definition: titleblockcell.h:36
TitleBlockCell::font_size
int font_size
Font size the text should be rendered with.
Definition: titleblockcell.h:74
NamesList::toXml
QDomElement toXml(QDomDocument &, const QHash< QString, QString > &=QHash< QString, QString >()) const
Definition: nameslist.cpp:169
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
TitleBlockCell::applied_col_span
int applied_col_span
Actually applied column span.
Definition: titleblockcell.h:67
TitleBlockCell::~TitleBlockCell
virtual ~TitleBlockCell()
Definition: titleblockcell.cpp:23
TitleBlockCell::logo_reference
QString logo_reference
Logo displayed by this cell, it it is a logo cell.
Definition: titleblockcell.h:76
TitleBlockCell
Definition: titleblockcell.h:26
TitleBlockCell::alignment
int alignment
Where the label+text should be displayed within the visual cell.
Definition: titleblockcell.h:73