22 #if defined(QTSPELL_LIBRARY)
23 # define QTSPELL_API Q_DECL_EXPORT
25 # define QTSPELL_API Q_DECL_IMPORT
38 namespace enchant {
class Dict; }
45 class QTSPELL_API
Checker :
public QObject
64 virtual void checkSpelling(
int start = 0,
int end = -1) = 0;
72 bool setLanguage(
const QString& lang);
115 void addWordToDictionary(
const QString& word);
122 bool checkWord(
const QString& word)
const;
128 void ignoreWord(
const QString& word)
const;
135 QList<QString> getSpellingSuggestions(
const QString& word)
const;
142 static QList<QString> getLanguageList();
152 static QString decodeLanguageCode(
const QString& lang);
167 void languageChanged(
const QString& newLang);
170 void showContextMenu(QMenu* menu,
const QPoint& pos,
int wordPos);
174 void slotIgnoreWord();
175 void slotReplaceWord();
176 void slotSetLanguage(
bool checked);
179 enchant::Dict* m_speller;
182 bool m_spellingCheckbox;
183 bool m_spellingEnabled;
192 virtual QString getWord(
int pos,
int* start = 0,
int* end = 0)
const = 0;
200 virtual void insertWord(
int start,
int end,
const QString& word) = 0;
206 virtual bool isAttached()
const = 0;
207 bool setLanguageInternal(
const QString& lang);
237 void setTextEdit(QTextEdit* textEdit);
243 void setTextEdit(QPlainTextEdit* textEdit);
245 void checkSpelling(
int start = 0,
int end = -1);
253 void clearUndoRedo();
262 void setUndoRedoEnabled(
bool enabled);
289 void undoAvailable(
bool available);
298 void redoAvailable(
bool available);
301 TextEditProxy* m_textEdit;
302 QTextDocument* m_document;
303 UndoRedoStack* m_undoRedoStack;
304 bool m_undoRedoInProgress;
305 Qt::ContextMenuPolicy m_oldContextMenuPolicy;
307 QString getWord(
int pos,
int* start = 0,
int* end = 0)
const;
308 void insertWord(
int start,
int end,
const QString& word);
310 void setTextEdit(TextEditProxy* textEdit);
311 bool eventFilter(QObject *obj, QEvent *event);
314 void slotShowContextMenu(
const QPoint& pos);
315 void slotCheckDocumentChanged();
316 void slotDetachTextEdit();
317 void slotCheckRange(
int pos,
int removed,
int added);
322 #endif // QTSPELL_HPP
bool getSpellingEnabled() const
Return whether spellchecking is performed.
bool isAttached() const
Returns whether a widget is attached to the checker.
const QString & getLanguage() const
Retreive the current spelling language.
bool getDecodeLanguageCodes() const
Return whether langauge codes are decoded in the UI.
void setDecodeLanguageCodes(bool decode)
Set whether to decode language codes in the UI.
Checker class for QTextEdit widgets.
void setShowCheckSpellingCheckbox(bool show)
Set whether to display an "Check spelling" checkbox in the UI.
bool getShowCheckSpellingCheckbox() const
Return whether a "Check spelling" checkbox is displayed in the UI.
void setSpellingEnabled(bool enabled)
Set whether spell checking should be performed.
An abstract class providing spell checking support.