kpimtextedit/richtextbuilders
ktexthtmlbuilder.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 #ifndef KTEXTHTMLBUILDER_H 00023 #define KTEXTHTMLBUILDER_H 00024 00025 #include "kabstractmarkupbuilder.h" 00026 00027 class KTextHTMLBuilderPrivate; 00028 00083 class KTextHTMLBuilder : public KAbstractMarkupBuilder 00084 { 00085 public: 00086 00090 KTextHTMLBuilder(); 00091 virtual ~KTextHTMLBuilder(); 00092 00093 virtual void beginStrong(); 00094 virtual void endStrong(); 00095 virtual void beginEmph(); 00096 virtual void endEmph(); 00097 virtual void beginUnderline(); 00098 virtual void endUnderline(); 00099 virtual void beginStrikeout(); 00100 virtual void endStrikeout(); 00101 virtual void beginForeground(const QBrush &brush); 00102 virtual void endForeground(); 00103 virtual void beginBackground(const QBrush &brush); 00104 virtual void endBackground(); 00105 virtual void beginAnchor(const QString &href = QString(), const QString &name = QString()); 00106 virtual void endAnchor(); 00107 00108 // Maybe this stuff should just be added to a list, and then when I add literal text, 00109 // add some kind of style attribute in one span instead of many. 00110 virtual void beginFontFamily(const QString &family); 00111 virtual void endFontFamily(); 00112 00117 virtual void beginFontPointSize(int size); 00118 virtual void endFontPointSize(); 00119 00128 virtual void beginParagraph(Qt::Alignment al = Qt::AlignLeft, qreal topMargin = 0.0, qreal bottomMargin = 0.0, qreal leftMargin = 0.0, qreal rightMargin = 0.0); 00129 00134 virtual void beginHeader(int level); 00135 00140 virtual void endHeader(int level); 00141 00142 virtual void endParagraph(); 00143 virtual void addNewline(); 00144 00145 virtual void insertHorizontalRule(int width = -1); 00146 00147 virtual void insertImage(const QString &src, qreal width, qreal height); 00148 00149 virtual void beginList(QTextListFormat::Style type); 00150 00151 virtual void endList(); 00152 00153 virtual void beginListItem(); 00154 virtual void endListItem(); 00155 00156 virtual void beginSuperscript(); 00157 00158 virtual void endSuperscript(); 00159 00160 virtual void beginSubscript(); 00161 00162 virtual void endSubscript(); 00163 00164 00165 virtual void beginTable(qreal cellpadding, qreal cellspacing, const QString &width); 00166 00167 virtual void beginTableRow(); 00168 virtual void beginTableHeaderCell(const QString &width, int colspan, int rowspan); 00169 00170 virtual void beginTableCell(const QString &width, int colspan, int rowspan); 00171 00172 virtual void endTable(); 00173 virtual void endTableRow(); 00174 virtual void endTableHeaderCell(); 00175 virtual void endTableCell(); 00176 00193 virtual void appendLiteralText(const QString &text); 00194 00195 00196 virtual QString& getResult(); 00197 00198 private: 00199 KTextHTMLBuilderPrivate *d_ptr; 00200 Q_DECLARE_PRIVATE(KTextHTMLBuilder) 00201 00202 }; 00203 00204 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:08:41 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:08:41 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.