QElectroTech  0.70
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
TitleBlockCell Class Reference

#include <titleblockcell.h>

Public Types

enum  TemplateCellType { EmptyCell, TextCell, LogoCell }
 
enum  TemplateCellSpanState { Disabled, Enabled, Restricted }
 

Public Member Functions

 TitleBlockCell ()
 
virtual ~TitleBlockCell ()
 
TemplateCellType type () const
 
int horizontalAlign () const
 
int verticalAlign () const
 
void setAttribute (const QString &, const QVariant &)
 
QVariant attribute (const QString &)
 
bool spans () const
 
void loadContentFromCell (const TitleBlockCell &)
 
void loadContentFromXml (const QDomElement &)
 
void saveContentToXml (QDomElement &)
 

Static Public Member Functions

static QString attributeName (const QString &)
 

Public Attributes

TemplateCellType cell_type
 Cell type: empty, text, logo? More...
 
int num_row
 y coordinate of the cell within its parent title block template grid More...
 
int num_col
 x coordinate of the cell within its parent title block template grid More...
 
int row_span
 number of extra rows spanned by this cell More...
 
int col_span
 number of extra columns spanned by this cell More...
 
int span_state
 how should row_span and col_span be applied given other cells in the parent template More...
 
int applied_row_span
 Actually applied row span. More...
 
int applied_col_span
 Actually applied column span. More...
 
TitleBlockCellspanner_cell
 Cell spanning this cell, if any. More...
 
QString value_name
 name of the cell; not displayed when the title block template is rendered More...
 
NamesList value
 Text displayed by the cell. More...
 
NamesList label
 Label displayed by the cell. More...
 
bool display_label
 Whether to display the label or not. More...
 
int alignment
 Where the label+text should be displayed within the visual cell. More...
 
int font_size
 Font size the text should be rendered with. More...
 
bool hadjust
 Whether to reduce the font size if the text does not fit in the cell. More...
 
QString logo_reference
 Logo displayed by this cell, it it is a logo cell. More...
 

Detailed Description

This class is a container for the various parameters of a titleblock cell

See also
TitleBlockColumnLength

Definition at line 26 of file titleblockcell.h.

Member Enumeration Documentation

◆ TemplateCellSpanState

Enumerator
Disabled 

the cell span parameters should not applied at all

Enabled 

the cell span parameters should be applied without restriction

Restricted 

the cell span parameters should be applied with some restrictions

Definition at line 33 of file titleblockcell.h.

◆ TemplateCellType

Enumerator
EmptyCell 
TextCell 
LogoCell 

Definition at line 28 of file titleblockcell.h.

Constructor & Destructor Documentation

◆ TitleBlockCell()

TitleBlockCell::TitleBlockCell ( )

◆ ~TitleBlockCell()

TitleBlockCell::~TitleBlockCell ( )
virtual

Destructor

Definition at line 23 of file titleblockcell.cpp.

Member Function Documentation

◆ attribute()

QVariant TitleBlockCell::attribute ( const QString &  attribute)
Parameters
attributeName of the cell attribute which value is wanted
Returns
the value of the required attribute

Definition at line 81 of file titleblockcell.cpp.

References alignment, display_label, TitleBlockTemplate::fontForCell(), hadjust, label, logo_reference, type(), value, and value_name.

Referenced by attributeName(), and setAttribute().

◆ attributeName()

QString TitleBlockCell::attributeName ( const QString &  attribute)
static
Parameters
attributeName of the cell attribute which we want the human, translated name
Returns
the human, translated name for this attribute.

Definition at line 108 of file titleblockcell.cpp.

References attribute(), and QET::Icons::tr.

Referenced by TitleBlockTemplateCellWidget::emitModification().

◆ horizontalAlign()

int TitleBlockCell::horizontalAlign ( ) const
Returns
the horizontal alignment of this cell

Definition at line 36 of file titleblockcell.cpp.

References alignment.

◆ loadContentFromCell()

void TitleBlockCell::loadContentFromCell ( const TitleBlockCell other_cell)

Copy the content of another cell.

Parameters
other_cellAnother cell

Definition at line 142 of file titleblockcell.cpp.

References alignment, cell_type, display_label, font_size, hadjust, label, logo_reference, value, and value_name.

◆ loadContentFromXml()

void TitleBlockCell::loadContentFromXml ( const QDomElement &  cell_element)
Parameters
cell_elementXML element from which cell content will be read

Definition at line 157 of file titleblockcell.cpp.

References alignment, QET::attributeIsAnInteger(), cell_type, display_label, font_size, NamesList::fromXml(), hadjust, label, logo_reference, LogoCell, NamesList::name(), TextCell, value, and value_name.

Referenced by TitleBlockTemplateView::pastedCells().

◆ saveContentToXml()

void TitleBlockCell::saveContentToXml ( QDomElement &  cell_elmt)
Parameters
xml_elementXML element to which cell content will be exported

Definition at line 222 of file titleblockcell.cpp.

References alignment, display_label, EmptyCell, font_size, hadjust, label, logo_reference, LogoCell, NamesList::toXml(), type(), value, and value_name.

◆ setAttribute()

void TitleBlockCell::setAttribute ( const QString &  attribute,
const QVariant &  attr_value 
)

Set the new value attr_value to the attribute named attribute.

Parameters
attributeName of the cell attribute which value is to be changed
attr_valueNew value of the changed attribute

Definition at line 52 of file titleblockcell.cpp.

References alignment, attribute(), cell_type, display_label, font_size, hadjust, label, logo_reference, LogoCell, value, and value_name.

◆ spans()

bool TitleBlockCell::spans ( ) const
Returns
true if this cell spans over other cells, false otherwise.

Definition at line 134 of file titleblockcell.cpp.

References col_span, and row_span.

◆ type()

TitleBlockCell::TemplateCellType TitleBlockCell::type ( ) const
Returns
the type of this cell

Definition at line 29 of file titleblockcell.cpp.

References cell_type.

Referenced by attribute(), TitleBlockTemplate::renderCell(), and saveContentToXml().

◆ verticalAlign()

int TitleBlockCell::verticalAlign ( ) const
Returns
the vertical alignment of this cell

Definition at line 43 of file titleblockcell.cpp.

References alignment.

Member Data Documentation

◆ alignment

int TitleBlockCell::alignment

◆ applied_col_span

int TitleBlockCell::applied_col_span

Actually applied column span.

Definition at line 67 of file titleblockcell.h.

Referenced by TitleBlockCell().

◆ applied_row_span

int TitleBlockCell::applied_row_span

Actually applied row span.

Definition at line 66 of file titleblockcell.h.

Referenced by TitleBlockCell().

◆ cell_type

TemplateCellType TitleBlockCell::cell_type

Cell type: empty, text, logo?

Definition at line 60 of file titleblockcell.h.

Referenced by loadContentFromCell(), loadContentFromXml(), setAttribute(), TitleBlockCell(), and type().

◆ col_span

int TitleBlockCell::col_span

number of extra columns spanned by this cell

Definition at line 64 of file titleblockcell.h.

Referenced by TitleBlockTemplateView::pastedCells(), PasteTemplateCellsCommand::redo(), spans(), and TitleBlockCell().

◆ display_label

bool TitleBlockCell::display_label

◆ font_size

int TitleBlockCell::font_size

Font size the text should be rendered with.

Definition at line 74 of file titleblockcell.h.

Referenced by TitleBlockTemplate::fontForCell(), loadContentFromCell(), loadContentFromXml(), saveContentToXml(), setAttribute(), and TitleBlockCell().

◆ hadjust

bool TitleBlockCell::hadjust

Whether to reduce the font size if the text does not fit in the cell.

Definition at line 75 of file titleblockcell.h.

Referenced by attribute(), loadContentFromCell(), loadContentFromXml(), TitleBlockTemplate::renderTextCell(), TitleBlockTemplate::renderTextCellDxf(), saveContentToXml(), setAttribute(), and TitleBlockCell().

◆ label

NamesList TitleBlockCell::label

◆ logo_reference

QString TitleBlockCell::logo_reference

Logo displayed by this cell, it it is a logo cell.

Definition at line 76 of file titleblockcell.h.

Referenced by attribute(), loadContentFromCell(), loadContentFromXml(), TitleBlockTemplate::renderCell(), saveContentToXml(), setAttribute(), and TitleBlockCell().

◆ num_col

int TitleBlockCell::num_col

x coordinate of the cell within its parent title block template grid

Definition at line 62 of file titleblockcell.h.

Referenced by TitleBlockTemplateView::paste(), TitleBlockTemplateView::pastedCells(), and TitleBlockCell().

◆ num_row

int TitleBlockCell::num_row

y coordinate of the cell within its parent title block template grid

Definition at line 61 of file titleblockcell.h.

Referenced by TitleBlockTemplateView::paste(), TitleBlockTemplateView::pastedCells(), and TitleBlockCell().

◆ row_span

int TitleBlockCell::row_span

number of extra rows spanned by this cell

Definition at line 63 of file titleblockcell.h.

Referenced by TitleBlockTemplateView::pastedCells(), PasteTemplateCellsCommand::redo(), spans(), and TitleBlockCell().

◆ span_state

int TitleBlockCell::span_state

how should row_span and col_span be applied given other cells in the parent template

Definition at line 65 of file titleblockcell.h.

Referenced by TitleBlockCell().

◆ spanner_cell

TitleBlockCell* TitleBlockCell::spanner_cell

Cell spanning this cell, if any.

Definition at line 68 of file titleblockcell.h.

Referenced by TitleBlockCell().

◆ value

NamesList TitleBlockCell::value

◆ value_name

QString TitleBlockCell::value_name

name of the cell; not displayed when the title block template is rendered

Definition at line 69 of file titleblockcell.h.

Referenced by attribute(), loadContentFromCell(), loadContentFromXml(), saveContentToXml(), and setAttribute().


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