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 virtual bool exitEarly() const { return exitEarly_; }
46 /// replace word with replacement
47 void replace(std::string const &);
49 /// replace all occurances of word
50 void replaceAll(std::string const &);
52 /// insert word in personal dictionary
55 /// ignore all occurances of word
58 /// check text until next misspelled/unknown word
59 /// returns true when finished
63 std::string const getSuggestion() const;
66 std::string const getWord() const;
68 /// returns progress value
69 int getProgress() const { return oldval_; }
71 /// returns word count
72 int getCount() const { return count_; }
75 /// give error message is spellchecker dies
78 /// show count of checked words at normal exit
82 /// set to true when spellchecking is finished
85 /// current word being checked and lang code
88 /// values for progress
95 /// The actual spellchecker object
96 boost::scoped_ptr<SpellBase> speller_;
99 } // namespace frontend
102 #endif // CONTROLSPELLCHECKER_H