]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlSpellchecker.h
This file is part of LyX, the document processor.
[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 getSuggestion();
52
53         /// get word
54         string getWord();
55
56         /// returns progress value
57         int getProgress() {
58                 return oldval_;
59         }
60
61         /// returns exit message
62         string getMessage() {
63                 return message_;
64         }
65
66 private:
67
68         /// set the params before show or update
69         void setParams();
70         /// clean-up on hide.
71         void clearParams();
72
73         /// not needed.
74         virtual void apply() {}
75
76         /// right to left
77         bool rtl_;
78
79         /// current word being checked and lang code
80         WordLangTuple word_;
81
82         /// values for progress
83         float newval_;
84         int oldval_;
85         int newvalue_;
86
87         /// word count
88         int count_;
89
90         /// exit message
91         string message_;
92
93         /// set to true to stop checking
94         bool stop_;
95
96         /// The actual spellchecker object
97         SpellBase * speller_;
98 };
99
100 #endif // CONTROLSPELLCHECKER_H