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