3 * \file ControlSpellchecker.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef CONTROLSPELLCHECKER_H
13 #define CONTROLSPELLCHECKER_H
16 #include "WordLangTuple.h"
17 #include <boost/scoped_ptr.hpp>
24 /** A controller for Spellchecker dialogs.
26 class ControlSpellchecker : public Dialog::Controller {
29 SPELL_PROGRESSED, //< update progress bar
30 SPELL_FOUND_WORD //< found a bad word
33 ControlSpellchecker(Dialog &);
34 ~ControlSpellchecker();
36 virtual bool initialiseParams(std::string const & data);
38 virtual void clearParams();
40 virtual void dispatchParams() {}
42 virtual bool isBufferDependent() const { return true; }
44 /// replace word with replacement
45 void replace(std::string const &);
47 /// replace all occurances of word
48 void replaceAll(std::string const &);
50 /// insert word in personal dictionary
53 /// ignore all occurances of word
56 /// check text until next misspelled/unknown word
57 /// returns true when finished
61 std::string const getSuggestion() const;
64 std::string const getWord() const;
66 /// returns progress value
67 int getProgress() const { return oldval_; }
69 /// returns word count
70 int getCount() const { return count_; }
73 /// give error message is spellchecker dies
76 /// show count of checked words at normal exit
79 /// current word being checked and lang code
82 /// values for progress
89 /// The actual spellchecker object
90 boost::scoped_ptr<SpellBase> speller_;
93 } // namespace frontend
96 #endif // CONTROLSPELLCHECKER_H