17 #ifndef KDREPORTSTEXTDOCUMENTDATA_P_H
18 #define KDREPORTSTEXTDOCUMENTDATA_P_H
22 #include <QTextCursor>
45 explicit TextDocumentData();
48 TextDocumentData(
const TextDocumentData &) =
delete;
49 TextDocumentData &operator=(
const TextDocumentData &) =
delete;
51 QTextDocument &document() {
return *m_document; }
52 const QTextDocument &document()
const {
return *m_document; }
54 void setUsesTabPositions(
bool usesTabs);
55 void saveResourcesToFiles();
58 void aboutToModifyContents(ModificationMode mode);
59 void updateTextValue(
const QString &
id,
const QString &newValue);
60 void layoutWithTextWidth(qreal w);
61 void setPageSize(QSizeF size);
62 void scaleFontsBy(qreal factor);
63 void updatePercentSizes(QSizeF size);
64 void setTextValueMarker(
int pos,
const QString &
id,
int valueLength,
bool html);
69 void registerTable(QTextTable *table);
70 QString asHtml()
const;
75 void regenerateAutoTables();
76 void regenerateAutoTableForModel(QAbstractItemModel *model);
77 void addResourceName(
const QString &resourceName);
78 void setHasResizableImages();
80 static void updatePercentSize(QTextImageFormat &format, QSizeF size);
84 void setFontSizeHelper(QTextCursor &lastCursor,
int endPosition, qreal pointSize, qreal factor);
86 void dumpTextValueCursors()
const;
88 QTextDocument *m_document;
89 enum ElementType { ElementTypeText,
94 ElementType elementType;
98 QMultiMap<QString, TextValueData> m_textValueCursors;
102 typedef QHash<QTextTable *, KDReports::AutoTableElement> AutoTablesMaps;
103 AutoTablesMaps m_autoTables;
105 bool m_usesTabPositions;
106 bool m_hasResizableImages =
false;