22 #if defined(QTSPELL_LIBRARY)
23 # define QTSPELL_API Q_DECL_EXPORT
25 # define QTSPELL_API Q_DECL_IMPORT
39 namespace enchant {
class Dict; }
57 class QTSPELL_API
Checker :
public QObject
76 virtual void checkSpelling(
int start = 0,
int end = -1) = 0;
84 bool setLanguage(
const QString& lang);
127 void addWordToDictionary(
const QString& word);
134 bool checkWord(
const QString& word)
const;
140 void ignoreWord(
const QString& word)
const;
147 QList<QString> getSpellingSuggestions(
const QString& word)
const;
154 static QList<QString> getLanguageList();
164 static QString decodeLanguageCode(
const QString& lang);
179 void languageChanged(
const QString& newLang);
182 void showContextMenu(QMenu* menu,
const QPoint& pos,
int wordPos);
186 void slotIgnoreWord();
187 void slotReplaceWord();
188 void slotSetLanguage(
bool checked);
191 enchant::Dict* m_speller =
nullptr;
193 bool m_decodeCodes =
false;
194 bool m_spellingCheckbox =
false;
195 bool m_spellingEnabled =
true;
204 virtual QString getWord(
int pos,
int* start = 0,
int* end = 0)
const = 0;
212 virtual void insertWord(
int start,
int end,
const QString& word) = 0;
218 virtual bool isAttached()
const = 0;
219 bool setLanguageInternal(
const QString& lang);
249 void setTextEdit(QTextEdit* textEdit);
255 void setTextEdit(QPlainTextEdit* textEdit);
275 void checkSpelling(
int start = 0,
int end = -1);
284 void setUndoRedoEnabled(
bool enabled);
309 void clearUndoRedo();
319 void undoAvailable(
bool available);
328 void redoAvailable(
bool available);
331 TextEditProxy* m_textEdit =
nullptr;
332 QTextDocument* m_document =
nullptr;
333 UndoRedoStack* m_undoRedoStack =
nullptr;
334 bool m_undoRedoInProgress =
false;
335 Qt::ContextMenuPolicy m_oldContextMenuPolicy;
336 int m_noSpellingProperty = -1;
338 QString getWord(
int pos,
int* start = 0,
int* end = 0)
const;
339 void insertWord(
int start,
int end,
const QString& word);
341 void setTextEdit(TextEditProxy* textEdit);
342 bool eventFilter(QObject *obj, QEvent *event);
343 bool noSpellingPropertySet(
const QTextCursor& cursor)
const;
346 void slotShowContextMenu(
const QPoint& pos);
347 void slotCheckDocumentChanged();
348 void slotDetachTextEdit();
349 void slotCheckRange(
int pos,
int removed,
int added);
354 #endif // QTSPELL_HPP