Grantlee: textdocument/lib/abstractmarkupbuilder.h Source File

Grantlee 5.1.0

abstractmarkupbuilder.h
1 /*
2 This file is part of the Grantlee template system.
3
4 Copyright (c) 2008,2010 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_ABSTRACTMARKUPBUILDER_H
22 #define GRANTLEE_ABSTRACTMARKUPBUILDER_H
23
24 #include "grantlee_textdocument_export.h"
25
26 #include <QtCore/QString>
27 #include <QtGui/QTextListFormat>
28
29 class QBrush;
30
31 namespace Grantlee
32 {
33
34 class AbstractMarkupBuilderPrivate;
35
37
52 class GRANTLEE_TEXTDOCUMENT_EXPORT AbstractMarkupBuilder
53 {
54 public:
56 virtual ~AbstractMarkupBuilder() {}
57
59 virtual void beginStrong() = 0;
60
62 virtual void endStrong() = 0;
63
65 virtual void beginEmph() = 0;
66
68 virtual void endEmph() = 0;
69
71 virtual void beginUnderline() = 0;
72
74 virtual void endUnderline() = 0;
75
77 virtual void beginStrikeout() = 0;
78
80 virtual void endStrikeout() = 0;
81
85 virtual void beginForeground(const QBrush &brush) = 0;
86
88 virtual void endForeground() = 0;
89
92 virtual void beginBackground(const QBrush &brush) = 0;
93
95 virtual void endBackground() = 0;
96
102 virtual void beginAnchor(const QString &href = QString(),
103 const QString &name = QString())
104 = 0;
105
107 virtual void endAnchor() = 0;
108
113 virtual void beginFontFamily(const QString &family) = 0;
114
116 virtual void endFontFamily() = 0;
117
122 virtual void beginFontPointSize(int size) = 0;
123
125 virtual void endFontPointSize() = 0;
126
135 virtual void beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0,
136 qreal bottom = 0.0, qreal left = 0.0,
137 qreal right = 0.0)
138 = 0;
139
141 virtual void endParagraph() = 0;
143 virtual void addNewline() = 0;
144
149 virtual void insertHorizontalRule(int width = -1) = 0;
150
157 virtual void insertImage(const QString &url, qreal width, qreal height) = 0;
158
164 virtual void beginList(QTextListFormat::Style style) = 0;
165
169 virtual void endList() = 0;
170
172 virtual void beginListItem() = 0;
173
175 virtual void endListItem() = 0;
176
178 virtual void beginSuperscript() = 0;
179
181 virtual void endSuperscript() = 0;
182
184 virtual void beginSubscript() = 0;
185
187 virtual void endSubscript() = 0;
188
197 virtual void beginTable(qreal cellpadding, qreal cellspacing,
198 const QString &width)
199 = 0;
200
204 virtual void beginTableRow() = 0;
205
212 virtual void beginTableHeaderCell(const QString &width, int colSpan,
213 int rowSpan)
214 = 0;
215
222 virtual void beginTableCell(const QString &width, int colSpan, int rowSpan)
223 = 0;
224
226 virtual void endTable() = 0;
227
229 virtual void endTableRow() = 0;
230
232 virtual void endTableHeaderCell() = 0;
233
235 virtual void endTableCell() = 0;
236
241 virtual void beginHeader(int level) = 0;
242
247 virtual void endHeader(int level) = 0;
248
254 virtual void appendLiteralText(const QString &text) = 0;
255
259 virtual void appendRawText(const QString &text) = 0;
260
268 virtual QString getResult() = 0;
269 };
270 }
271
272 #endif
Grantlee::AbstractMarkupBuilder::~AbstractMarkupBuilder
virtual ~AbstractMarkupBuilder()
Definition: abstractmarkupbuilder.h:56
Grantlee::AbstractMarkupBuilder
The AbstractMarkupBuilder class serves as a base class for creating marked up plain text output.
Definition: abstractmarkupbuilder.h:52
Grantlee
The Grantlee namespace holds all public Grantlee API.
Definition: Mainpage.dox:7