KD Reports API Documentation  2.0
KDReportsTextDocument_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 KDREPORTSTEXTDOCUMENT_H
18 #define KDREPORTSTEXTDOCUMENT_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 
33 #include "KDReportsGlobal.h"
34 #include "KDReportsReport.h"
36 #include <QFont>
37 #include <QMap>
38 #include <QTextCursor>
39 #include <QTextDocument>
40 #include <QTextFormat>
41 
42 QT_BEGIN_NAMESPACE
43 class QTextImageFormat;
44 class QTextTable;
45 QT_END_NAMESPACE
46 
47 namespace KDReports {
48 enum { HeaderColumnsProperty = QTextFormat::UserProperty + 248 };
49 
56 {
57 public:
58  explicit TextDocument();
59  ~TextDocument();
60 
61  // like QTextDocument::setTextWidth but also takes care of objects with % sizes
62  void layoutWithTextWidth(qreal w);
63 
64  // like QTextDocument::setPageSize but also takes care of objects with % sizes
65  void setPageSize(QSizeF size);
66 
67 #if 0
68  // add user property to char format
69  void setMarker( int pos, int propertyId, const QVariant& value );
70 #endif
71 
72  void regenerateAutoTables();
73  void regenerateAutoTableForModel(QAbstractItemModel *model);
74 
75  void updateTextValue(const QString &id, const QString &newValue);
76 
77  void scaleFontsBy(qreal factor);
78 
79  QFont defaultFont() const;
80  QTextDocument &contentDocument();
81  TextDocumentData &contentDocumentData();
82 
83  QList<KDReports::AutoTableElement *> autoTableElements();
84 
85  QString asHtml() const;
86  void preciseDump();
87 
88 private:
89  TextDocumentData m_contentDocument;
90 };
91 
92 }
93 
94 #endif /* KDREPORTSTEXTDOCUMENT_H */
KDReports::TextDocumentData
Definition: KDReportsTextDocumentData_p.h:56
KDReports::HeaderColumnsProperty
@ HeaderColumnsProperty
Definition: KDReportsTextDocument_p.h:48
QList
Definition: KDReportsAbstractTableElement.h:25
KDReports::TextDocument
Definition: KDReportsTextDocument_p.h:55
KDReportsReport.h
KDReportsAutoTableElement.h
KDReportsGlobal.h
KDReportsTextDocumentData_p.h
KDREPORTS_EXPORT
#define KDREPORTS_EXPORT
Definition: KDReportsGlobal.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