22 #include "QtSpellExport.hpp" 37 class TextEditCheckerPrivate;
49 class QTSPELL_API
Checker :
public QObject
68 virtual void checkSpelling(
int start = 0,
int end = -1) = 0;
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);
171 void languageChanged(
const QString& newLang);
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;
204 virtual bool isAttached()
const = 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();
308 void undoAvailable(
bool available);
317 void redoAvailable(
bool available);
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);
337 #endif // QTSPELL_HPP bool checkLanguageInstalled(const QString &lang)
Check whether the dictionary for a language is installed.
Checker class for QTextEdit widgets.
An abstract class providing spell checking support.