22 #include "QtSpellExport.hpp"
37 class TextEditCheckerPrivate;
49 class QTSPELL_API
Checker :
public QObject
76 bool setLanguage(
const QString& lang);
82 QString getLanguage()
const;
89 void setDecodeLanguageCodes(
bool decode);
95 bool getDecodeLanguageCodes()
const;
101 void setShowCheckSpellingCheckbox(
bool show);
107 bool getShowCheckSpellingCheckbox()
const;
113 bool getSpellingEnabled()
const;
119 void addWordToDictionary(
const QString& word);
126 bool checkWord(
const QString& word)
const;
132 void ignoreWord(
const QString& word)
const;
139 QList<QString> getSpellingSuggestions(
const QString& word)
const;
146 static QList<QString> getLanguageList();
156 static QString decodeLanguageCode(
const QString& lang);
163 void setSpellingEnabled(
bool enabled);
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;
238 void setTextEdit(QTextEdit* textEdit);
244 void setTextEdit(QPlainTextEdit* textEdit);
255 void setNoSpellingPropertyId(
int propertyId);
262 int noSpellingPropertyId()
const;
264 void checkSpelling(
int start = 0,
int end = -1);
273 void setUndoRedoEnabled(
bool enabled);
298 void clearUndoRedo();
320 QString getWord(
int pos,
int* start = 0,
int* end = 0)
const;
321 void insertWord(
int start,
int end,
const QString& word);
322 bool isAttached()
const;
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);
An abstract class providing spell checking support.
virtual bool isAttached() const =0
Returns whether a widget is attached to the checker.
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.
Checker class for QTextEdit widgets.
void redoAvailable(bool available)
Emitted when the redo stak changes.
void undoAvailable(bool available)
Emitted when the undo stack changes.
bool checkLanguageInstalled(const QString &lang)
Check whether the dictionary for a language is installed.