22#include "QtSpellExport.hpp"
37class TextEditCheckerPrivate;
126 bool checkWord(
const QString& word)
const;
174 void showContextMenu(QMenu* menu,
const QPoint& pos,
int wordPos);
178 void slotIgnoreWord();
179 void slotReplaceWord();
180 void slotSetLanguage(
bool checked);
190 virtual QString
getWord(
int pos,
int* start = 0,
int* end = 0)
const = 0;
198 virtual void insertWord(
int start,
int end,
const QString& word) = 0;
207 Checker(CheckerPrivate& dd, QObject* parent = 0);
208 CheckerPrivate* d_ptr;
320 QString
getWord(
int pos,
int* start = 0,
int* end = 0)
const;
321 void insertWord(
int start,
int end,
const QString& word);
323 bool eventFilter(QObject *obj, QEvent *event);
326 void slotShowContextMenu(
const QPoint& pos);
327 void slotCheckDocumentChanged();
328 void slotDetachTextEdit();
329 void slotCheckRange(
int pos,
int removed,
int added);
void setShowCheckSpellingCheckbox(bool show)
Set whether to display an "Check spelling" checkbox in the UI.
Checker(QObject *parent=0)
QtSpell::Checker object constructor.
bool setLanguage(const QString &lang)
Set the spell checking language.
virtual bool isAttached() const =0
Returns whether a widget is attached to the checker.
void setDecodeLanguageCodes(bool decode)
Set whether to decode language codes in the UI.
QList< QString > getSpellingSuggestions(const QString &word) const
Retreive a list of spelling suggestions for the misspelled word.
static QList< QString > getLanguageList()
Requests the list of languages available for spell checking.
bool getShowCheckSpellingCheckbox() const
Return whether a "Check spelling" checkbox is displayed in the UI.
bool getSpellingEnabled() const
Return whether spellchecking is performed.
bool getDecodeLanguageCodes() const
Return whether langauge codes are decoded in the UI.
void setSpellingEnabled(bool enabled)
Set whether spell checking should be performed.
bool checkWord(const QString &word) const
Check the specified word.
void languageChanged(const QString &newLang)
This signal is emitted when the user selects a new language from the spellchecker UI.
virtual void checkSpelling(int start=0, int end=-1)=0
Check the spelling.
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.
static QString decodeLanguageCode(const QString &lang)
Translates a language code to a human readable format (i.e. "en_US" -> "English (United States)").
QString getLanguage() const
Retreive the current spelling language.
void addWordToDictionary(const QString &word)
Add the specified word to the user dictionary.
void ignoreWord(const QString &word) const
Ignore a word for the current session.
TextEditChecker(QObject *parent=0)
TextEditChecker object constructor.
void setUndoRedoEnabled(bool enabled)
Sets whether undo/redo functionality is enabled.
void clearUndoRedo()
Clears the undo/redo stack.
void setTextEdit(QTextEdit *textEdit)
Set the QTextEdit to check.
void checkSpelling(int start=0, int end=-1)
Check the spelling.
void setNoSpellingPropertyId(int propertyId)
Set the QTextCharFormat property identifier which marks whether a word ought to be spell-checked.
bool isAttached() const
Returns whether a widget is attached to the checker.
void redo()
Redo the last edit operation.
void redoAvailable(bool available)
Emitted when the redo stak changes.
void undo()
Undo the last edit operation.
void undoAvailable(bool available)
Emitted when the undo stack changes.
int noSpellingPropertyId() const
Returns the current QTextCharFormat property identifier which marks whether a word ought to be spell-...
void insertWord(int start, int end, const QString &word)
Replaces the specified range with the specified word.
QString getWord(int pos, int *start=0, int *end=0) const
Get the word at the specified cursor position.
bool checkLanguageInstalled(const QString &lang)
Check whether the dictionary for a language is installed.