Grantlee  0.4.0
mediawikimarkupbuilder.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_MEDIAWIKIMARKUPBUILDER_H
22 #define GRANTLEE_MEDIAWIKIMARKUPBUILDER_H
23 
24 #include "abstractmarkupbuilder.h"
25 
26 namespace Grantlee
27 {
28 
33 {
34 public:
35 
40  virtual ~MediaWikiMarkupBuilder();
41 
42  /* reimp */ void beginStrong();
43  /* reimp */ void endStrong();
44  /* reimp */ void beginEmph();
45  /* reimp */ void endEmph();
46  /* reimp */ void beginUnderline();
47  /* reimp */ void endUnderline();
48  /* reimp */ void beginStrikeout();
49  /* reimp */ void endStrikeout();
50 
51  /* reimp */ void endParagraph();
52  /* reimp */ void addNewline();
53 
54  /* reimp */ void beginAnchor( const QString &href = QString(), const QString &name = QString() );
55  /* reimp */ void endAnchor();
56 
57  /* reimp */ void beginHeader( int level );
58  /* reimp */ void endHeader( int level );
59 
60  /* reimp */ void beginList( QTextListFormat::Style type );
61 
62  /* reimp */ void endList();
63 
64  /* reimp */ void beginListItem();
65  /* reimp */ void endListItem();
66 
67  /* reimp */ void appendLiteralText( const QString &text );
68 
72  const QString escape( const QString &s );
73 
74  /* reimp */ QString getResult();
75 
76 private:
77  QList<QTextListFormat::Style> currentListItemStyles;
78 
79  QString m_text;
80 };
81 
82 }
83 
84 #endif
void beginList(QTextListFormat::Style type)
void appendLiteralText(const QString &text)
Creates MediaWiki markup from a QTextDocument.
const QString escape(const QString &s)
The AbstractMarkupBuilder class serves as a base class for creating marked up plain text output...
void beginAnchor(const QString &href=QString(), const QString &name=QString())