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
00204
00205
00209 FullSupport = 0xffffffff
00210 };
00211 Q_DECLARE_FLAGS(RichTextSupport, RichTextSupportValues)
00212
00213
00217 explicit KRichTextWidget(QWidget *parent);
00218
00226 explicit KRichTextWidget(const QString& text, QWidget *parent = 0);
00227
00231 ~KRichTextWidget();
00232
00274 virtual void createActions(KActionCollection *actionCollection);
00275
00286 void setRichTextSupport(const KRichTextWidget::RichTextSupport &support);
00287
00292 RichTextSupport richTextSupport() const;
00293
00302 void updateActionStates();
00303
00304 public Q_SLOTS:
00305
00313 void setActionsEnabled(bool enabled);
00314
00315 protected:
00320 virtual void mouseReleaseEvent(QMouseEvent *event);
00321
00322
00323 private:
00324
00325 class Private;
00326 friend class Private;
00327 Private *const d;
00328 Q_PRIVATE_SLOT(d, void _k_setTextForegroundColor())
00329 Q_PRIVATE_SLOT(d, void _k_setTextBackgroundColor())
00330 Q_PRIVATE_SLOT(d, void _k_manageLink())
00331 Q_PRIVATE_SLOT(d, void _k_formatPainter(bool))
00332 Q_PRIVATE_SLOT(d, void _k_updateCharFormatActions(const QTextCharFormat &))
00333 Q_PRIVATE_SLOT(d, void _k_updateMiscActions())
00334 Q_PRIVATE_SLOT(d, void _k_setListStyle(int))
00335
00336 };
00337
00338 Q_DECLARE_OPERATORS_FOR_FLAGS(KRichTextWidget::RichTextSupport)
00339
00340 #endif
00341
00342