|
QtSpell 1.0.2
Spell checking for Qt text widgets
|
An abstract class providing spell checking support. More...
#include <QtSpell.hpp>
Inherited by QtSpell::TextEditChecker.
Public Slots | |
| void | setSpellingEnabled (bool enabled) |
| Set whether spell checking should be performed. | |
Signals | |
| void | languageChanged (const QString &newLang) |
| This signal is emitted when the user selects a new language from the spellchecker UI. | |
Public Member Functions | |
| Checker (QObject *parent=0) | |
| QtSpell::Checker object constructor. | |
| virtual | ~Checker () |
| QtSpell::Checker object destructor. | |
| virtual void | checkSpelling (int start=0, int end=-1)=0 |
| Check the spelling. | |
| bool | setLanguage (const QString &lang) |
| Set the spell checking language. | |
| QString | getLanguage () const |
| Retreive the current spelling language. | |
| void | setDecodeLanguageCodes (bool decode) |
| Set whether to decode language codes in the UI. | |
| bool | getDecodeLanguageCodes () const |
| Return whether langauge codes are decoded in the UI. | |
| void | setShowCheckSpellingCheckbox (bool show) |
| Set whether to display an "Check spelling" checkbox in the UI. | |
| bool | getShowCheckSpellingCheckbox () const |
| Return whether a "Check spelling" checkbox is displayed in the UI. | |
| bool | getSpellingEnabled () const |
| Return whether spellchecking is performed. | |
| void | addWordToDictionary (const QString &word) |
| Add the specified word to the user dictionary. | |
| bool | checkWord (const QString &word) const |
| Check the specified word. | |
| void | ignoreWord (const QString &word) const |
| Ignore a word for the current session. | |
| QList< QString > | getSpellingSuggestions (const QString &word) const |
| Retreive a list of spelling suggestions for the misspelled word. | |
Static Public Member Functions | |
| static QList< QString > | getLanguageList () |
| Requests the list of languages available for spell checking. | |
| static QString | decodeLanguageCode (const QString &lang) |
| Translates a language code to a human readable format (i.e. "en_US" -> "English (United States)"). | |
Private Member Functions | |
| virtual QString | getWord (int pos, int *start=0, int *end=0) const =0 |
| Get the word at the specified cursor position. | |
| virtual void | insertWord (int start, int end, const QString &word)=0 |
| Replaces the specified range with the specified word. | |
| virtual bool | isAttached () const =0 |
| Returns whether a widget is attached to the checker. | |
An abstract class providing spell checking support.
Definition at line 49 of file QtSpell.hpp.
| void QtSpell::Checker::addWordToDictionary | ( | const QString & | word | ) |
Add the specified word to the user dictionary.
| word | The word to add to the dictionary |
Definition at line 196 of file Checker.cpp.
References Checker().
Referenced by checkSpelling().
|
pure virtual |
Check the spelling.
| start | The start position within the buffer. |
| end | The end position within the buffer (-1 for the buffer end). |
Implemented in QtSpell::TextEditChecker.
References addWordToDictionary(), checkWord(), decodeLanguageCode(), getDecodeLanguageCodes(), getLanguage(), getLanguageList(), getShowCheckSpellingCheckbox(), getSpellingEnabled(), getSpellingSuggestions(), ignoreWord(), setDecodeLanguageCodes(), setLanguage(), setShowCheckSpellingCheckbox(), and setSpellingEnabled().
Referenced by setLanguage(), and setSpellingEnabled().
| bool QtSpell::Checker::checkWord | ( | const QString & | word | ) | const |
Check the specified word.
| word | A word. |
Definition at line 204 of file Checker.cpp.
References Checker().
Referenced by checkSpelling(), and QtSpell::TextEditChecker::checkSpelling().
|
static |
Translates a language code to a human readable format (i.e. "en_US" -> "English (United States)").
| lang | The language locale specifier. |
Definition at line 250 of file Checker.cpp.
References QtSpell::Codetable::instance(), and QtSpell::Codetable::lookup().
Referenced by checkSpelling().
| bool QtSpell::Checker::getDecodeLanguageCodes | ( | ) | const |
Return whether langauge codes are decoded in the UI.
Definition at line 172 of file Checker.cpp.
References Checker().
Referenced by checkSpelling().
| QString QtSpell::Checker::getLanguage | ( | ) | const |
Retreive the current spelling language.
Definition at line 132 of file Checker.cpp.
References Checker().
Referenced by checkSpelling().
|
static |
Requests the list of languages available for spell checking.
Definition at line 241 of file Checker.cpp.
Referenced by checkSpelling().
| bool QtSpell::Checker::getShowCheckSpellingCheckbox | ( | ) | const |
Return whether a "Check spelling" checkbox is displayed in the UI.
Definition at line 184 of file Checker.cpp.
References Checker().
Referenced by checkSpelling().
| bool QtSpell::Checker::getSpellingEnabled | ( | ) | const |
Return whether spellchecking is performed.
Definition at line 190 of file Checker.cpp.
References Checker().
Referenced by checkSpelling().
| QList< QString > QtSpell::Checker::getSpellingSuggestions | ( | const QString & | word | ) | const |
Retreive a list of spelling suggestions for the misspelled word.
| word | The misspelled word. |
Definition at line 227 of file Checker.cpp.
References Checker().
Referenced by checkSpelling().
|
privatepure virtual |
Get the word at the specified cursor position.
| pos | The cursor position. |
| start | If not 0, will contain the start position of the word. |
| end | If not 0, will contain the end position of the word. |
Implemented in QtSpell::TextEditChecker.
| void QtSpell::Checker::ignoreWord | ( | const QString & | word | ) | const |
Ignore a word for the current session.
| word | The word to ignore. |
Definition at line 221 of file Checker.cpp.
References Checker().
Referenced by checkSpelling().
|
privatepure virtual |
Replaces the specified range with the specified word.
| start | The start position. |
| end | The end position. |
| word | The word to insert. |
Implemented in QtSpell::TextEditChecker.
|
privatepure virtual |
Returns whether a widget is attached to the checker.
Implemented in QtSpell::TextEditChecker.
References Checker().
Referenced by setLanguage().
|
signal |
This signal is emitted when the user selects a new language from the spellchecker UI.
| newLang | The new language, as a locale specifier. |
| void QtSpell::Checker::setDecodeLanguageCodes | ( | bool | decode | ) |
Set whether to decode language codes in the UI.
| decode | Whether to decode the language codes. |
Definition at line 166 of file Checker.cpp.
References Checker().
Referenced by checkSpelling().
| bool QtSpell::Checker::setLanguage | ( | const QString & | lang | ) |
Set the spell checking language.
| lang | The language, as a locale specifier (i.e. "en_US"), or an empty string to attempt to use the system locale. |
Definition at line 122 of file Checker.cpp.
References Checker(), checkSpelling(), and isAttached().
Referenced by checkSpelling().
| void QtSpell::Checker::setShowCheckSpellingCheckbox | ( | bool | show | ) |
Set whether to display an "Check spelling" checkbox in the UI.
| show | Whether to display an "Check spelling" checkbox in the UI. |
Definition at line 178 of file Checker.cpp.
References Checker().
Referenced by checkSpelling().
|
slot |
Set whether spell checking should be performed.
| enabled | True if spell checking should be performed. |
Definition at line 265 of file Checker.cpp.
References Checker(), and checkSpelling().
Referenced by checkSpelling().