KDEUI
krichtextwidget.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KRICHTEXTWIDGET_H
00021 #define KRICHTEXTWIDGET_H
00022
00023 #include "krichtextedit.h"
00024
00025 class KActionCollection;
00026
00043 class KDEUI_EXPORT KRichTextWidget : public KRichTextEdit
00044 {
00045 Q_OBJECT
00046 public:
00047
00052 enum RichTextSupportValues {
00057 DisableRichText = 0x00,
00058
00065 SupportBold = 0x01,
00066
00073 SupportItalic = 0x02,
00074
00081 SupportUnderline = 0x04,
00082
00089 SupportStrikeOut = 0x08,
00090
00099 SupportFontFamily = 0x10,
00100
00108 SupportFontSize = 0x20,
00109
00116 SupportTextForegroundColor = 0x40,
00117
00124 SupportTextBackgroundColor = 0x80,
00125
00130 FullTextFormattingSupport = 0xff,
00131
00139 SupportChangeListStyle = 0x100,
00140
00145 SupportIndentLists = 0x200,
00146
00150 SupportDedentLists = 0x400,
00151
00156 FullListSupport = 0xf00,
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00175 SupportAlignment = 0x100000,
00176
00177
00178
00182 SupportRuleLine = 0x400000,
00183
00189 SupportHyperlinks = 0x800000,
00190
00196 SupportFormatPainting = 0x1000000,
00197
00202 SupportToPlainText = 0x2000000,
00203
00210 SupportSuperScriptAndSubScript = 0x4000000,
00211
00212
00213
00217 FullSupport = 0xffffffff
00218 };
00219 Q_DECLARE_FLAGS(RichTextSupport, RichTextSupportValues)
00220
00221
00225 explicit KRichTextWidget(QWidget *parent);
00226
00234 explicit KRichTextWidget(const QString& text, QWidget *parent = 0);
00235
00239 ~KRichTextWidget();
00240
00283 virtual void createActions(KActionCollection *actionCollection);
00284
00295 void setRichTextSupport(const KRichTextWidget::RichTextSupport &support);
00296
00301 RichTextSupport richTextSupport() const;
00302
00311 void updateActionStates();
00312
00313 public Q_SLOTS:
00314
00322 void setActionsEnabled(bool enabled);
00323
00324 protected:
00329 virtual void mouseReleaseEvent(QMouseEvent *event);
00330
00331
00332 private:
00333
00334 class Private;
00335 friend class Private;
00336 Private *const d;
00337 Q_PRIVATE_SLOT(d, void _k_setTextForegroundColor())
00338 Q_PRIVATE_SLOT(d, void _k_setTextBackgroundColor())
00339 Q_PRIVATE_SLOT(d, void _k_manageLink())
00340 Q_PRIVATE_SLOT(d, void _k_formatPainter(bool))
00341 Q_PRIVATE_SLOT(d, void _k_updateCharFormatActions(const QTextCharFormat &))
00342 Q_PRIVATE_SLOT(d, void _k_updateMiscActions())
00343 Q_PRIVATE_SLOT(d, void _k_setListStyle(int))
00344
00345 };
00346
00347 Q_DECLARE_OPERATORS_FOR_FLAGS(KRichTextWidget::RichTextSupport)
00348
00349 #endif
00350
00351