KD Reports  1.8
KDReportsCell.h
1 /****************************************************************************
2 ** Copyright (C) 2007-2020 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Reports library.
5 **
6 ** Licensees holding valid commercial KD Reports licenses may use this file in
7 ** accordance with the KD Reports Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU Lesser General Public License version 2.1 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDREPORTSCELL_H
24 #define KDREPORTSCELL_H
25 
26 #include "KDReportsElement.h"
27 #include "KDReportsVariableType.h"
28 #include <QtCore/Qt>
29 #include <QMap>
30 #include <QPair>
31 
32 namespace KDReports
33 {
34 class ReportBuilder;
35 class Element;
36 class CellContentMap;
37 class TableElement;
38 class CellPrivate;
39 
45 class KDREPORTS_EXPORT Cell : public Element
46 {
47 public:
52  void setColumnSpan( int columnSpan );
56  int columnSpan() const;
57 
62  void setRowSpan( int rowSpan );
66  int rowSpan() const;
67 
71  void addInlineElement( const Element& element );
72 
77  void addElement( const Element& element, Qt::AlignmentFlag horizontalAlignment = Qt::AlignLeft );
78 
83  void addVariable( VariableType variable );
84 
89  void build( ReportBuilder& builder ) const;
90 
94  Element* clone() const { return 0; } //krazy:exclude=inline
95 
99  ~Cell(); // public for QMap
100 
101 private:
102  // TableElement needs to create/copy cells
103  friend class TableElement;
104  friend class QMap<QPair<int, int>, Cell>;
105 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
106  friend struct QMapData<QPair<int, int>, Cell>;
107  friend struct QMapNode<QPair<int, int>, Cell>;
108 #endif
109  Cell();
110  Cell(const Cell &other);
111  Cell &operator=(const Cell &other);
112 
113  CellPrivate* const d;
114 };
115 
116 }
117 
118 #endif /* KDREPORTSCELL_H */
Definition: KDReportsTableElement.h:38
VariableType
Definition: KDReportsVariableType.h:35
Definition: KDReportsCell.h:45
Definition: KDReportsAbstractTableElement.h:36
Definition: KDReportsElement.h:45

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/