KD Reports  1.9
KDReportsCell.h
1 /****************************************************************************
2 **
3 ** This file is part of the KD Reports library.
4 **
5 ** SPDX-FileCopyrightText: 2007-2020 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 KDREPORTSCELL_H
18 #define KDREPORTSCELL_H
19 
20 #include "KDReportsElement.h"
21 #include "KDReportsVariableType.h"
22 #include <QtCore/Qt>
23 #include <QMap>
24 #include <QPair>
25 
26 namespace KDReports
27 {
28 class ReportBuilder;
29 class Element;
30 class CellContentMap;
31 class TableElement;
32 class CellPrivate;
33 
39 class KDREPORTS_EXPORT Cell : public Element
40 {
41 public:
46  void setColumnSpan( int columnSpan );
50  int columnSpan() const;
51 
56  void setRowSpan( int rowSpan );
60  int rowSpan() const;
61 
65  void addInlineElement( const Element& element );
66 
71  void addElement( const Element& element, Qt::AlignmentFlag horizontalAlignment = Qt::AlignLeft );
72 
77  void addVariable( VariableType variable );
78 
83  void build( ReportBuilder& builder ) const override;
84 
88  Element* clone() const override { return 0; } //krazy:exclude=inline
89 
93  ~Cell() override; // public for QMap
94 
95 private:
96  // TableElement needs to create/copy cells
97  friend class TableElement;
98  friend class QMap<QPair<int, int>, Cell>;
99  friend struct QMapData<QPair<int, int>, Cell>;
100  friend struct QMapNode<QPair<int, int>, Cell>;
101  Cell();
102  Cell(const Cell &other);
103  Cell &operator=(const Cell &other);
104 
105  CellPrivate* const d;
106 };
107 
108 }
109 
110 #endif /* KDREPORTSCELL_H */
Definition: KDReportsTableElement.h:32
VariableType
Definition: KDReportsVariableType.h:29
Definition: KDReportsCell.h:39
Definition: KDReportsAbstractTableElement.h:30
Definition: KDReportsElement.h:39

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/