Grantlee 5.3.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
32 class MediaWikiMarkupBuilder : public AbstractMarkupBuilder
33{
34 public:
35 MediaWikiMarkupBuilder();
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
Grantlee::AbstractMarkupBuilder
Interface for creating marked-up text output.
Definition: abstractmarkupbuilder.h:52
Grantlee::MediaWikiMarkupBuilder
Creates MediaWiki markup from a QTextDocument.
Definition: mediawikimarkupbuilder.h:33
Grantlee::MediaWikiMarkupBuilder::endHeader
void endHeader(int level) override
Grantlee::MediaWikiMarkupBuilder::endParagraph
void endParagraph() override
Grantlee::MediaWikiMarkupBuilder::beginStrong
void beginStrong() override
Grantlee::MediaWikiMarkupBuilder::escape
const QString escape(const QString &s)
Grantlee::MediaWikiMarkupBuilder::beginStrikeout
void beginStrikeout() override
Grantlee::MediaWikiMarkupBuilder::beginListItem
void beginListItem() override
Grantlee::MediaWikiMarkupBuilder::endStrong
void endStrong() override
Grantlee::MediaWikiMarkupBuilder::beginEmph
void beginEmph() override
Grantlee::MediaWikiMarkupBuilder::beginList
void beginList(QTextListFormat::Style type) override
Grantlee::MediaWikiMarkupBuilder::endList
void endList() override
Grantlee::MediaWikiMarkupBuilder::getResult
QString getResult() override
Grantlee::MediaWikiMarkupBuilder::addNewline
void addNewline() override
Grantlee::MediaWikiMarkupBuilder::endListItem
void endListItem() override
Grantlee::MediaWikiMarkupBuilder::beginAnchor
void beginAnchor(const QString &href={}, const QString &name={}) override
Grantlee::MediaWikiMarkupBuilder::endUnderline
void endUnderline() override
Grantlee::MediaWikiMarkupBuilder::beginUnderline
void beginUnderline() override
Grantlee::MediaWikiMarkupBuilder::endEmph
void endEmph() override
Grantlee::MediaWikiMarkupBuilder::beginHeader
void beginHeader(int level) override
Grantlee::MediaWikiMarkupBuilder::appendLiteralText
void appendLiteralText(const QString &text) override
Grantlee::MediaWikiMarkupBuilder::endStrikeout
void endStrikeout() override
Grantlee::MediaWikiMarkupBuilder::endAnchor
void endAnchor() override
Grantlee
The Grantlee namespace holds all public Grantlee API.
Definition: Mainpage.dox:8