Sonnet::BackgroundChecker
#include <Sonnet/BackgroundChecker>
Signals | |
void | done () |
void | misspelling (const QString &word, int start) |
Public Slots | |
void | changeLanguage (const QString &lang) |
virtual void | continueChecking () |
void | replace (int start, const QString &oldText, const QString &newText) |
virtual void | start () |
virtual void | stop () |
Protected Slots | |
void | slotEngineDone () |
Protected Member Functions | |
virtual QString | fetchMoreText () |
virtual void | finishedCurrentFeed () |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
BackgroundChecker is used to perform spell checking without blocking the application.
You can use it as is by calling the checkText function or subclass it and reimplement getMoreText function.
The misspelling signal is emitted whenever a misspelled word is found. The background checker stops right before emitting the signal. So the parent has to call continueChecking function to resume the checking.
done signal is emitted when whole text is spell checked.
class used for spell checking in the background
Definition at line 45 of file backgroundchecker.h.
Constructor & Destructor Documentation
◆ BackgroundChecker() [1/2]
Definition at line 67 of file backgroundchecker.cpp.
◆ BackgroundChecker() [2/2]
|
explicit |
Definition at line 75 of file backgroundchecker.cpp.
Member Function Documentation
◆ addWordToPersonal()
Definition at line 140 of file backgroundchecker.cpp.
◆ addWordToSession()
This method is used to add a word to the session of the speller currently set in BackgroundChecker.
- Since
- 5.55
Definition at line 145 of file backgroundchecker.cpp.
◆ autoDetectLanguageDisabled()
bool BackgroundChecker::autoDetectLanguageDisabled | ( | ) | const |
Returns whether the automatic language detection is disabled, overriding the Sonnet settings.
- Returns
- true if the automatic language detection is disabled
- Since
- 5.71
Definition at line 115 of file backgroundchecker.cpp.
◆ changeLanguage
Definition at line 155 of file backgroundchecker.cpp.
◆ checkWord()
Definition at line 135 of file backgroundchecker.cpp.
◆ continueChecking
|
virtualslot |
After emitting misspelling signal the background checker stops.
The catcher is responsible for calling continueChecking function to resume checking.
Definition at line 161 of file backgroundchecker.cpp.
◆ currentContext()
QString BackgroundChecker::currentContext | ( | ) | const |
Definition at line 184 of file backgroundchecker.cpp.
◆ done
|
signal |
Emitted after the whole text has been spell checked.
◆ fetchMoreText()
|
protectedvirtual |
This function is called to get the text to spell check.
It will be called continuesly until it returns QString() in which case the done() signal is emitted. Note: the start parameter in misspelling() is not a combined position but a position in the last string returned by fetchMoreText. You need to store the state in the derivatives.
Definition at line 106 of file backgroundchecker.cpp.
◆ finishedCurrentFeed()
|
protectedvirtual |
This function will be called whenever the background checker will be finished text which it got from fetchMoreText.
Definition at line 111 of file backgroundchecker.cpp.
◆ misspelling
Emitted whenever a misspelled word is found.
◆ replace
|
slot |
Definition at line 207 of file backgroundchecker.cpp.
◆ setAutoDetectLanguageDisabled()
void BackgroundChecker::setAutoDetectLanguageDisabled | ( | bool | autoDetectDisabled | ) |
Sets whether to disable the automatic language detection.
- Parameters
-
autoDetectDisabled if true, the language will not be detected automatically by the spell checker, even if the option is enabled in the Sonnet settings.
- Since
- 5.71
Definition at line 120 of file backgroundchecker.cpp.
◆ setSpeller()
Definition at line 125 of file backgroundchecker.cpp.
◆ setText()
This method is used to spell check static text.
It automatically invokes start().
Use fetchMoreText() with start() to spell check a stream.
Definition at line 86 of file backgroundchecker.cpp.
◆ slotEngineDone
|
protectedslot |
Definition at line 166 of file backgroundchecker.cpp.
◆ speller()
Speller BackgroundChecker::speller | ( | ) | const |
Definition at line 130 of file backgroundchecker.cpp.
◆ start
|
virtualslot |
Definition at line 92 of file backgroundchecker.cpp.
◆ stop
|
virtualslot |
Definition at line 101 of file backgroundchecker.cpp.
◆ suggest()
QStringList BackgroundChecker::suggest | ( | const QString & | word | ) | const |
Definition at line 150 of file backgroundchecker.cpp.
◆ text()
QString BackgroundChecker::text | ( | ) | const |
Definition at line 179 of file backgroundchecker.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:15:10 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.