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
15 #include <boost/scoped_ptr.hpp>
17 #include "ControlDialog_impl.h"
18 #include "WordLangTuple.h"
22 /** A controller for Spellchecker dialogs.
24 class ControlSpellchecker : public ControlDialogBD {
27 SPELL_PROGRESSED, //< update progress bar
28 SPELL_FOUND_WORD //< found a bad word
31 ControlSpellchecker(LyXView &, Dialogs &);
33 ~ControlSpellchecker();
35 /// replace word with replacement
36 void replace(std::string const &);
38 /// replace all occurances of word
39 void replaceAll(std::string const &);
41 /// insert word in personal dictionary
44 /// ignore all occurances of word
47 /// check text until next misspelled/unknown word
48 /// returns true when finished
52 std::string const getSuggestion() const;
55 std::string const getWord() const;
57 /// returns progress value
58 int getProgress() const { return oldval_; }
60 /// returns word count
61 int getCount() const { return count_; }
64 /// give error message is spellchecker dies
67 /// start a spell-checking session
70 /// end a spell-checking session
73 /// show count of checked words at normal exit
76 /// set the params before show or update
82 virtual void apply() {}
84 /// current word being checked and lang code
87 /// values for progress
94 /// The actual spellchecker object
95 boost::scoped_ptr<SpellBase> speller_;
98 #endif // CONTROLSPELLCHECKER_H