KSpell2::BackgroundChecker Class Reference

BackgroundChecker is used to perform spell checking without blocking the application. More...

#include <backgroundchecker.h>

Inheritance diagram for KSpell2::BackgroundChecker:

QObject

List of all members.


Public Slots

virtual void setFilter (KSpell2::Filter *filter)
virtual void start ()
virtual void stop ()
virtual void continueChecking ()

Signals

void misspelling (const QString &word, int start)
void done ()

Public Member Functions

 BackgroundChecker (const Broker::Ptr &broker, QObject *parent=0, const char *name=0)
void checkText (const QString &)
Filterfilter () const
Brokerbroker () const
void changeLanguage (const QString &lang)
bool checkWord (const QString &word)
QStringList suggest (const QString &) const
bool addWord (const QString &word)

Protected Slots

void slotEngineDone ()

Protected Member Functions

virtual QString 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.

Author:
Zack Rusin <zack@kde.org> class used for spell checking in the background

Definition at line 49 of file backgroundchecker.h.


Member Function Documentation

void BackgroundChecker::checkText ( const QString 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.

void BackgroundChecker::continueChecking (  )  [virtual, slot]

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.

void KSpell2::BackgroundChecker::done (  )  [signal]

Emitted after the whole text has been spell checked.

void BackgroundChecker::finishedCurrentFeed (  )  [protected, virtual]

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.

QString BackgroundChecker::getMoreText (  )  [protected, virtual]

This function is called to get the text to spell check.

It will be called continuesly until it returns QString::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.

void KSpell2::BackgroundChecker::misspelling ( const QString word,
int  start 
) [signal]

Emitted whenever a misspelled word is found.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys