]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlSpellchecker.h
prefs/tabular MVC work
[lyx.git] / src / frontends / controllers / ControlSpellchecker.h
1 // -*- C++ -*-
2 /**
3  * \file ControlSpellchecker.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Edwin Leuven
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef CONTROLSPELLCHECKER_H
13 #define CONTROLSPELLCHECKER_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "ControlDialog_impl.h"
20 #include "LString.h"
21 #include "WordLangTuple.h"
22
23 class SpellBase;
24
25 /** A controller for Spellchecker dialogs.
26  */
27 class ControlSpellchecker : public ControlDialogBD {
28 public:
29         ///
30         ControlSpellchecker(LyXView &, Dialogs &);
31
32         /// replace word with replacement
33         void replace(string const &);
34
35         /// replace all occurances of word
36         void replaceAll(string const &);
37
38         /// insert word in personal dictionary
39         void insert();
40
41         /// ignore all occurances of word
42         void ignoreAll();
43
44         /// stop checking
45         void stop();
46
47         /// check text until next misspelled/unknown word
48         void check();
49
50         /// get suggestion
51         string const getSuggestion() const;
52
53         /// get word
54         string const getWord() const;
55
56         /// returns progress value
57         int getProgress() const { return oldval_; }
58
59         /// returns exit message
60         string const getMessage()  const { return message_; }
61
62         /// returns word count
63         int getCount()  const { return count_; }
64
65 private:
66         /// set the params before show or update
67         void setParams();
68         /// clean-up on hide.
69         void clearParams();
70
71         /// not needed.
72         virtual void apply() {}
73
74         /// right to left
75         bool rtl_;
76
77         /// current word being checked and lang code
78         WordLangTuple word_;
79
80         /// values for progress
81         float newval_;
82         int oldval_;
83         int newvalue_;
84
85         /// word count
86         int count_;
87
88         /// exit message
89         string message_;
90
91         /// set to true to stop checking
92         bool stop_;
93
94         /// The actual spellchecker object
95         SpellBase * speller_;
96 };
97
98 #endif // CONTROLSPELLCHECKER_H