]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlSpellchecker.h
Remove LYX_LAYOUT_DEFAULT - it is very very old, even klyx doesn't use 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 "ControlDialog_impl.h"
23 #include "LString.h"
24 #include "WordLangTuple.h"
25
26 class SpellBase;
27  
28 /** A controller for Spellchecker dialogs.
29  */
30 class ControlSpellchecker : public ControlDialogBD {
31 public:
32         ///
33         ControlSpellchecker(LyXView &, Dialogs &);
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         /// stop checking
48         void stop();
49
50         /// check text until next misspelled/unknown word
51         void check();
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 and lang code
83         WordLangTuple 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         /// The actual spellchecker object
100         SpellBase * speller_;
101
102 };
103
104 #endif // CONTROLSPELLCHECKER_H