#include <backgroundchecker.h>
Inherits TQObject.
Public Slots | |
virtual void | setFilter (KSpell2::Filter *filter) |
virtual void | start () |
virtual void | stop () |
virtual void | continueChecking () |
Signals | |
void | misspelling (const TQString &word, int start) |
void | done () |
Public Member Functions | |
BackgroundChecker (const Broker::Ptr &broker, TQObject *parent=0, const char *name=0) | |
void | checkText (const TQString &) |
Filter * | filter () const |
Broker * | broker () const |
void | changeLanguage (const TQString &lang) |
bool | checkWord (const TQString &word) |
TQStringList | suggest (const TQString &) const |
bool | addWord (const TQString &word) |
Protected Slots | |
void | slotEngineDone () |
Protected Member Functions | |
virtual TQString | getMoreText () |
virtual void | finishedCurrentFeed () |
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 mispelled 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 49 of file backgroundchecker.h.
Member Function Documentation
◆ checkText()
void BackgroundChecker::checkText | ( | const TQString & | text | ) |
This method is used to spell check static text.
It automatically invokes start().
Use getMoreText() with start() to spell check a stream.
Definition at line 60 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 134 of file backgroundchecker.cpp.
◆ done
|
signal |
Emitted after the whole text has been spell checked.
◆ finishedCurrentFeed()
|
protectedvirtual |
This function will be called whenever the background checker will be finished text which it got from getMoreText.
Definition at line 89 of file backgroundchecker.cpp.
◆ getMoreText()
|
protectedvirtual |
This function is called to get the text to spell check.
It will be called continuesly until it returns TQString::null in which case the done() singnal is emitted. Note: the start parameter in mispelling() is not a combined position but a position in the last string returned by getMoreText. You need to store the state in the derivatives.
Definition at line 84 of file backgroundchecker.cpp.
◆ misspelling
|
signal |
Emitted whenever a misspelled word is found.
The documentation for this class was generated from the following files: