• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • widgets
krichtextedit.h
Go to the documentation of this file.
1
24#ifndef KRICHTEXTEDIT_H
25#define KRICHTEXTEDIT_H
26
27#include <ktextedit.h>
28
29class QMouseEvent;
30class QKeyEvent;
31
32class KRichTextEditPrivate;
33
34#include <kdeui_export.h>
35
36#define HAVE_INSERTPLAINTEXT 1
37
65class KDEUI_EXPORT KRichTextEdit : public KTextEdit
66{
67 Q_OBJECT
68
69public:
70
74 enum Mode { Plain,
75 Rich
76 };
77
85 explicit KRichTextEdit(const QString& text, QWidget *parent = 0);
86
92 explicit KRichTextEdit(QWidget *parent = 0);
93
97 virtual ~KRichTextEdit();
98
103 void enableRichTextMode();
104
108 Mode textMode() const;
109
114 QString textOrHtml() const;
115
123 void setTextOrHtml(const QString &text);
124
125
133 QString currentLinkText() const;
134
142 QString currentLinkUrl() const;
143
152 void selectLinkText(QTextCursor* cursor) const;
153
159 void selectLinkText() const;
160
172 void updateLink(const QString &linkUrl, const QString &linkText);
173
179 bool canIndentList() const;
180
186 bool canDedentList() const;
187
188public Q_SLOTS:
189
193 void alignLeft();
194
198 void alignCenter();
199
203 void alignRight();
204
208 void alignJustify();
209
215 void makeRightToLeft();
216
222 void makeLeftToRight();
223
230 void setListStyle(int _styleIndex);
231
237 void indentListMore();
238
244 void indentListLess();
245
251 void setFontFamily(const QString &fontFamily);
252
258 void setFontSize(int size);
259
265 void setFont(const QFont &font);
266
273 void setTextBold(bool bold);
274
281 void setTextItalic(bool italic);
282
289 void setTextUnderline(bool underline);
290
297 void setTextStrikeOut(bool strikeOut);
298
304 void setTextForegroundColor(const QColor &color);
305
311 void setTextBackgroundColor(const QColor &color);
312
316 void insertHorizontalRule();
317
322 void switchToPlainText();
323
329 QString toCleanHtml() const;
330
337 void setTextSuperScript(bool superscript);
338
345 void setTextSubScript(bool subscript);
346
352 void insertPlainTextImplementation();
353
354Q_SIGNALS:
355
361 void textModeChanged(KRichTextEdit::Mode mode);
362
366 void selectionFinished();
367
368protected:
369
374 virtual void keyPressEvent(QKeyEvent *event);
375
376private:
377 //@cond PRIVATE
378 KRichTextEditPrivate *const d;
379 friend class KRichTextEditPrivate;
380 //@endcond
381};
382
383
384
385#endif
KRichTextEdit
The KRichTextEdit class provides a widget to edit and display rich text.
Definition: krichtextedit.h:66
KRichTextEdit::selectionFinished
void selectionFinished()
Emitted whenever the user has finished making a selection.
KRichTextEdit::textModeChanged
void textModeChanged(KRichTextEdit::Mode mode)
Emitted whenever the text mode is changed.
KRichTextEdit::Mode
Mode
The mode the edit widget is in.
Definition: krichtextedit.h:74
KTextEdit
A KDE'ified QTextEdit.
Definition: ktextedit.h:91
QWidget
kdeui_export.h
ktextedit.h
Plain
Plain
Rich
Rich
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal