TextCustomEditor::RichTextEditor Class

The RichTextEditor class Author: Laurent Montel <montel@kde.org>. More...

Header: #include <TextCustomEditor/RichTextEditor>
CMake: find_package(KF6TextCustomEditor REQUIRED)
target_link_libraries(mytarget PRIVATE KF6::TextCustomEditor)

Public Functions

RichTextEditor(QWidget *parent = nullptr)
virtual ~RichTextEditor() override
bool activateLanguageMenu() const
void addIgnoreWords(const QStringList &lst)
bool allowTabSupport() const
bool checkSpellingEnabled() const
virtual void createHighlighter()
bool emojiSupport() const
void forceSpellChecking()
Sonnet::Highlighter *highlighter() const
bool quickTextFormat() const
bool searchSupport() const
void setActivateLanguageMenu(bool activate)
void setAllowTabSupport(bool b)
void setCheckSpellingEnabled(bool check)
void setDefaultFontSize(int val)
void setEmojiSupport(bool b)
void setQuickTextFormat(bool b)
virtual void setReadOnly(bool readOnly)
void setSearchSupport(bool b)
void setShowAutoCorrectButton(bool b)
void setSpellCheckingConfigFileName(const QString &_fileName)
void setSpellCheckingLanguage(const QString &_language)
void setSpellCheckingSupport(bool check)
void setTextToSpeechSupport(bool b)
void setWebShortcutSupport(bool b)
bool showAutoCorrectButton() const
QString spellCheckingConfigFileName() const
const QString &spellCheckingLanguage() const
bool spellCheckingSupport() const
bool textToSpeechSupport() const
bool webShortcutSupport() const
int zoomFactor() const

Public Slots

void slotCheckSpelling()
void slotDisplayMessageIndicator(const QString &message)
void slotSpeakText()
void slotZoomReset()

Signals

void checkSpellingChanged(bool)
void findText()
void languageChanged(const QString &)
void replaceText()
void say(const QString &text)
void spellCheckStatus(const QString &)
void spellCheckerAutoCorrect(const QString &currentWord, const QString &autoCorrectWord)
void spellCheckingCanceled()
void spellCheckingFinished()

Protected Functions

virtual void addExtraMenuEntry(QMenu *menu, QPoint pos)
virtual void clearDecorator()
virtual Sonnet::SpellCheckDecorator *createSpellCheckDecorator()
QMenu *mousePopupMenu(QPoint pos)
void setHighlighter(Sonnet::Highlighter *_highLighter)
virtual void updateHighLighter()

Reimplemented Protected Functions

virtual void contextMenuEvent(QContextMenuEvent *event) override
virtual bool event(QEvent *ev) override
virtual void focusInEvent(QFocusEvent *event) override
virtual void keyPressEvent(QKeyEvent *event) override
virtual void wheelEvent(QWheelEvent *e) override

Detailed Description

Member Function Documentation

[explicit] RichTextEditor::RichTextEditor(QWidget *parent = nullptr)

Constructs a new RichTextEditor.

[override virtual noexcept] RichTextEditor::~RichTextEditor()

Destroys the editor.

bool RichTextEditor::activateLanguageMenu() const

Returns whether the language menu is activated.

See also setActivateLanguageMenu().

[virtual protected] void RichTextEditor::addExtraMenuEntry(QMenu *menu, QPoint pos)

void RichTextEditor::addIgnoreWords(const QStringList &lst)

Adds words to the spell checker's ignore list.

bool RichTextEditor::allowTabSupport() const

Returns whether tab support is enabled.

See also setAllowTabSupport().

[signal] void RichTextEditor::checkSpellingChanged(bool)

Emitted when spell checking is enabled or disabled.

bool RichTextEditor::checkSpellingEnabled() const

Returns whether spell checking is currently enabled.

See also setCheckSpellingEnabled().

[virtual protected] void RichTextEditor::clearDecorator()

Clears the spell check decorator.

[override virtual protected] void RichTextEditor::contextMenuEvent(QContextMenuEvent *event)

Handles context menu events.

[virtual] void RichTextEditor::createHighlighter()

Creates the syntax highlighter for the editor.

[virtual protected] Sonnet::SpellCheckDecorator *RichTextEditor::createSpellCheckDecorator()

Creates the spell check decorator for the editor.

bool RichTextEditor::emojiSupport() const

See also setEmojiSupport().

[override virtual protected] bool RichTextEditor::event(QEvent *ev)

Handles general events.

[signal] void RichTextEditor::findText()

Emitted when the user wants to search for text.

[override virtual protected] void RichTextEditor::focusInEvent(QFocusEvent *event)

Handles focus-in events.

void RichTextEditor::forceSpellChecking()

Forces a spell check of the entire document.

Sonnet::Highlighter *RichTextEditor::highlighter() const

Returns the syntax highlighter instance.

See also setHighlighter().

[override virtual protected] void RichTextEditor::keyPressEvent(QKeyEvent *event)

Handles key press events.

[signal] void RichTextEditor::languageChanged(const QString &)

Emitted when the spell checking language changes.

[protected] QMenu *RichTextEditor::mousePopupMenu(QPoint pos)

Returns the context menu for the given position.

bool RichTextEditor::quickTextFormat() const

See also setQuickTextFormat().

[signal] void RichTextEditor::replaceText()

Emitted when the user wants to open the replace dialog.

[signal] void RichTextEditor::say(const QString &text)

Emitted to speak the given text.

bool RichTextEditor::searchSupport() const

Returns whether text search is supported.

See also setSearchSupport().

void RichTextEditor::setActivateLanguageMenu(bool activate)

Sets whether to activate the language menu.

See also activateLanguageMenu().

void RichTextEditor::setAllowTabSupport(bool b)

Sets whether tab key should insert tab characters.

See also allowTabSupport().

void RichTextEditor::setCheckSpellingEnabled(bool check)

Sets whether spell checking should be enabled.

See also checkSpellingEnabled().

void RichTextEditor::setDefaultFontSize(int val)

void RichTextEditor::setEmojiSupport(bool b)

See also emojiSupport().

[protected] void RichTextEditor::setHighlighter(Sonnet::Highlighter *_highLighter)

Sets the syntax highlighter for the editor.

See also highlighter().

void RichTextEditor::setQuickTextFormat(bool b)

See also quickTextFormat().

[virtual] void RichTextEditor::setReadOnly(bool readOnly)

Sets whether the editor is read-only.

void RichTextEditor::setSearchSupport(bool b)

Sets whether to support text search functionality.

See also searchSupport().

void RichTextEditor::setShowAutoCorrectButton(bool b)

Sets whether to show the auto-correct button.

See also showAutoCorrectButton().

void RichTextEditor::setSpellCheckingConfigFileName(const QString &_fileName)

Sets the configuration file name for spell checking.

See also spellCheckingConfigFileName().

void RichTextEditor::setSpellCheckingLanguage(const QString &_language)

Sets the language to use for spell checking.

See also spellCheckingLanguage().

void RichTextEditor::setSpellCheckingSupport(bool check)

Sets whether to support spell checking.

See also spellCheckingSupport().

void RichTextEditor::setTextToSpeechSupport(bool b)

Sets whether to support text-to-speech.

See also textToSpeechSupport().

void RichTextEditor::setWebShortcutSupport(bool b)

Sets whether to support web shortcuts.

See also webShortcutSupport().

bool RichTextEditor::showAutoCorrectButton() const

Returns whether the auto-correct button is shown.

See also setShowAutoCorrectButton().

[slot] void RichTextEditor::slotCheckSpelling()

Checks the spelling of the document.

[slot] void RichTextEditor::slotDisplayMessageIndicator(const QString &message)

Displays a message to the user.

[slot] void RichTextEditor::slotSpeakText()

Speaks the selected text.

[slot] void RichTextEditor::slotZoomReset()

Resets the zoom level to the default.

[signal] void RichTextEditor::spellCheckStatus(const QString &)

Emitted to display spell checking status.

[signal] void RichTextEditor::spellCheckerAutoCorrect(const QString &currentWord, const QString &autoCorrectWord)

Emitted when auto-correction is applied.

[signal] void RichTextEditor::spellCheckingCanceled()

Emitted when spell checking is canceled.

QString RichTextEditor::spellCheckingConfigFileName() const

Returns the spell checking configuration file name.

See also setSpellCheckingConfigFileName().

[signal] void RichTextEditor::spellCheckingFinished()

Emitted when spell checking is finished.

const QString &RichTextEditor::spellCheckingLanguage() const

Returns the language used for spell checking.

See also setSpellCheckingLanguage().

bool RichTextEditor::spellCheckingSupport() const

Returns whether spell checking is supported.

See also setSpellCheckingSupport().

bool RichTextEditor::textToSpeechSupport() const

Returns whether text-to-speech is supported.

See also setTextToSpeechSupport().

[virtual protected] void RichTextEditor::updateHighLighter()

Updates the syntax highlighter.

bool RichTextEditor::webShortcutSupport() const

Returns whether web shortcut support is enabled.

See also setWebShortcutSupport().

[override virtual protected] void RichTextEditor::wheelEvent(QWheelEvent *e)

Handles mouse wheel events for zoom.

int RichTextEditor::zoomFactor() const