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>
25 /** A controller for Spellchecker dialogs.
27 class ControlSpellchecker : public Dialog::Controller {
30 SPELL_PROGRESSED, //< update progress bar
31 SPELL_FOUND_WORD //< found a bad word
34 ControlSpellchecker(Dialog &);
35 ~ControlSpellchecker();
37 virtual bool initialiseParams(std::string const & data);
39 virtual void clearParams();
41 virtual void dispatchParams() {}
43 virtual bool isBufferDependent() const { return true; }
45 virtual bool exitEarly() const { return exitEarly_; }
47 /// replace word with replacement
48 void replace(docstring const &);
50 /// replace all occurances of word
51 void replaceAll(docstring const &);
53 /// insert word in personal dictionary
56 /// ignore all occurances of word
59 /// check text until next misspelled/unknown word
60 /// returns true when finished
64 docstring const getSuggestion() const;
67 docstring const getWord() const;
69 /// returns progress value
70 int getProgress() const { return oldval_; }
72 /// returns word count
73 int getCount() const { return count_; }
76 /// give error message is spellchecker dies
79 /// show count of checked words at normal exit
83 /// set to true when spellchecking is finished
86 /// current word being checked and lang code
89 /// values for progress
96 /// The actual spellchecker object
97 boost::scoped_ptr<SpellBase> speller_;
100 } // namespace frontend
103 #endif // CONTROLSPELLCHECKER_H