• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

Sonnet::BackgroundChecker

Sonnet::BackgroundChecker Class Reference

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

#include <backgroundchecker.h>

Inheritance diagram for Sonnet::BackgroundChecker:

Inheritance graph
[legend]

List of all members.


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 ()

Signals

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

Public Member Functions

bool addWordToPersonal (const QString &word)
 BackgroundChecker (const Speller &speller, QObject *parent=0)
 BackgroundChecker (QObject *parent=0)
bool checkWord (const QString &word)
QString currentContext () const
void setSpeller (const Speller &speller)
void setText (const QString &text)
Speller speller () const
QStringList suggest (const QString &word) const
QString text () const
 ~BackgroundChecker ()

Protected Slots

void slotEngineDone ()

Protected Member Functions

virtual QString fetchMoreText ()
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 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.

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

Definition at line 51 of file backgroundchecker.h.


Constructor & Destructor Documentation

BackgroundChecker::BackgroundChecker ( QObject *  parent = 0  )  [explicit]

Definition at line 39 of file backgroundchecker.cpp.

BackgroundChecker::BackgroundChecker ( const Speller &  speller,
QObject *  parent = 0 
) [explicit]

Definition at line 50 of file backgroundchecker.cpp.

BackgroundChecker::~BackgroundChecker (  ) 

Definition at line 62 of file backgroundchecker.cpp.


Member Function Documentation

bool BackgroundChecker::addWordToPersonal ( const QString &  word  ) 

Definition at line 112 of file backgroundchecker.cpp.

void BackgroundChecker::changeLanguage ( const QString &  lang  )  [slot]

Definition at line 122 of file backgroundchecker.cpp.

bool BackgroundChecker::checkWord ( const QString &  word  ) 

Definition at line 107 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 127 of file backgroundchecker.cpp.

QString BackgroundChecker::currentContext (  )  const

Definition at line 151 of file backgroundchecker.cpp.

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

Emitted after the whole text has been spell checked.

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

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 mispelling() 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 88 of file backgroundchecker.cpp.

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

This function will be called whenever the background checker will be finished text which it got from fetchMoreText.

Definition at line 93 of file backgroundchecker.cpp.

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

Emitted whenever a misspelled word is found.

void Sonnet::BackgroundChecker::replace ( int  start,
const QString &  oldText,
const QString &  newText 
) [slot]

Definition at line 156 of file backgroundchecker.cpp.

void BackgroundChecker::setSpeller ( const Speller &  speller  ) 

Definition at line 97 of file backgroundchecker.cpp.

void BackgroundChecker::setText ( const QString &  text  ) 

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 67 of file backgroundchecker.cpp.

void BackgroundChecker::slotEngineDone (  )  [protected, slot]

Definition at line 132 of file backgroundchecker.cpp.

Speller BackgroundChecker::speller (  )  const

Definition at line 102 of file backgroundchecker.cpp.

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

Definition at line 74 of file backgroundchecker.cpp.

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

Definition at line 83 of file backgroundchecker.cpp.

QStringList BackgroundChecker::suggest ( const QString &  word  )  const

Definition at line 117 of file backgroundchecker.cpp.

QString BackgroundChecker::text (  )  const

Definition at line 145 of file backgroundchecker.cpp.


The documentation for this class was generated from the following files:
  • backgroundchecker.h
  • backgroundchecker.cpp

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal