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

KDEUI

Sonnet::Highlighter

Sonnet::Highlighter Class Reference

#include <highlighter.h>

Inheritance diagram for Sonnet::Highlighter:

Inheritance graph
[legend]

List of all members.


Detailed Description

The Sonnet Highlighter.

Definition at line 35 of file highlighter.h.


Public Slots

void slotAutoDetection ()
void slotRehighlight ()

Signals

void activeChanged (const QString &description)
QT_MOC_COMPAT void newSuggestions (const QString &originalWord, const QStringList &suggestions)

Public Member Functions

void addWordToDictionary (const QString &word)
bool automatic () const
QString currentLanguage () const
 Highlighter (QTextEdit *textEdit, const QString &configFile=QString(), const QColor &col=QColor())
void ignoreWord (const QString &word)
bool isActive () const
bool isWordMisspelled (const QString &word)
void setActive (bool active)
void setAutomatic (bool automatic)
void setCurrentLanguage (const QString &lang)
bool spellCheckerFound () const
QStringList suggestionsForWord (const QString &word, int max=10)
 ~Highlighter ()

Static Public Member Functions

static QStringList personalWords ()

Protected Member Functions

bool eventFilter (QObject *o, QEvent *e)
virtual void highlightBlock (const QString &text)
bool intraWordEditing () const
void setIntraWordEditing (bool editing)
virtual void setMisspelled (int start, int count)
virtual void unsetMisspelled (int start, int count)

Constructor & Destructor Documentation

Sonnet::Highlighter::Highlighter ( QTextEdit *  textEdit,
const QString &  configFile = QString(),
const QColor &  col = QColor() 
) [explicit]

Definition at line 73 of file highlighter.cpp.

Sonnet::Highlighter::~Highlighter (  ) 

Definition at line 124 of file highlighter.cpp.


Member Function Documentation

void Sonnet::Highlighter::activeChanged ( const QString &  description  )  [signal]

Emitted when as-you-type spell checking is enabled or disabled.

Parameters:
description is a i18n description of the new state, with an optional reason

void Sonnet::Highlighter::addWordToDictionary ( const QString &  word  ) 

Adds the given word permanently to the dictionary.

It will never be marked as misspelled again, even after restarting the application.

Parameters:
word the word which will be added to the dictionary
Since:
4.1

Definition at line 412 of file highlighter.cpp.

bool Sonnet::Highlighter::automatic (  )  const

Definition at line 186 of file highlighter.cpp.

QString Sonnet::Highlighter::currentLanguage (  )  const

Definition at line 287 of file highlighter.cpp.

bool Sonnet::Highlighter::eventFilter ( QObject *  o,
QEvent *  e 
) [protected]

Definition at line 324 of file highlighter.cpp.

void Sonnet::Highlighter::highlightBlock ( const QString &  text  )  [protected, virtual]

Reimplemented from QSyntaxHighlighter.

Definition at line 258 of file highlighter.cpp.

void Sonnet::Highlighter::ignoreWord ( const QString &  word  ) 

Ignores the given word.

This word will not be marked misspelled for this session. It will again be marked as misspelled when creating new highlighters.

Parameters:
word the word which will be ignored
Since:
4.1

Definition at line 417 of file highlighter.cpp.

bool Sonnet::Highlighter::intraWordEditing (  )  const [protected]

Definition at line 191 of file highlighter.cpp.

bool Sonnet::Highlighter::isActive (  )  const

Returns the state of spell checking.

Returns:
true if spell checking is active
See also:
setActive()

Definition at line 253 of file highlighter.cpp.

bool Sonnet::Highlighter::isWordMisspelled ( const QString &  word  ) 

Checks if a given word is marked as misspelled by the highlighter.

Parameters:
word the word to be checked
Returns:
true if the given word is misspelled.
Since:
4.1

Definition at line 432 of file highlighter.cpp.

QT_MOC_COMPAT void Sonnet::Highlighter::newSuggestions ( const QString &  originalWord,
const QStringList &  suggestions 
) [signal]

Parameters:
originalWord missspelled word

Parameters:
suggestions list of word which can replace missspelled word
Deprecated:
use isWordMisspelled() and suggestionsForWord() instead.

QStringList Sonnet::Highlighter::personalWords (  )  [static]

Definition at line 170 of file highlighter.cpp.

void Sonnet::Highlighter::setActive ( bool  active  ) 

Enable/Disable spell checking.

If active is true then spell checking is enabled; otherwise it is disabled. Note that you have to disable automatic (de)activation with setAutomatic() before you change the state of spell checking if you want to persistently enable/disable spell checking.

Parameters:
active if true, then spell checking is enabled
See also:
isActive(), setAutomatic()

Definition at line 239 of file highlighter.cpp.

void Sonnet::Highlighter::setAutomatic ( bool  automatic  ) 

Definition at line 202 of file highlighter.cpp.

void Sonnet::Highlighter::setCurrentLanguage ( const QString &  lang  ) 

Definition at line 292 of file highlighter.cpp.

void Sonnet::Highlighter::setIntraWordEditing ( bool  editing  )  [protected]

Definition at line 196 of file highlighter.cpp.

void Sonnet::Highlighter::setMisspelled ( int  start,
int  count 
) [protected, virtual]

Definition at line 314 of file highlighter.cpp.

void Sonnet::Highlighter::slotAutoDetection (  )  [slot]

Definition at line 212 of file highlighter.cpp.

void Sonnet::Highlighter::slotRehighlight (  )  [slot]

Definition at line 151 of file highlighter.cpp.

bool Sonnet::Highlighter::spellCheckerFound (  )  const

Definition at line 129 of file highlighter.cpp.

QStringList Sonnet::Highlighter::suggestionsForWord ( const QString &  word,
int  max = 10 
)

Returns a list of suggested replacements for the given misspelled word.

If the word is not misspelled, the list will be empty.

Parameters:
word the misspelled word
max at most this many suggestions will be returned. If this is -1, as many suggestions as the spell backend supports will be returned.
Returns:
a list of suggested replacements for the word
Since:
4.1

Definition at line 422 of file highlighter.cpp.

void Sonnet::Highlighter::unsetMisspelled ( int  start,
int  count 
) [protected, virtual]

Definition at line 319 of file highlighter.cpp.


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

KDEUI

Skip menu "KDEUI"
  • 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
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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