Grantlee  5.1.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:
39  ~MediaWikiMarkupBuilder() override;
40 
41  void beginStrong() override;
42  void endStrong() override;
43  void beginEmph() override;
44  void endEmph() override;
45  void beginUnderline() override;
46  void endUnderline() override;
47  void beginStrikeout() override;
48  void endStrikeout() override;
49 
50  void endParagraph() override;
51  void addNewline() override;
52 
53  void beginAnchor(const QString &href = QString(),
54  const QString &name = QString()) override;
55  void endAnchor() override;
56 
57  void beginHeader(int level) override;
58  void endHeader(int level) override;
59 
60  void beginList(QTextListFormat::Style type) override;
61 
62  void endList() override;
63 
64  void beginListItem() override;
65  void endListItem() override;
66 
67  void appendLiteralText(const QString &text) override;
68 
72  const QString escape(const QString &s);
73 
74  QString getResult() override;
75 
76 private:
77  QList<QTextListFormat::Style> currentListItemStyles;
78 
79  QString m_text;
80 };
81 }
82 
83 #endif
Creates MediaWiki markup from a QTextDocument.
void beginAnchor(const QString &href=QString(), const QString &name=QString()) override
void beginList(QTextListFormat::Style type) override
void appendLiteralText(const QString &text) override
const QString escape(const QString &s)
void beginHeader(int level) override
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
void endHeader(int level) override