KD Reports API Documentation  2.0
KDReportsElementData_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Reports library.
4 **
5 ** SPDX-FileCopyrightText: 2007-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDAB-KDReports OR LicenseRef-KDAB-KDReports-US
8 **
9 ** Licensees holding valid commercial KD Reports licenses may use this file in
10 ** accordance with the KD Reports Commercial License Agreement provided with
11 ** the Software.
12 **
13 ** Contact info@kdab.com if any conditions of this licensing are not clear to you.
14 **
15 ****************************************************************************/
16 
17 #ifndef KDREPORTSELEMENTDATA_P_H
18 #define KDREPORTSELEMENTDATA_P_H
19 
20 //
21 // W A R N I N G
22 // -------------
23 //
24 // This file is not part of the KD Reports API. It exists purely as an
25 // implementation detail. This header file may change from version to
26 // version without notice, or even be removed.
27 //
28 // We mean it.
29 //
30 //
31 
32 #include "KDReportsElement.h"
33 #include "KDReportsVariableType.h"
34 
35 namespace KDReports {
36 
41 struct ElementData
42 {
43  enum Type { Inline,
44  Block,
45  Variable };
46  // inline
47  ElementData(Element *elem)
48  : m_element(elem)
49  , m_type(Inline)
50  {
51  } // m_align not used
52  // block
53  ElementData(Element *elem, Qt::AlignmentFlag a)
54  : m_element(elem)
56  , m_align(a)
57  {
58  }
59  // inline variable
61  : m_element(nullptr)
62  , m_type(Variable)
63  , m_variableType(variable)
64  {
65  }
66  // copy ctor
67  ElementData(const ElementData &other) { operator=(other); }
68  ElementData &operator=(const ElementData &other)
69  {
70  m_element = other.m_element ? other.m_element->clone() : nullptr;
71  m_type = other.m_type;
72  m_variableType = other.m_variableType;
73  m_align = other.m_align;
74  return *this;
75  }
76  ~ElementData() { delete m_element; }
77 
78  Element *m_element;
79  Type m_type : 3;
80  union {
82  Qt::AlignmentFlag m_align;
83  };
84 };
85 }
86 
87 #endif
KDReports::ElementData::ElementData
ElementData(Element *elem)
Definition: KDReportsElementData_p.h:75
KDReports::ElementData::m_type
Type m_type
Definition: KDReportsElementData_p.h:107
KDReportsVariableType.h
KDReports::ElementData::m_element
Element * m_element
Definition: KDReportsElementData_p.h:106
KDReports::ElementData::Inline
@ Inline
Definition: KDReportsElementData_p.h:85
KDReports::ElementData::m_variableType
KDReports::VariableType m_variableType
Definition: KDReportsElementData_p.h:109
KDReportsElement.h
KDReports::ElementData::Block
@ Block
Definition: KDReportsElementData_p.h:86
KDReports::ElementData::~ElementData
~ElementData()
Definition: KDReportsElementData_p.h:104
KDReports::ElementData::Variable
@ Variable
Definition: KDReportsElementData_p.h:87
KDReports::ElementData::Type
Type
Definition: KDReportsElementData_p.h:71
KDReports::VariableType
VariableType
Definition: KDReportsVariableType.h:29
KDReports::ElementData::m_align
Qt::AlignmentFlag m_align
Definition: KDReportsElementData_p.h:110
KDReports
Definition: KDReportsAbstractReportLayout_p.h:30
KDReports::ElementData::operator=
ElementData & operator=(const ElementData &other)
Definition: KDReportsElementData_p.h:96

© 2007-2021 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-reports/
Generated on Sat Jan 8 2022 02:38:32 for KD Reports API Documentation by doxygen 1.8.17