3 * \file GuiSpellchecker.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Kalle Dalheimer
11 * Full author contact details are available in file CREDITS.
14 #ifndef GUISPELLCHECKER_H
15 #define GUISPELLCHECKER_H
17 #include "GuiDialog.h"
18 #include "ui_SpellcheckerUi.h"
20 #include "WordLangTuple.h"
22 class QListWidgetItem;
30 class GuiSpellchecker : public GuiDialog, public Ui::SpellcheckerUi
35 GuiSpellchecker(LyXView & lv);
39 void suggestionChanged(QListWidgetItem *);
46 void replaceChanged(const QString &);
51 void closeEvent(QCloseEvent * e);
52 /// update from controller
53 void partialUpdate(int id);
55 void updateContents();
59 SPELL_PROGRESSED, //< update progress bar
60 SPELL_FOUND_WORD //< found a bad word
64 bool initialiseParams(std::string const & data);
68 void dispatchParams() {}
70 bool isBufferDependent() const { return true; }
72 bool exitEarly() const { return exitEarly_; }
74 /// replace word with replacement
75 void replace(docstring const &);
77 /// replace all occurances of word
78 void replaceAll(docstring const &);
79 /// insert word in personal dictionary
81 /// ignore all occurances of word
83 /// check text until next misspelled/unknown word
84 /// returns true when finished
87 docstring getSuggestion() const;
89 docstring getWord() const;
90 /// returns progress value
91 int getProgress() const { return oldval_; }
92 /// returns word count
93 int getCount() const { return count_; }
94 /// give error message is spellchecker dies
96 /// show count of checked words at normal exit
99 /// set to true when spellchecking is finished
101 /// current word being checked and lang code
103 /// values for progress
108 /// The actual spellchecker object
109 SpellBase * speller_;
112 } // namespace frontend
115 #endif // GUISPELLCHECKER_H