KD Reports API Documentation  2.0
KDReportsHeader_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 KDREPORTSHEADER_P_H
18 #define KDREPORTSHEADER_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 #include "KDReportsHeader.h"
32 #include "KDReportsReport.h"
34 #include "KDReportsReport_p.h"
36 
37 namespace KDReports {
38 
42 void setVariableMarker(QTextDocument &textDoc, int pos, KDReports::VariableType variableType, int valueLength);
46 QString variableValue(int pageNumber, KDReports::Report *report, VariableType type);
50 void cleanupVariableProperties(QTextCharFormat &charFormat);
51 
55 class HeaderReportBuilder : public KDReports::ReportBuilder
56 {
57 public:
58  HeaderReportBuilder(REPORTBUILDER_CTOR_ARGDEFS) // krazy:exclude=explicit
60  {
61  }
62 
63  /*reimp*/ void addInlineElement(const KDReports::Element &element) override
64  {
66  report()->d->headerChanged();
67  }
68  /*reimp*/ void addBlockElement(const KDReports::Element &element, Qt::AlignmentFlag horizontalAlignment, const QColor &background = QColor()) override
69  {
70  ReportBuilder::addBlockElement(element, horizontalAlignment, background);
71  report()->d->headerChanged();
72  }
73  /*reimp*/ void addVerticalSpacing(qreal space) override
74  {
76  report()->d->headerChanged();
77  }
78 };
79 
83 class HeaderPrivate
84 {
85 public:
86  explicit HeaderPrivate(KDReports::Report *report)
88  , m_builder(m_textDocument.contentDocumentData(), QTextCursor(&m_textDocument.contentDocument()), report)
89  , m_report(report)
90  {
91  }
95 };
96 
97 }
98 
99 #endif /* KDREPORTSHEADER_P_H */
KDReports::HeaderReportBuilder::HeaderReportBuilder
HeaderReportBuilder(REPORTBUILDER_CTOR_ARGDEFS)
Definition: KDReportsHeader_p.h:72
KDReports::HeaderReportBuilder::addVerticalSpacing
void addVerticalSpacing(qreal space) override
Definition: KDReportsHeader_p.h:87
KDReports::ReportPrivate::headerChanged
void headerChanged()
Definition: KDReportsReport.cpp:354
KDReports::ReportBuilder
Definition: KDReportsReportBuilder_p.h:41
REPORTBUILDER_CTOR_ARGNAMES
#define REPORTBUILDER_CTOR_ARGNAMES
Definition: KDReportsReportBuilder_p.h:36
KDReports::ReportBuilder::report
Report * report()
Definition: KDReportsReportBuilder_p.h:53
KDReports::HeaderReportBuilder::addInlineElement
void addInlineElement(const KDReports::Element &element) override
Definition: KDReportsHeader_p.h:77
KDReports::cleanupVariableProperties
void cleanupVariableProperties(QTextCharFormat &charFormat)
Definition: KDReportsHeader.cpp:108
KDReports::HeaderPrivate::HeaderPrivate
HeaderPrivate(KDReports::Report *report)
Definition: KDReportsHeader_p.h:100
KDReports::HeaderReportBuilder
Definition: KDReportsHeader_p.h:69
KDReportsReport_p.h
KDReportsTextDocument_p.h
KDReports::HeaderReportBuilder::addBlockElement
void addBlockElement(const KDReports::Element &element, Qt::AlignmentFlag horizontalAlignment, const QColor &background=QColor()) override
Definition: KDReportsHeader_p.h:82
KDReports::Element
Definition: KDReportsElement.h:39
KDReports::Report
Definition: KDReportsReport.h:80
KDReports::TextDocument
Definition: KDReportsTextDocument_p.h:55
KDReportsReport.h
KDReportsHeader.h
KDReports::HeaderPrivate::m_textDocument
KDReports::TextDocument m_textDocument
Definition: KDReportsHeader_p.h:106
KDReports::setVariableMarker
void setVariableMarker(QTextDocument &textDoc, int pos, KDReports::VariableType variableType, int valueLength)
Definition: KDReportsHeader.cpp:96
KDReportsReportBuilder_p.h
KDReports::ReportBuilder::addInlineElement
virtual void addInlineElement(const Element &element)
Definition: KDReportsReportBuilder.cpp:34
KDReports::ReportBuilder::addVerticalSpacing
virtual void addVerticalSpacing(qreal space)
Definition: KDReportsReportBuilder.cpp:111
REPORTBUILDER_CTOR_ARGDEFS
#define REPORTBUILDER_CTOR_ARGDEFS
Definition: KDReportsReportBuilder_p.h:34
KDReports::ReportBuilder::ReportBuilder
ReportBuilder(KDReports::TextDocumentData &contentDocument, const QTextCursor &cursor, Report *report)
KDReports::variableValue
QString variableValue(int pageNumber, KDReports::Report *report, VariableType type)
Definition: KDReportsHeader.cpp:63
KDReports::ReportBuilder::addBlockElement
virtual void addBlockElement(const Element &element, Qt::AlignmentFlag horizontalAlignment, const QColor &backgroundColor=QColor())
Definition: KDReportsReportBuilder.cpp:47
KDReports::HeaderPrivate::m_builder
KDReports::HeaderReportBuilder m_builder
Definition: KDReportsHeader_p.h:107
KDReports::HeaderPrivate::m_report
KDReports::Report * m_report
Definition: KDReportsHeader_p.h:108
KDReports::VariableType
VariableType
Definition: KDReportsVariableType.h:29
KDReports
Definition: KDReportsAbstractReportLayout_p.h:30

© 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