KDEUI
krichtextedit.h
Go to the documentation of this file.00001
00024 #ifndef KRICHTEXTEDIT_H
00025 #define KRICHTEXTEDIT_H
00026
00027 #include <ktextedit.h>
00028
00029 class QMouseEvent;
00030 class QKeyEvent;
00031
00032 class KRichTextEditPrivate;
00033
00034 #include <kdeui_export.h>
00035
00061 class KDEUI_EXPORT KRichTextEdit : public KTextEdit
00062 {
00063 Q_OBJECT
00064
00065 public:
00066
00070 enum Mode { Plain,
00071 Rich
00072 };
00073
00081 explicit KRichTextEdit(const QString& text, QWidget *parent = 0);
00082
00088 explicit KRichTextEdit(QWidget *parent = 0);
00089
00093 virtual ~KRichTextEdit();
00094
00099 void enableRichTextMode();
00100
00104 Mode textMode() const;
00105
00110 QString textOrHtml() const;
00111
00119 void setTextOrHtml(const QString &text);
00120
00121
00129 QString currentLinkText() const;
00130
00138 QString currentLinkUrl() const;
00139
00148 void selectLinkText(QTextCursor* cursor) const;
00149
00155 void selectLinkText() const;
00156
00168 void updateLink(const QString &linkUrl, const QString &linkText);
00169
00175 bool canIndentList() const;
00176
00182 bool canDedentList() const;
00183
00184 public Q_SLOTS:
00185
00189 void alignLeft();
00190
00194 void alignCenter();
00195
00199 void alignRight();
00200
00204 void alignJustify();
00205
00212 void setListStyle(int _styleIndex);
00213
00219 void indentListMore();
00220
00226 void indentListLess();
00227
00233 void setFontFamily(const QString &fontFamily);
00234
00240 void setFontSize(int size);
00241
00247 void setFont(const QFont &font);
00248
00255 void setTextBold(bool bold);
00256
00263 void setTextItalic(bool italic);
00264
00271 void setTextUnderline(bool underline);
00272
00279 void setTextStrikeOut(bool strikeOut);
00280
00286 void setTextForegroundColor(const QColor &color);
00287
00293 void setTextBackgroundColor(const QColor &color);
00294
00298 void insertHorizontalRule();
00299
00304 void switchToPlainText();
00305
00311 QString toCleanHtml() const;
00312
00313 Q_SIGNALS:
00314
00320 void textModeChanged(KRichTextEdit::Mode mode);
00321
00325 void selectionFinished();
00326
00327 protected:
00328
00333 virtual void keyPressEvent(QKeyEvent *event);
00334
00335 private:
00336
00337 KRichTextEditPrivate *const d;
00338 friend class KRichTextEditPrivate;
00339
00340 };
00341
00342
00343
00344 #endif