Grantlee 5.3.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
29class QBrush;
30
31namespace Grantlee
32{
33
34class AbstractMarkupBuilderPrivate;
35
37
51class GRANTLEE_TEXTDOCUMENT_EXPORT AbstractMarkupBuilder
52{
53public:
56
58 virtual void beginStrong() = 0;
59
61 virtual void endStrong() = 0;
62
64 virtual void beginEmph() = 0;
65
67 virtual void endEmph() = 0;
68
70 virtual void beginUnderline() = 0;
71
73 virtual void endUnderline() = 0;
74
76 virtual void beginStrikeout() = 0;
77
79 virtual void endStrikeout() = 0;
80
85 virtual void beginForeground(const QBrush &brush) = 0;
86
88 virtual void endForeground() = 0;
89
94 virtual void beginBackground(const QBrush &brush) = 0;
95
97 virtual void endBackground() = 0;
98
104 virtual void beginAnchor(const QString &href = {}, const QString &name = {})
105 = 0;
106
108 virtual void endAnchor() = 0;
109
114 virtual void beginFontFamily(const QString &family) = 0;
115
117 virtual void endFontFamily() = 0;
118
123 virtual void beginFontPointSize(int size) = 0;
124
126 virtual void endFontPointSize() = 0;
127
136 virtual void beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0,
137 qreal bottom = 0.0, qreal left = 0.0,
138 qreal right = 0.0)
139 = 0;
140
142 virtual void endParagraph() = 0;
144 virtual void addNewline() = 0;
145
150 virtual void insertHorizontalRule(int width = -1) = 0;
151
158 virtual void insertImage(const QString &url, qreal width, qreal height) = 0;
159
165 virtual void beginList(QTextListFormat::Style style) = 0;
166
170 virtual void endList() = 0;
171
173 virtual void beginListItem() = 0;
174
176 virtual void endListItem() = 0;
177
179 virtual void beginSuperscript() = 0;
180
182 virtual void endSuperscript() = 0;
183
185 virtual void beginSubscript() = 0;
186
188 virtual void endSubscript() = 0;
189
198 virtual void beginTable(qreal cellpadding, qreal cellspacing,
199 const QString &width)
200 = 0;
201
205 virtual void beginTableRow() = 0;
206
213 virtual void beginTableHeaderCell(const QString &width, int colSpan,
214 int rowSpan)
215 = 0;
216
223 virtual void beginTableCell(const QString &width, int colSpan, int rowSpan)
224 = 0;
225
227 virtual void endTable() = 0;
228
230 virtual void endTableRow() = 0;
231
233 virtual void endTableHeaderCell() = 0;
234
236 virtual void endTableCell() = 0;
237
242 virtual void beginHeader(int level) = 0;
243
248 virtual void endHeader(int level) = 0;
249
255 virtual void appendLiteralText(const QString &text) = 0;
256
260 virtual void appendRawText(const QString &text) = 0;
261
269 virtual QString getResult() = 0;
270};
271}
272
273#endif
Interface for creating marked-up text output.
virtual void beginFontPointSize(int size)=0
virtual void endFontPointSize()=0
virtual QString getResult()=0
virtual void endHeader(int level)=0
virtual void beginAnchor(const QString &href={}, const QString &name={})=0
virtual void insertImage(const QString &url, qreal width, qreal height)=0
virtual void insertHorizontalRule(int width=-1)=0
virtual void beginList(QTextListFormat::Style style)=0
virtual void appendRawText(const QString &text)=0
virtual void beginHeader(int level)=0
virtual void appendLiteralText(const QString &text)=0
virtual void beginFontFamily(const QString &family)=0
virtual void endTableHeaderCell()=0
virtual void beginSuperscript()=0
virtual void beginTable(qreal cellpadding, qreal cellspacing, const QString &width)=0
virtual void beginForeground(const QBrush &brush)=0
virtual void beginBackground(const QBrush &brush)=0
virtual void beginTableHeaderCell(const QString &width, int colSpan, int rowSpan)=0
virtual void beginParagraph(Qt::Alignment a=Qt::AlignLeft, qreal top=0.0, qreal bottom=0.0, qreal left=0.0, qreal right=0.0)=0
virtual void beginTableCell(const QString &width, int colSpan, int rowSpan)=0
The Grantlee namespace holds all public Grantlee API.
Definition Mainpage.dox:8