]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlSpellchecker.h
Edwin's spellchecker GUII patch with some fixes to it.
[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 "ControlDialogs.h"
23 #include "sp_base.h"
24
25 /** A controller for Spellchecker dialogs.
26  */
27 class ControlSpellchecker : public ControlDialog<ControlConnectBD> {
28 public:
29         ///
30         ControlSpellchecker(LyXView &, Dialogs &);
31
32         ///
33         ~ControlSpellchecker();
34
35         /// replace word with replacement
36         void replace(string const &);
37
38         /// replace all occurances of word
39         void replaceAll(string const &);
40
41         /// insert word in personal dictionary
42         void insert();
43
44         /// ignore all occurances of word
45         void ignoreAll();
46         
47         /// quit spellchecker
48         void quit();
49
50         /// stop checking
51         void stop();
52
53         /// check text until next misspelled/unknown word
54         void check();
55
56         /// spell options
57         void options();
58         
59         /// get suggestion
60         string getSuggestion();
61
62         /// get word
63         string getWord();
64
65         /// returns progress value
66         int getProgress() {
67                 return oldval_; 
68         }
69
70         /// returns exit message
71         string getMessage() {
72                 return message_;
73         }
74         
75 private:
76         
77         /// set the params before show or update
78         void show();
79
80         /// clean-up on hide.
81         void hide();
82
83         /// not needed.
84         virtual void apply() {}
85
86         /// right to left
87         bool rtl_;
88
89         /// current word being checked
90         string word_;
91
92         /// values for progress
93         float newval_;
94         int oldval_;
95         int newvalue_;
96
97         /// word count
98         int count_;
99
100         /// exit message
101         string message_;
102
103         /// set to true to stop checking
104         bool stop_;
105
106         /// spellchecker status
107         enum SpellBase::spellStatus result_;
108
109         /// The actual spellchecker object
110         SpellBase * speller_;
111         
112 };
113
114 #endif // CONTROLSPELLCHECKER_H
115
116