Grantlee: textdocument/lib/plaintextmarkupbuilder.h Source File

Grantlee 5.3.0

plaintextmarkupbuilder.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_PLAINTEXTMARKUPBUILDER_H
22#define GRANTLEE_PLAINTEXTMARKUPBUILDER_H
23
24#ifdef Q_OS_WIN
25#pragma warning(disable : 4250)
26#endif
27
28#define LETTERSINALPHABET 26
29#define DIGITSOFFSET 10
30
31#include "abstractmarkupbuilder.h"
32#include "grantlee_textdocument_export.h"
33#include "markupdirector.h"
34
35class QBrush;
36
37namespace Grantlee
38{
39
40class PlainTextMarkupBuilderPrivate;
41
43
104 class GRANTLEE_TEXTDOCUMENT_EXPORT PlainTextMarkupBuilder
105 : virtual public AbstractMarkupBuilder
106{
107public:
108 PlainTextMarkupBuilder();
109
110 ~PlainTextMarkupBuilder() override;
111
112 void beginStrong() override;
113 void endStrong() override;
114 void beginEmph() override;
115 void endEmph() override;
116 void beginUnderline() override;
117 void endUnderline() override;
118 void beginStrikeout() override;
119 void endStrikeout() override;
120
121 void beginAnchor(const QString &href = {}, const QString &name = {}) override;
122
123 void endAnchor() override;
124
125 void beginForeground(const QBrush &brush) override;
126
127 void endForeground() override;
128
129 void beginBackground(const QBrush &brush) override;
130
131 void endBackground() override;
132
133 void beginFontFamily(const QString &family) override;
134
135 void endFontFamily() override;
136
137 void beginFontPointSize(int size) override;
138
139 void endFontPointSize() override;
140
141 void beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0,
142 qreal bottom = 0.0, qreal left = 0.0,
143 qreal right = 0.0) override;
144
145 void endParagraph() override;
146 void addNewline() override;
147
148 void insertHorizontalRule(int width = -1) override;
149
150 void insertImage(const QString &src, qreal width, qreal height) override;
151
152 void beginList(QTextListFormat::Style style) override;
153
154 void endList() override;
155
156 void beginListItem() override;
157
158 void endListItem() override;
159
160 void beginSuperscript() override;
161
162 void endSuperscript() override;
163
164 void beginSubscript() override;
165
166 void endSubscript() override;
167
168 void beginTable(qreal cellpadding, qreal cellspacing,
169 const QString &width) override;
170
171 void beginTableRow() override;
172
173 void beginTableHeaderCell(const QString &width, int colSpan,
174 int rowSpan) override;
175
176 void beginTableCell(const QString &width, int colSpan, int rowSpan) override;
177
178 void endTable() override;
179
180 void endTableRow() override;
181
182 void endTableHeaderCell() override;
183
184 void endTableCell() override;
185
186 void beginHeader(int level) override;
187
188 void endHeader(int level) override;
189
190 void appendLiteralText(const QString &text) override;
191
192 void appendRawText(const QString &text) override;
193
198 int addReference(const QString &reference);
199
203 QString getResult() override;
204
205private:
206 PlainTextMarkupBuilderPrivate *const d_ptr;
207 Q_DECLARE_PRIVATE(PlainTextMarkupBuilder)
208};
209}
210
211#endif
Grantlee::AbstractMarkupBuilder
Interface for creating marked-up text output.
Definition: abstractmarkupbuilder.h:52
Grantlee::PlainTextMarkupBuilder
Creates a simple marked up plain text document.
Definition: plaintextmarkupbuilder.h:106
Grantlee::PlainTextMarkupBuilder::beginTableHeaderCell
void beginTableHeaderCell(const QString &width, int colSpan, int rowSpan) override
Grantlee::PlainTextMarkupBuilder::beginStrikeout
void beginStrikeout() override
Grantlee::PlainTextMarkupBuilder::addReference
int addReference(const QString &reference)
Grantlee::PlainTextMarkupBuilder::beginTableRow
void beginTableRow() override
Grantlee::PlainTextMarkupBuilder::beginForeground
void beginForeground(const QBrush &brush) override
Grantlee::PlainTextMarkupBuilder::endStrong
void endStrong() override
Grantlee::PlainTextMarkupBuilder::endStrikeout
void endStrikeout() override
Grantlee::PlainTextMarkupBuilder::beginUnderline
void beginUnderline() override
Grantlee::PlainTextMarkupBuilder::endFontPointSize
void endFontPointSize() override
Grantlee::PlainTextMarkupBuilder::beginList
void beginList(QTextListFormat::Style style) override
Grantlee::PlainTextMarkupBuilder::endAnchor
void endAnchor() override
Grantlee::PlainTextMarkupBuilder::beginSubscript
void beginSubscript() override
Grantlee::PlainTextMarkupBuilder::endSubscript
void endSubscript() override
Grantlee::PlainTextMarkupBuilder::appendLiteralText
void appendLiteralText(const QString &text) override
Grantlee::PlainTextMarkupBuilder::beginEmph
void beginEmph() override
Grantlee::PlainTextMarkupBuilder::beginFontFamily
void beginFontFamily(const QString &family) override
Grantlee::PlainTextMarkupBuilder::endList
void endList() override
Grantlee::PlainTextMarkupBuilder::beginSuperscript
void beginSuperscript() override
Grantlee::PlainTextMarkupBuilder::beginHeader
void beginHeader(int level) override
Grantlee::PlainTextMarkupBuilder::endListItem
void endListItem() override
Grantlee::PlainTextMarkupBuilder::endTable
void endTable() override
Grantlee::PlainTextMarkupBuilder::beginTable
void beginTable(qreal cellpadding, qreal cellspacing, const QString &width) override
Grantlee::PlainTextMarkupBuilder::endTableHeaderCell
void endTableHeaderCell() override
Grantlee::PlainTextMarkupBuilder::endSuperscript
void endSuperscript() override
Grantlee::PlainTextMarkupBuilder::beginBackground
void beginBackground(const QBrush &brush) override
Grantlee::PlainTextMarkupBuilder::endUnderline
void endUnderline() override
Grantlee::PlainTextMarkupBuilder::endForeground
void endForeground() override
Grantlee::PlainTextMarkupBuilder::beginTableCell
void beginTableCell(const QString &width, int colSpan, int rowSpan) override
Grantlee::PlainTextMarkupBuilder::addNewline
void addNewline() override
Grantlee::PlainTextMarkupBuilder::beginAnchor
void beginAnchor(const QString &href={}, const QString &name={}) override
Grantlee::PlainTextMarkupBuilder::beginStrong
void beginStrong() override
Grantlee::PlainTextMarkupBuilder::appendRawText
void appendRawText(const QString &text) override
Grantlee::PlainTextMarkupBuilder::insertHorizontalRule
void insertHorizontalRule(int width=-1) override
Grantlee::PlainTextMarkupBuilder::beginFontPointSize
void beginFontPointSize(int size) override
Grantlee::PlainTextMarkupBuilder::endEmph
void endEmph() override
Grantlee::PlainTextMarkupBuilder::beginParagraph
void beginParagraph(Qt::Alignment a=Qt::AlignLeft, qreal top=0.0, qreal bottom=0.0, qreal left=0.0, qreal right=0.0) override
Grantlee::PlainTextMarkupBuilder::getResult
QString getResult() override
Grantlee::PlainTextMarkupBuilder::endFontFamily
void endFontFamily() override
Grantlee::PlainTextMarkupBuilder::beginListItem
void beginListItem() override
Grantlee::PlainTextMarkupBuilder::insertImage
void insertImage(const QString &src, qreal width, qreal height) override
Grantlee::PlainTextMarkupBuilder::endHeader
void endHeader(int level) override
Grantlee::PlainTextMarkupBuilder::endTableRow
void endTableRow() override
Grantlee::PlainTextMarkupBuilder::endBackground
void endBackground() override
Grantlee::PlainTextMarkupBuilder::endTableCell
void endTableCell() override
Grantlee::PlainTextMarkupBuilder::endParagraph
void endParagraph() override
Grantlee
The Grantlee namespace holds all public Grantlee API.
Definition: Mainpage.dox:8