10#ifndef KRICHTEXTEDIT_H
11#define KRICHTEXTEDIT_H
17class KRichTextEditPrivate;
19#include <ktextwidgets_export.h>
156 void updateLink(
const QString &linkUrl,
const QString &linkText);
357#if KTEXTWIDGETS_ENABLE_DEPRECATED_SINCE(5, 101)
362 KTEXTWIDGETS_DEPRECATED_VERSION_BELATED(5, 101, 4, 1,
"No longer emitted")
363 void selectionFinished();
374 KTEXTWIDGETS_NO_EXPORT
KRichTextEdit(KRichTextEditPrivate &dd,
const QString &text, QWidget *parent);
375 KTEXTWIDGETS_NO_EXPORT
KRichTextEdit(KRichTextEditPrivate &dd, QWidget *parent);
380#if KTEXTWIDGETS_BUILD_DEPRECATED_SINCE(5, 79)
382 QT_WARNING_DISABLE_CLANG(
"-Wunused-private-field")
384 const
void *__ktextwidgets_d_do_not_use;
The KRichTextEdit class provides a widget to edit and display rich text.
Definition krichtextedit.h:51
void insertPlainTextImplementation()
KRichTextEdit(QWidget *parent=nullptr)
Constructs a KRichTextEdit object.
void setTextStrikeOut(bool strikeOut)
Toggles the strikeout formatting of the current word or selection at the current cursor position.
void setTextSubScript(bool subscript)
Toggles the subscript formatting of the current word or selection at the current cursor position.
void alignRight()
Sets the alignment of the current block to Right Aligned.
void setTextForegroundColor(const QColor &color)
Sets the foreground color of the current word or selection to color.
void setTextBackgroundColor(const QColor &color)
Sets the background color of the current word or selection to color.
void insertHorizontalRule()
Inserts a horizontal rule below the current block.
void enableRichTextMode()
This enables rich text mode.
bool canDedentList() const
Returns true if the list item at the current position can be dedented.
QString currentLinkText() const
Returns the text of the link at the current position or an empty string if the cursor is not on a lin...
void setFont(const QFont &font)
Sets the current word or selection to the font font.
void selectLinkText(QTextCursor *cursor) const
If the cursor is on a link, sets the cursor to a selection of the text of the link.
void alignJustify()
Sets the alignment of the current block to Justified.
void switchToPlainText()
This will switch the editor to plain text mode.
void setTextOrHtml(const QString &text)
Replaces all the content of the text edit with the given string.
void setTextUnderline(bool underline)
Toggles the underline formatting of the current word or selection at the current cursor position.
void textModeChanged(KRichTextEdit::Mode mode)
Emitted whenever the text mode is changed.
void setHeadingLevel(int level)
Sets the heading level of a current block or selection.
QString toCleanHtml() const
This will clean some of the bad html produced by the underlying QTextEdit It walks over all lines and...
QString textOrHtml() const
void selectLinkText() const
Convenience function to select the link text using the active cursor.
Mode
The mode the edit widget is in.
Definition krichtextedit.h:58
@ Plain
Plain text mode.
Definition krichtextedit.h:59
@ Rich
Rich text mode.
Definition krichtextedit.h:60
void setFontSize(int size)
Sets the current word or selection to the font size size.
void indentListLess()
Decreases the nesting level of the current block or selected blocks.
void setFontFamily(const QString &fontFamily)
Sets the current word or selection to the font family fontFamily.
void makeLeftToRight()
Sets the direction of the current block to Left-To-Right.
KRichTextEdit(const QString &text, QWidget *parent=nullptr)
Constructs a KRichTextEdit object.
~KRichTextEdit() override
Destructor.
void keyPressEvent(QKeyEvent *event) override
Reimplemented.
QString currentLinkUrl() const
Returns the URL target (href) of the link at the current position or an empty string if the cursor is...
void setListStyle(int _styleIndex)
Sets the list style of the current list, or creates a new list using the current block.
void indentListMore()
Increases the nesting level of the current block or selected blocks.
void alignLeft()
Sets the alignment of the current block to Left Aligned.
void setTextSuperScript(bool superscript)
Toggles the superscript formatting of the current word or selection at the current cursor position.
void setTextBold(bool bold)
Toggles the bold formatting of the current word or selection at the current cursor position.
void setTextItalic(bool italic)
Toggles the italic formatting of the current word or selection at the current cursor position.
void makeRightToLeft()
Sets the direction of the current block to Right-To-Left.
bool canIndentList() const
Returns true if the list item at the current position can be indented.
void alignCenter()
Sets the alignment of the current block to Centered.
void updateLink(const QString &linkUrl, const QString &linkText)
Replaces the current selection with a hyperlink with the link URL linkUrl and the link text linkText.
A KDE'ified QTextEdit.
Definition ktextedit.h:46