kpimtextedit/richtextbuilders
kabstractmarkupbuilder.h
00001 /* 00002 This file is part of KDE. 00003 00004 Copyright (c) 2008 Stephen Kelly <steveire@gmail.com> 00005 00006 This library is free software; you can redistribute it and/or modify it 00007 under the terms of the GNU Library General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or (at your 00009 option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, but WITHOUT 00012 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00013 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00014 License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to the 00018 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00019 02110-1301, USA. 00020 */ 00021 00022 // Any class for which you cannot create instances is an abstract class. 00023 00024 #ifndef KABSTRACTMARKUPBUILDER_H 00025 #define KABSTRACTMARKUPBUILDER_H 00026 00027 00028 #include <QString> 00029 #include <QBrush> 00030 #include <QTextList> 00031 #include <QTextDocument> 00032 00060 class KAbstractMarkupBuilder 00061 { 00062 public: 00063 00066 enum ExtraElement { UserElement = 100 }; 00067 00069 virtual ~KAbstractMarkupBuilder() {} 00070 00072 virtual void beginStrong() { } 00073 00075 virtual void endStrong() { } 00076 00078 virtual void beginEmph() { } 00079 00081 virtual void endEmph() { } 00082 00084 virtual void beginUnderline() { } 00085 00087 virtual void endUnderline() { } 00088 00090 virtual void beginStrikeout() { } 00091 00093 virtual void endStrikeout() { } 00094 00096 virtual void beginForeground(const QBrush &brush) { 00097 Q_UNUSED(brush); 00098 } 00099 00101 virtual void endForeground() { } 00102 00104 virtual void beginBackground(const QBrush &brush) { 00105 Q_UNUSED(brush); 00106 } 00107 00109 virtual void endBackground() { } 00110 00115 virtual void beginAnchor(const QString &href = QString(), const QString &name = QString()) { 00116 Q_UNUSED(href); 00117 Q_UNUSED(name); 00118 } 00119 00121 virtual void endAnchor() { } 00122 00126 virtual void beginFontFamily(const QString &family) { 00127 Q_UNUSED(family); 00128 } 00130 virtual void endFontFamily() { } 00131 00135 virtual void beginFontPointSize(int size) { 00136 Q_UNUSED(size); 00137 } 00139 virtual void endFontPointSize() { } 00140 00148 virtual void beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0, qreal bottom = 0.0, qreal left = 0.0, qreal right = 0.0) { 00149 Q_UNUSED(a); 00150 Q_UNUSED(top); 00151 Q_UNUSED(bottom); 00152 Q_UNUSED(left); 00153 Q_UNUSED(right); 00154 } 00155 00156 00158 virtual void endParagraph() { } 00160 virtual void addNewline() { } 00161 00165 virtual void insertHorizontalRule(int width = -1) { 00166 Q_UNUSED(width); 00167 } 00168 00175 virtual void insertImage(const QString &url, qreal width, qreal height) { 00176 Q_UNUSED(url); 00177 Q_UNUSED(width); 00178 Q_UNUSED(height); 00179 } 00180 00186 virtual void beginList(QTextListFormat::Style style) { 00187 Q_UNUSED(style); 00188 } 00189 00193 virtual void endList() { } 00194 00196 virtual void beginListItem() { } 00197 00199 virtual void endListItem() { } 00200 00202 virtual void beginSuperscript() { } 00203 00205 virtual void endSuperscript() { } 00206 00208 virtual void beginSubscript() { } 00209 00211 virtual void endSubscript() { } 00212 00220 virtual void beginTable(qreal cellpadding, qreal cellspacing, const QString &width) { 00221 Q_UNUSED(cellpadding); 00222 Q_UNUSED(cellspacing); 00223 Q_UNUSED(width); 00224 } 00225 00229 virtual void beginTableRow() { } 00230 00237 virtual void beginTableHeaderCell(const QString &width, int colSpan, int rowSpan) { 00238 Q_UNUSED(width); 00239 Q_UNUSED(colSpan); 00240 Q_UNUSED(rowSpan); 00241 } 00242 00249 virtual void beginTableCell(const QString &width, int colSpan, int rowSpan) { 00250 Q_UNUSED(width); 00251 Q_UNUSED(colSpan); 00252 Q_UNUSED(rowSpan); 00253 } 00254 00256 virtual void endTable() { } 00257 00259 virtual void endTableRow() { } 00260 00262 virtual void endTableHeaderCell() { } 00263 00265 virtual void endTableCell() { } 00266 00271 virtual void beginHeader(int level) { 00272 Q_UNUSED(level); 00273 } 00274 00279 virtual void endHeader(int level) { 00280 Q_UNUSED(level); 00281 } 00282 00283 00290 virtual void beginExtraElement(int type, QVariantList args) { 00291 Q_UNUSED(type); 00292 Q_UNUSED(args); 00293 } 00294 00299 virtual void endExtraElement(int type) { 00300 Q_UNUSED(type); 00301 } 00302 00308 virtual void appendLiteralText(const QString &text) = 0; 00309 00314 virtual QString& getResult() = 0; 00315 00316 }; 00317 00318 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:44:29 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:44:29 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.