Grantlee 0.1.9
|
00001 /* 00002 This file is part of the Grantlee template system. 00003 00004 Copyright (c) 2008 Stephen Kelly <steveire@gmail.com> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either version 00009 2.1 of the Licence, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public 00017 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00018 00019 */ 00020 00021 #ifndef GRANTLEE_PLAINTEXTMARKUPBUILDER_H 00022 #define GRANTLEE_PLAINTEXTMARKUPBUILDER_H 00023 00024 00025 #ifdef Q_OS_WIN 00026 #pragma warning( disable : 4250 ) 00027 #endif 00028 00029 #define LETTERSINALPHABET 26 00030 #define DIGITSOFFSET 10 00031 00032 #include "abstractmarkupbuilder.h" 00033 #include "grantlee_gui_export.h" 00034 #include "markupdirector.h" 00035 00036 class QBrush; 00037 00038 namespace Grantlee 00039 { 00040 00041 class PlainTextMarkupBuilderPrivate; 00042 00044 00096 class GRANTLEE_GUI_EXPORT PlainTextMarkupBuilder : virtual public AbstractMarkupBuilder 00097 { 00098 public: 00100 PlainTextMarkupBuilder(); 00101 00102 virtual ~PlainTextMarkupBuilder(); 00103 00104 /* reimp */ void beginStrong(); 00105 /* reimp */ void endStrong(); 00106 /* reimp */ void beginEmph(); 00107 /* reimp */ void endEmph(); 00108 /* reimp */ void beginUnderline(); 00109 /* reimp */ void endUnderline(); 00110 /* reimp */ void beginStrikeout(); 00111 /* reimp */ void endStrikeout(); 00112 00113 /* reimp */ void beginAnchor( const QString &href = QString(), const QString &name = QString() ); 00114 00115 /* reimp */ void endAnchor(); 00116 00117 /* reimp */ void beginForeground( const QBrush &brush ); 00118 00119 /* reimp */ void endForeground(); 00120 00121 /* reimp */ void beginBackground( const QBrush &brush ); 00122 00123 /* reimp */ void endBackground(); 00124 00125 /* reimp */ void beginFontFamily( const QString &family ); 00126 00127 /* reimp */ void endFontFamily(); 00128 00129 /* reimp */ void beginFontPointSize( int size ); 00130 00131 /* reimp */ void endFontPointSize(); 00132 00133 /* reimp */ void beginParagraph( Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0, qreal bottom = 0.0, qreal left = 0.0, qreal right = 0.0 ); 00134 00135 /* reimp */ void endParagraph(); 00136 /* reimp */ void addNewline(); 00137 00138 /* reimp */ void insertHorizontalRule( int width = -1 ); 00139 00140 /* reimp */ void insertImage( const QString &src, qreal width, qreal height ); 00141 00142 /* reimp */ void beginList( QTextListFormat::Style style ); 00143 00144 /* reimp */ void endList(); 00145 00146 /* reimp */ void beginListItem(); 00147 00148 /* reimp */ void endListItem(); 00149 00150 /* reimp */ void beginSuperscript(); 00151 00152 /* reimp */ void endSuperscript(); 00153 00154 /* reimp */ void beginSubscript(); 00155 00156 /* reimp */ void endSubscript(); 00157 00158 /* reimp */ void beginTable( qreal cellpadding, qreal cellspacing, const QString &width ); 00159 00160 /* reimp */ void beginTableRow(); 00161 00162 /* reimp */ void beginTableHeaderCell( const QString &width, int colSpan, int rowSpan ); 00163 00164 /* reimp */ void beginTableCell( const QString &width, int colSpan, int rowSpan ); 00165 00166 /* reimp */ void endTable(); 00167 00168 /* reimp */ void endTableRow(); 00169 00170 /* reimp */ void endTableHeaderCell(); 00171 00172 /* reimp */ void endTableCell(); 00173 00174 /* reimp */ void beginHeader( int level ); 00175 00176 /* reimp */ void endHeader( int level ); 00177 00178 /* reimp */ void appendLiteralText( const QString &text ); 00179 00180 /* reimp */ void appendRawText( const QString &text ); 00181 00185 int addReference( const QString &reference ); 00186 00190 /* reimp */ QString getResult(); 00191 00192 private: 00193 PlainTextMarkupBuilderPrivate * const d_ptr; 00194 Q_DECLARE_PRIVATE( PlainTextMarkupBuilder ) 00195 00196 }; 00197 00198 } 00199 00200 #endif