Grantlee  5.0.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 
49 class GRANTLEE_TEXTDOCUMENT_EXPORT AbstractMarkupBuilder
50 {
51 public:
54 
56  virtual void beginStrong() = 0;
57 
59  virtual void endStrong() = 0;
60 
62  virtual void beginEmph() = 0;
63 
65  virtual void endEmph() = 0;
66 
68  virtual void beginUnderline() = 0;
69 
71  virtual void endUnderline() = 0;
72 
74  virtual void beginStrikeout() = 0;
75 
77  virtual void endStrikeout() = 0;
78 
80  virtual void beginForeground( const QBrush &brush ) = 0;
81 
83  virtual void endForeground() = 0;
84 
86  virtual void beginBackground( const QBrush &brush ) = 0;
87 
89  virtual void endBackground() = 0;
90 
96  virtual void beginAnchor( const QString &href = QString(), const QString &name = QString() ) = 0;
97 
99  virtual void endAnchor() = 0;
100 
105  virtual void beginFontFamily( const QString &family ) = 0;
106 
108  virtual void endFontFamily() = 0;
109 
114  virtual void beginFontPointSize( int size ) = 0;
115 
117  virtual void endFontPointSize() = 0;
118 
127  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;
128 
130  virtual void endParagraph() = 0;
132  virtual void addNewline() = 0;
133 
138  virtual void insertHorizontalRule( int width = -1 ) = 0;
139 
146  virtual void insertImage( const QString &url, qreal width, qreal height ) = 0;
147 
153  virtual void beginList( QTextListFormat::Style style ) = 0;
154 
158  virtual void endList() = 0;
159 
161  virtual void beginListItem() = 0;
162 
164  virtual void endListItem() = 0;
165 
167  virtual void beginSuperscript() = 0;
168 
170  virtual void endSuperscript() = 0;
171 
173  virtual void beginSubscript() = 0;
174 
176  virtual void endSubscript() = 0;
177 
185  virtual void beginTable( qreal cellpadding, qreal cellspacing, const QString &width ) = 0;
186 
190  virtual void beginTableRow() = 0;
191 
198  virtual void beginTableHeaderCell( const QString &width, int colSpan, int rowSpan ) = 0;
199 
206  virtual void beginTableCell( const QString &width, int colSpan, int rowSpan ) = 0;
207 
209  virtual void endTable() = 0;
210 
212  virtual void endTableRow() = 0;
213 
215  virtual void endTableHeaderCell() = 0;
216 
218  virtual void endTableCell() = 0;
219 
224  virtual void beginHeader( int level ) = 0;
225 
230  virtual void endHeader( int level ) = 0;
231 
237  virtual void appendLiteralText( const QString &text ) = 0;
238 
242  virtual void appendRawText( const QString &text ) = 0;
243 
249  virtual QString getResult() = 0;
250 };
251 
252 }
253 
254 #endif
The AbstractMarkupBuilder class serves as a base class for creating marked up plain text output...
The Grantlee namespace holds all public Grantlee API.
Definition: Mainpage.dox:7