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