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>
22 /** A controller for Spellchecker dialogs.
24 class ControlSpellchecker : public Dialog::Controller {
27 SPELL_PROGRESSED, //< update progress bar
28 SPELL_FOUND_WORD //< found a bad word
31 ControlSpellchecker(Dialog &);
32 ~ControlSpellchecker();
34 virtual bool initialiseParams(std::string const & data);
36 virtual void clearParams();
38 virtual void dispatchParams() {}
40 virtual bool isBufferDependent() const { return true; }
42 /// replace word with replacement
43 void replace(std::string const &);
45 /// replace all occurances of word
46 void replaceAll(std::string const &);
48 /// insert word in personal dictionary
51 /// ignore all occurances of word
54 /// check text until next misspelled/unknown word
55 /// returns true when finished
59 std::string const getSuggestion() const;
62 std::string const getWord() const;
64 /// returns progress value
65 int getProgress() const { return oldval_; }
67 /// returns word count
68 int getCount() const { return count_; }
71 /// give error message is spellchecker dies
74 /// show count of checked words at normal exit
77 /// current word being checked and lang code
80 /// values for progress
87 /// The actual spellchecker object
88 boost::scoped_ptr<SpellBase> speller_;
91 #endif // CONTROLSPELLCHECKER_H