• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.9.1 API Reference
  • KDE Home
  • Contact Us
 

kpimtextedit/richtextbuilders

  • kpimtextedit
  • richtextbuilders
kabstractmarkupbuilder.h
1 /*
2  This file is part of KDE.
3 
4  Copyright (c) 2008 Stephen Kelly <steveire@gmail.com>
5 
6  This library is free software; you can redistribute it and/or modify it
7  under the terms of the GNU Library General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or (at your
9  option) any later version.
10 
11  This library is distributed in the hope that it will be useful, but WITHOUT
12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14  License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to the
18  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  02110-1301, USA.
20 */
21 
22 // Any class for which you cannot create instances is an abstract class.
23 
24 #ifndef KABSTRACTMARKUPBUILDER_H
25 #define KABSTRACTMARKUPBUILDER_H
26 
27 
28 #include <QString>
29 #include <QBrush>
30 #include <QTextList>
31 #include <QTextDocument>
32 
60 class KAbstractMarkupBuilder
61 {
62 public:
63 
66  enum ExtraElement { UserElement = 100 };
67 
69  virtual ~KAbstractMarkupBuilder() {}
70 
72  virtual void beginStrong() { }
73 
75  virtual void endStrong() { }
76 
78  virtual void beginEmph() { }
79 
81  virtual void endEmph() { }
82 
84  virtual void beginUnderline() { }
85 
87  virtual void endUnderline() { }
88 
90  virtual void beginStrikeout() { }
91 
93  virtual void endStrikeout() { }
94 
96  virtual void beginForeground(const QBrush &brush) {
97  Q_UNUSED(brush);
98  }
99 
101  virtual void endForeground() { }
102 
104  virtual void beginBackground(const QBrush &brush) {
105  Q_UNUSED(brush);
106  }
107 
109  virtual void endBackground() { }
110 
115  virtual void beginAnchor(const QString &href = QString(), const QString &name = QString()) {
116  Q_UNUSED(href);
117  Q_UNUSED(name);
118  }
119 
121  virtual void endAnchor() { }
122 
126  virtual void beginFontFamily(const QString &family) {
127  Q_UNUSED(family);
128  }
130  virtual void endFontFamily() { }
131 
135  virtual void beginFontPointSize(int size) {
136  Q_UNUSED(size);
137  }
139  virtual void endFontPointSize() { }
140 
148  virtual void beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0, qreal bottom = 0.0, qreal left = 0.0, qreal right = 0.0) {
149  Q_UNUSED(a);
150  Q_UNUSED(top);
151  Q_UNUSED(bottom);
152  Q_UNUSED(left);
153  Q_UNUSED(right);
154  }
155 
156 
158  virtual void endParagraph() { }
160  virtual void addNewline() { }
161 
165  virtual void insertHorizontalRule(int width = -1) {
166  Q_UNUSED(width);
167  }
168 
175  virtual void insertImage(const QString &url, qreal width, qreal height) {
176  Q_UNUSED(url);
177  Q_UNUSED(width);
178  Q_UNUSED(height);
179  }
180 
186  virtual void beginList(QTextListFormat::Style style) {
187  Q_UNUSED(style);
188  }
189 
193  virtual void endList() { }
194 
196  virtual void beginListItem() { }
197 
199  virtual void endListItem() { }
200 
202  virtual void beginSuperscript() { }
203 
205  virtual void endSuperscript() { }
206 
208  virtual void beginSubscript() { }
209 
211  virtual void endSubscript() { }
212 
220  virtual void beginTable(qreal cellpadding, qreal cellspacing, const QString &width) {
221  Q_UNUSED(cellpadding);
222  Q_UNUSED(cellspacing);
223  Q_UNUSED(width);
224  }
225 
229  virtual void beginTableRow() { }
230 
237  virtual void beginTableHeaderCell(const QString &width, int colSpan, int rowSpan) {
238  Q_UNUSED(width);
239  Q_UNUSED(colSpan);
240  Q_UNUSED(rowSpan);
241  }
242 
249  virtual void beginTableCell(const QString &width, int colSpan, int rowSpan) {
250  Q_UNUSED(width);
251  Q_UNUSED(colSpan);
252  Q_UNUSED(rowSpan);
253  }
254 
256  virtual void endTable() { }
257 
259  virtual void endTableRow() { }
260 
262  virtual void endTableHeaderCell() { }
263 
265  virtual void endTableCell() { }
266 
271  virtual void beginHeader(int level) {
272  Q_UNUSED(level);
273  }
274 
279  virtual void endHeader(int level) {
280  Q_UNUSED(level);
281  }
282 
283 
290  virtual void beginExtraElement(int type, QVariantList args) {
291  Q_UNUSED(type);
292  Q_UNUSED(args);
293  }
294 
299  virtual void endExtraElement(int type) {
300  Q_UNUSED(type);
301  }
302 
308  virtual void appendLiteralText(const QString &text) = 0;
309 
314  virtual QString& getResult() = 0;
315 
316 };
317 
318 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Sep 24 2012 09:03:57 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kpimtextedit/richtextbuilders

Skip menu "kpimtextedit/richtextbuilders"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.9.1 API Reference

Skip menu "kdepimlibs-4.9.1 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal