KD Reports API Documentation 2.2
Loading...
Searching...
No Matches
KDReportsReport_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 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6**
7** SPDX-License-Identifier: MIT
8**
9****************************************************************************/
10
11#ifndef KDREPORTSREPORT_P_H
12#define KDREPORTSREPORT_P_H
13
14//
15// W A R N I N G
16// -------------
17//
18// This file is not part of the KD Reports API. It exists purely as an
19// implementation detail. This header file may change from version to
20// version without notice, or even be removed.
21//
22// We mean it.
23//
24
25#include "KDReportsHeader.h"
26#include "KDReportsReport.h"
29#include <QHash>
30#include <QMap>
31
32namespace KDReports {
33class XmlElementHandler;
34class MainTable;
35class AbstractReportLayout;
36
41
42class Header;
46class KDREPORTS_EXPORT HeaderMap : public QMap<HeaderLocations, Header *>
47{
48public:
49 HeaderMap() = default;
51 {
52 for (iterator it = begin(); it != end(); ++it) {
53 delete *it;
54 }
55 }
56 HeaderMap(const HeaderMap &) = delete;
57 HeaderMap &operator=(const HeaderMap &) = delete;
58
59 void layoutWithTextWidth(qreal w)
60 {
61 for (const_iterator it = constBegin(); it != constEnd(); ++it) {
62 it.value()->doc().layoutWithTextWidth(w);
63 }
64 }
65
66 void updateTextValue(const QString &id, const QString &newValue)
67 {
68 for (const_iterator it = constBegin(); it != constEnd(); ++it) {
69 it.value()->doc().updateTextValue(id, newValue);
70 }
71 }
72
73 qreal height() const
74 {
75 qreal maxHeight = 0;
76 for (const_iterator it = begin(); it != end(); ++it) {
77 Header *header = it.value();
78 maxHeight = qMax(maxHeight, header->doc().contentDocument().size().height());
79 }
80 return maxHeight;
81 }
82
83 Header *headerForPage(int pageNumber, int pageCount) const;
84 KDReports::HeaderLocations headerLocation(Header *header) const;
85};
86
88{
89public:
90 explicit ReportPrivate(Report *report);
92
94 void ensureLayouted();
95 QSizeF paperSize() const;
96 void paintPage(int pageNumber, QPainter &painter);
97 bool doPrint(QPrinter *printer, QWidget *parent);
98 QSizeF layoutAsOnePage(qreal docWidth);
99 bool wantEndlessPrinting() const;
101 ReportBuilder *builder() const;
102
103 void headerChanged(); // called by Header
104 qreal textDocumentWidth() const; // called by ImageElement, ChartElement
105 bool skipHeadersFooters() const;
106 qreal rawMainTextDocHeight() const;
107 qreal mainTextDocHeight() const;
108 QRect mainTextDocRect() const;
109#ifndef NDEBUG
110 // for calling from gdb
111 void debugLayoutToPdf(const char *fileName);
112#endif
113
114 ReportPrivate(const ReportPrivate &) = delete;
116
117 qreal m_layoutWidth; // in pixels; used for layoutAsOnePage only
118 qreal m_endlessPrinterWidth; // in mm
119 mutable QSizeF m_paperSize; // in pixels
140
141 // int m_numHorizontalPages; // for scaleTo(). 1 if not set.
142 // int m_numVerticalPages; // for scaleTo(). 0 if not set.
143 // qreal m_scaleFontsBy; // for scaleFontsBy(), 1.0 otherwise.
144 // bool m_autoScale; // if scaleTo() was called.
145 // KDReports::Report::TableBreakingPageOrder m_tableBreakingPageOrder;
146
156};
157
158}
159
160#endif /* KDREPORTSREPORT_P_H */
#define KDREPORTS_EXPORT
KDReports::HeaderLocations headerLocation(Header *header) const
void layoutWithTextWidth(qreal w)
HeaderMap & operator=(const HeaderMap &)=delete
HeaderMap(const HeaderMap &)=delete
void updateTextValue(const QString &id, const QString &newValue)
void paintPage(int pageNumber, QPainter &painter)
KDReports::AbstractReportLayout * m_layout
void debugLayoutToPdf(const char *fileName)
QPageLayout::Orientation m_orientation
KDReports::Report::ReportMode m_reportMode
QHash< QString, QString > m_textValues
void setPaperSizeFromPrinter(QSizeF paperSize)
QHash< QString, QImage > m_imageValues
bool doPrint(QPrinter *printer, QWidget *parent)
QSizeF layoutAsOnePage(qreal docWidth)
ReportPrivate & operator=(const ReportPrivate &)=delete
ReportBuilder * builder() const
const QAbstractItemModel * m_currentModel
XmlElementHandler * m_xmlElementHandler
bool hasNonLayoutedTextDocument() const
ReportPrivate(const ReportPrivate &)=delete
Report::WatermarkFunction m_watermarkFunction
std::function< void(QPainter &, int)> WatermarkFunction
QAbstractItemModel * modelForKey(const QString &key)

© 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 Wed Apr 24 2024 04:08:15 for KD Reports API Documentation by doxygen 1.9.8