KD Reports  1.9
KDReportsHeader.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 KDREPORTSHEADER_H
18 #define KDREPORTSHEADER_H
19 
20 #include "KDReportsGlobal.h"
21 #include "KDReportsVariableType.h"
22 #include <QtCore/Qt>
23 #include <QTextOption>
24 
25 QT_BEGIN_NAMESPACE
26 template<class T> class QList;
27 class QFont;
28 class QTextDocument;
29 class HeaderData;
30 QT_END_NAMESPACE
31 
32 namespace KDReports {
33 
34 class HeaderPrivate;
35 class XmlParser;
36 class Element;
37 class HeaderMap;
38 class Report;
39 class ReportPrivate;
40 class TextDocument;
41 
48 class KDREPORTS_EXPORT Header
49 {
50 public:
55  void setDefaultFont( const QFont& font );
56 
61  QFont defaultFont() const;
62 
66  void addInlineElement( const Element& element );
67 
72  void addElement( const Element& element, Qt::AlignmentFlag horizontalAlignment = Qt::AlignLeft );
73 
85  void addVariable( VariableType variable );
86 
92  void addVerticalSpacing( qreal space );
93 
102  void setTabPositions( const QList<QTextOption::Tab>& tabs );
103 
107  int currentPosition() const;
108 
109 private:
110  friend class XmlParser;
111  friend class Report;
112  friend class ReportPrivate;
113  explicit Header( Report* report );
114  ~Header();
115  friend class Test;
116  friend class HeaderMap;
117  friend class ::HeaderData;
118  TextDocument& doc();
119  void preparePaintingPage( int pageNumber );
120 
121  Q_DISABLE_COPY( Header )
122 
123  HeaderPrivate* const d;
124 };
125 
126 typedef Header Footer;
127 
128 }
129 
130 #endif /* KDREPORTSHEADER_H */
VariableType
Definition: KDReportsVariableType.h:29
Definition: KDReportsReport.h:99
Definition: KDReportsHeader.h:48
Definition: KDReportsAbstractTableElement.h:30
Definition: KDReportsElement.h:39
Definition: KDReportsAbstractTableElement.h:24

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/