Grantlee 5.3.0

texthtmlbuilder.h
1/*
2 This file is part of the Grantlee template system.
3
4 Copyright (c) 2008 Stephen Kelly <steveire@gmail.com>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either version
9 2.1 of the Licence, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library. If not, see <http://www.gnu.org/licenses/>.
18
19*/
20
21#ifndef GRANTLEE_TEXTHTMLBUILDER_H
22#define GRANTLEE_TEXTHTMLBUILDER_H
23
24#ifdef Q_CC_MSVC
25#pragma warning(disable : 4250)
26#endif
27
28#include "abstractmarkupbuilder.h"
29#include "grantlee_textdocument_export.h"
30#include "markupdirector.h"
31
32 namespace Grantlee
33{
34
35 class TextHTMLBuilderPrivate;
36
38
111 class GRANTLEE_TEXTDOCUMENT_EXPORT TextHTMLBuilder
112 : virtual public AbstractMarkupBuilder
113{
114 public:
115 TextHTMLBuilder();
116 ~TextHTMLBuilder() override;
117
118 void beginStrong() override;
119 void endStrong() override;
120 void beginEmph() override;
121 void endEmph() override;
122 void beginUnderline() override;
123 void endUnderline() override;
124 void beginStrikeout() override;
125 void endStrikeout() override;
126 void beginForeground(const QBrush &brush) override;
127 void endForeground() override;
128 void beginBackground(const QBrush &brush) override;
129 void endBackground() override;
130 void beginAnchor(const QString &href = {}, const QString &name = {}) override;
131 void endAnchor() override;
132
133 // Maybe this stuff should just be added to a list, and then when I add
134 // literal text,
135 // add some kind of style attribute in one span instead of many.
136 void beginFontFamily(const QString &family) override;
137 void endFontFamily() override;
138
143 void beginFontPointSize(int size) override;
144 void endFontPointSize() override;
145
154 void beginParagraph(Qt::Alignment al = Qt::AlignLeft, qreal topMargin = 0.0,
155 qreal bottomMargin = 0.0, qreal leftMargin = 0.0,
156 qreal rightMargin = 0.0) override;
157
162 void beginHeader(int level) override;
163
168 void endHeader(int level) override;
169
170 void endParagraph() override;
171 void addNewline() override;
172
173 void insertHorizontalRule(int width = -1) override;
174
175 void insertImage(const QString &src, qreal width, qreal height) override;
176
177 void beginList(QTextListFormat::Style type) override;
178
179 void endList() override;
180
181 void beginListItem() override;
182 void endListItem() override;
183
184 void beginSuperscript() override;
185
186 void endSuperscript() override;
187
188 void beginSubscript() override;
189
190 void endSubscript() override;
191
192 void beginTable(qreal cellpadding, qreal cellspacing,
193 const QString &width) override;
194
195 void beginTableRow() override;
196 void beginTableHeaderCell(const QString &width, int colspan,
197 int rowspan) override;
198
199 void beginTableCell(const QString &width, int colspan, int rowspan) override;
200
201 void endTable() override;
202 void endTableRow() override;
203 void endTableHeaderCell() override;
204 void endTableCell() override;
205
221 void appendLiteralText(const QString &text) override;
222
228 void appendRawText(const QString &text) override;
229
230 QString getResult() override;
231
232 private:
233 TextHTMLBuilderPrivate *d_ptr;
234 Q_DECLARE_PRIVATE(TextHTMLBuilder)
235};
236}
237
238#endif
Grantlee::AbstractMarkupBuilder
Interface for creating marked-up text output.
Definition: abstractmarkupbuilder.h:52
Grantlee::TextHTMLBuilder
The TextHTMLBuilder creates a clean html markup output.
Definition: texthtmlbuilder.h:113
Grantlee::TextHTMLBuilder::beginStrikeout
void beginStrikeout() override
Grantlee::TextHTMLBuilder::insertHorizontalRule
void insertHorizontalRule(int width=-1) override
Grantlee::TextHTMLBuilder::beginBackground
void beginBackground(const QBrush &brush) override
Grantlee::TextHTMLBuilder::endList
void endList() override
Grantlee::TextHTMLBuilder::appendLiteralText
void appendLiteralText(const QString &text) override
Grantlee::TextHTMLBuilder::beginEmph
void beginEmph() override
Grantlee::TextHTMLBuilder::beginFontFamily
void beginFontFamily(const QString &family) override
Grantlee::TextHTMLBuilder::appendRawText
void appendRawText(const QString &text) override
Grantlee::TextHTMLBuilder::beginSubscript
void beginSubscript() override
Grantlee::TextHTMLBuilder::beginList
void beginList(QTextListFormat::Style type) override
Grantlee::TextHTMLBuilder::endFontPointSize
void endFontPointSize() override
Grantlee::TextHTMLBuilder::getResult
QString getResult() override
Grantlee::TextHTMLBuilder::beginUnderline
void beginUnderline() override
Grantlee::TextHTMLBuilder::beginSuperscript
void beginSuperscript() override
Grantlee::TextHTMLBuilder::endTableHeaderCell
void endTableHeaderCell() override
Grantlee::TextHTMLBuilder::insertImage
void insertImage(const QString &src, qreal width, qreal height) override
Grantlee::TextHTMLBuilder::beginAnchor
void beginAnchor(const QString &href={}, const QString &name={}) override
Grantlee::TextHTMLBuilder::endTableCell
void endTableCell() override
Grantlee::TextHTMLBuilder::beginTableCell
void beginTableCell(const QString &width, int colspan, int rowspan) override
Grantlee::TextHTMLBuilder::beginParagraph
void beginParagraph(Qt::Alignment al=Qt::AlignLeft, qreal topMargin=0.0, qreal bottomMargin=0.0, qreal leftMargin=0.0, qreal rightMargin=0.0) override
Grantlee::TextHTMLBuilder::endSuperscript
void endSuperscript() override
Grantlee::TextHTMLBuilder::endFontFamily
void endFontFamily() override
Grantlee::TextHTMLBuilder::beginStrong
void beginStrong() override
Grantlee::TextHTMLBuilder::beginTable
void beginTable(qreal cellpadding, qreal cellspacing, const QString &width) override
Grantlee::TextHTMLBuilder::endStrikeout
void endStrikeout() override
Grantlee::TextHTMLBuilder::endUnderline
void endUnderline() override
Grantlee::TextHTMLBuilder::beginForeground
void beginForeground(const QBrush &brush) override
Grantlee::TextHTMLBuilder::beginListItem
void beginListItem() override
Grantlee::TextHTMLBuilder::endSubscript
void endSubscript() override
Grantlee::TextHTMLBuilder::endParagraph
void endParagraph() override
Grantlee::TextHTMLBuilder::endHeader
void endHeader(int level) override
Grantlee::TextHTMLBuilder::endTable
void endTable() override
Grantlee::TextHTMLBuilder::beginTableHeaderCell
void beginTableHeaderCell(const QString &width, int colspan, int rowspan) override
Grantlee::TextHTMLBuilder::endStrong
void endStrong() override
Grantlee::TextHTMLBuilder::addNewline
void addNewline() override
Grantlee::TextHTMLBuilder::beginTableRow
void beginTableRow() override
Grantlee::TextHTMLBuilder::beginFontPointSize
void beginFontPointSize(int size) override
Grantlee::TextHTMLBuilder::endAnchor
void endAnchor() override
Grantlee::TextHTMLBuilder::endTableRow
void endTableRow() override
Grantlee::TextHTMLBuilder::endEmph
void endEmph() override
Grantlee::TextHTMLBuilder::endForeground
void endForeground() override
Grantlee::TextHTMLBuilder::beginHeader
void beginHeader(int level) override
Grantlee::TextHTMLBuilder::endListItem
void endListItem() override
Grantlee::TextHTMLBuilder::endBackground
void endBackground() override
Grantlee
The Grantlee namespace holds all public Grantlee API.
Definition: Mainpage.dox:8