KD Reports API Documentation  2.2
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 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 
11 #ifndef KDREPORTSTEXTDOCUMENT_H
12 #define KDREPORTSTEXTDOCUMENT_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 
27 #include "KDReportsGlobal.h"
28 #include "KDReportsReport.h"
30 #include <QFont>
31 #include <QMap>
32 #include <QTextCursor>
33 #include <QTextDocument>
34 #include <QTextFormat>
35 
36 QT_BEGIN_NAMESPACE
37 class QTextImageFormat;
38 class QTextTable;
39 QT_END_NAMESPACE
40 
41 namespace KDReports {
42 enum
43 {
44  HeaderColumnsProperty = QTextFormat::UserProperty + 248
45 };
46 
53 {
54 public:
55  explicit TextDocument();
56  ~TextDocument();
57 
58  // like QTextDocument::setTextWidth but also takes care of objects with % sizes
59  void layoutWithTextWidth(qreal w);
60 
61  // like QTextDocument::setPageSize but also takes care of objects with % sizes
62  void setPageSize(QSizeF size);
63 
64 #if 0
65  // add user property to char format
66  void setMarker( int pos, int propertyId, const QVariant& value );
67 #endif
68 
70  void regenerateAutoTableForModel(QAbstractItemModel *model);
71 
72  void updateTextValue(const QString &id, const QString &newValue);
73 
74  void scaleFontsBy(qreal factor);
75 
76  QFont defaultFont() const;
77  QTextDocument &contentDocument();
78  TextDocumentData &contentDocumentData();
79 
81 
82  QString asHtml() const;
83  void preciseDump();
84 
85 private:
86  TextDocumentData m_contentDocument;
87 };
88 
89 }
90 
91 #endif /* KDREPORTSTEXTDOCUMENT_H */
#define KDREPORTS_EXPORT
QString asHtml() const
QList< KDReports::AutoTableElement * > autoTableElements()
void regenerateAutoTableForModel(QAbstractItemModel *model)

© 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 by doxygen 1.9.1