# class BackgroundChecker

###

Module | kdecore
Namespace | Sonnet
Class | BackgroundChecker
Inherits | QObject

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

### methods

- BackgroundChecker (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QObject | 0

- BackgroundChecker (speller, parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  speller | Sonnet.Speller |
  parent | QObject | 0

- BackgroundChecker (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QObject | 0

- BackgroundChecker (a0, a1)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | Sonnet.Speller |
  a1 | QObject | 0

- addWordToPersonal (word)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  word | QString |

- changeLanguage (lang)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  lang | QString |

- checkWord (word)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  word | QString |

- continueChecking ( )

  returns Nothing

  After emitting misspelling signal the background checker stops. The catcher is responsible for calling continueChecking function to resume checking.

- currentContext ( )

  returns QString

- done ( )

  returns Nothing
  SIGNAL ("done ()")

  Emitted after the whole text has been spell checked.

- fetchMoreText ( )

  returns QString

  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.

- finishedCurrentFeed ( )

  returns Nothing

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

- misspelling (word, start)

  returns Nothing
  SIGNAL ("misspelling (const QString&, int)")

  Argument | Type | Default
  --- | --- | ---
  word | QString |
  start | int |

  Emitted whenever a misspelled word is found

- replace (start, oldText, newText)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  start | int |
  oldText | QString |
  newText | QString |

- setSpeller (speller)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  speller | Sonnet.Speller |

- setText (text)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |

  This method is used to spell check static text. It automatically invokes start().

  Use fetchMoreText() with start() to spell check a stream.

- slotEngineDone ( )

  returns Nothing

- speller ( )

  returns Sonnet.Speller

- start ( )

  returns Nothing

- stop ( )

  returns Nothing

- suggest (word)

  returns QStringList

  Argument | Type | Default
  --- | --- | ---
  word | QString |

- text ( )

  returns QString