An abstract class providing spell checking support.
More...
#include <QtSpell.hpp>
Inherits QObject.
Inherited by QtSpell::TextEditChecker.
|
void | languageChanged (const QString &newLang) |
| This signal is emitted when the user selects a new language from the spellchecker UI. More...
|
|
|
static QList< QString > | getLanguageList () |
| Requests the list of languages available for spell checking. More...
|
|
static QString | decodeLanguageCode (const QString &lang) |
| Translates a language code to a human readable format (i.e. "en_US" -> "English (United States)"). More...
|
|
|
virtual QString | getWord (int pos, int *start=0, int *end=0) const =0 |
| Get the word at the specified cursor position. More...
|
|
virtual void | insertWord (int start, int end, const QString &word)=0 |
| Replaces the specified range with the specified word. More...
|
|
virtual bool | isAttached () const =0 |
| Returns whether a widget is attached to the checker. More...
|
|
An abstract class providing spell checking support.
Definition at line 57 of file QtSpell.hpp.
◆ addWordToDictionary()
void QtSpell::Checker::addWordToDictionary |
( |
const QString & |
word | ) |
|
Add the specified word to the user dictionary.
- Parameters
-
word | The word to add to the dictionary |
Definition at line 125 of file Checker.cpp.
◆ checkSpelling()
virtual void QtSpell::Checker::checkSpelling |
( |
int |
start = 0 , |
|
|
int |
end = -1 |
|
) |
| |
|
pure virtual |
Check the spelling.
- Parameters
-
start | The start position within the buffer. |
end | The end position within the buffer (-1 for the buffer end). |
Implemented in QtSpell::TextEditChecker.
Referenced by setLanguage().
◆ checkWord()
bool QtSpell::Checker::checkWord |
( |
const QString & |
word | ) |
const |
◆ decodeLanguageCode()
QString QtSpell::Checker::decodeLanguageCode |
( |
const QString & |
lang | ) |
|
|
static |
Translates a language code to a human readable format (i.e. "en_US" -> "English (United States)").
- Parameters
-
lang | The language locale specifier. |
- Note
- If the iso-codes package is unavailable, the unchanged code is returned.
- Returns
- The human readable language description.
Definition at line 175 of file Checker.cpp.
References QtSpell::Codetable::instance(), and QtSpell::Codetable::lookup().
◆ getDecodeLanguageCodes()
bool QtSpell::Checker::getDecodeLanguageCodes |
( |
| ) |
const |
|
inline |
Return whether langauge codes are decoded in the UI.
- Returns
- Whether langauge codes are decoded in the UI.
Definition at line 103 of file QtSpell.hpp.
◆ getLanguage()
const QString& QtSpell::Checker::getLanguage |
( |
| ) |
const |
|
inline |
Retreive the current spelling language.
- Returns
- The current spelling language.
Definition at line 90 of file QtSpell.hpp.
◆ getLanguageList()
QList< QString > QtSpell::Checker::getLanguageList |
( |
| ) |
|
|
static |
Requests the list of languages available for spell checking.
- Returns
- A list of languages available for spell checking.
Definition at line 166 of file Checker.cpp.
◆ getShowCheckSpellingCheckbox()
bool QtSpell::Checker::getShowCheckSpellingCheckbox |
( |
| ) |
const |
|
inline |
Return whether a "Check spelling" checkbox is displayed in the UI.
- Returns
- Whether a "Check spelling" checkbox is displayed in the UI.
Definition at line 115 of file QtSpell.hpp.
◆ getSpellingEnabled()
bool QtSpell::Checker::getSpellingEnabled |
( |
| ) |
const |
|
inline |
Return whether spellchecking is performed.
- Returns
- Whether spellchecking is performed.
Definition at line 121 of file QtSpell.hpp.
◆ getSpellingSuggestions()
QList< QString > QtSpell::Checker::getSpellingSuggestions |
( |
const QString & |
word | ) |
const |
Retreive a list of spelling suggestions for the misspelled word.
- Parameters
-
- Returns
- A list of spelling suggestions.
Definition at line 153 of file Checker.cpp.
◆ getWord()
virtual QString QtSpell::Checker::getWord |
( |
int |
pos, |
|
|
int * |
start = 0 , |
|
|
int * |
end = 0 |
|
) |
| const |
|
privatepure virtual |
Get the word at the specified cursor position.
- Parameters
-
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. |
- Returns
- The word.
Implemented in QtSpell::TextEditChecker.
◆ ignoreWord()
void QtSpell::Checker::ignoreWord |
( |
const QString & |
word | ) |
const |
Ignore a word for the current session.
- Parameters
-
Definition at line 148 of file Checker.cpp.
◆ insertWord()
virtual void QtSpell::Checker::insertWord |
( |
int |
start, |
|
|
int |
end, |
|
|
const QString & |
word |
|
) |
| |
|
privatepure virtual |
Replaces the specified range with the specified word.
- Parameters
-
start | The start position. |
end | The end position. |
word | The word to insert. |
Implemented in QtSpell::TextEditChecker.
◆ isAttached()
virtual bool QtSpell::Checker::isAttached |
( |
| ) |
const |
|
privatepure virtual |
◆ languageChanged
void QtSpell::Checker::languageChanged |
( |
const QString & |
newLang | ) |
|
|
signal |
This signal is emitted when the user selects a new language from the spellchecker UI.
- Parameters
-
newLang | The new language, as a locale specifier. |
◆ setDecodeLanguageCodes()
void QtSpell::Checker::setDecodeLanguageCodes |
( |
bool |
decode | ) |
|
|
inline |
Set whether to decode language codes in the UI.
- Note
- Requres the iso-codes package.
- Parameters
-
decode | Whether to decode the language codes. |
Definition at line 97 of file QtSpell.hpp.
◆ setLanguage()
bool QtSpell::Checker::setLanguage |
( |
const QString & |
lang | ) |
|
Set the spell checking language.
- Parameters
-
lang | The language, as a locale specifier (i.e. "en_US"), or an empty string to attempt to use the system locale. |
- Returns
- true on success, false on failure.
Definition at line 88 of file Checker.cpp.
References checkSpelling(), and isAttached().
◆ setShowCheckSpellingCheckbox()
void QtSpell::Checker::setShowCheckSpellingCheckbox |
( |
bool |
show | ) |
|
|
inline |
Set whether to display an "Check spelling" checkbox in the UI.
- Parameters
-
show | Whether to display an "Check spelling" checkbox in the UI. |
Definition at line 109 of file QtSpell.hpp.
◆ setSpellingEnabled
void QtSpell::Checker::setSpellingEnabled |
( |
bool |
enabled | ) |
|
|
inlineslot |
Set whether spell checking should be performed.
- Parameters
-
enabled | True if spell checking should be performed. |
Definition at line 171 of file QtSpell.hpp.
The documentation for this class was generated from the following files: