Cutelee  6.1.0
mediawikimarkupbuilder.h
1 /*
2  This file is part of the Cutelee 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 CUTELEE_MEDIAWIKIMARKUPBUILDER_H
22 #define CUTELEE_MEDIAWIKIMARKUPBUILDER_H
23 
24 #include "abstractmarkupbuilder.h"
25 
26 namespace Cutelee
27 {
28 
33 {
34 public:
36  ~MediaWikiMarkupBuilder() override;
37 
38  void beginStrong() override;
39  void endStrong() override;
40  void beginEmph() override;
41  void endEmph() override;
42  void beginUnderline() override;
43  void endUnderline() override;
44  void beginStrikeout() override;
45  void endStrikeout() override;
46 
47  void endParagraph() override;
48  void addNewline() override;
49 
50  void beginAnchor(const QString &href = {}, const QString &name = {}) override;
51  void endAnchor() override;
52 
53  void beginHeader(int level) override;
54  void endHeader(int level) override;
55 
56  void beginList(QTextListFormat::Style type) override;
57 
58  void endList() override;
59 
60  void beginListItem() override;
61  void endListItem() override;
62 
63  void appendLiteralText(const QString &text) override;
64 
68  const QString escape(const QString &s);
69 
70  QString getResult() override;
71 
72 private:
73  QList<QTextListFormat::Style> currentListItemStyles;
74 
75  QString m_text;
76 };
77 }
78 
79 #endif
Interface for creating marked-up text output.
Creates MediaWiki markup from a QTextDocument.
void appendLiteralText(const QString &text) override
void beginAnchor(const QString &href={}, const QString &name={}) override
const QString escape(const QString &s)
void beginList(QTextListFormat::Style type) override
The Cutelee namespace holds all public Cutelee API.
Definition: Mainpage.dox:8