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