]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlSpellchecker.h
dont use pragma impementation and interface anymore
[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
16 #include "ControlDialog_impl.h"
17 #include "LString.h"
18 #include "WordLangTuple.h"
19
20 class SpellBase;
21
22 /** A controller for Spellchecker dialogs.
23  */
24 class ControlSpellchecker : public ControlDialogBD {
25 public:
26         ///
27         ControlSpellchecker(LyXView &, Dialogs &);
28
29         /// replace word with replacement
30         void replace(string const &);
31
32         /// replace all occurances of word
33         void replaceAll(string const &);
34
35         /// insert word in personal dictionary
36         void insert();
37
38         /// ignore all occurances of word
39         void ignoreAll();
40
41         /// stop checking
42         void stop();
43
44         /// check text until next misspelled/unknown word
45         void check();
46
47         /// get suggestion
48         string const getSuggestion() const;
49
50         /// get word
51         string const getWord() const;
52
53         /// returns progress value
54         int getProgress() const { return oldval_; }
55
56         /// returns exit message
57         string const getMessage()  const { return message_; }
58
59         /// returns word count
60         int getCount()  const { return count_; }
61
62 private:
63         /// set the params before show or update
64         void setParams();
65         /// clean-up on hide.
66         void clearParams();
67
68         /// not needed.
69         virtual void apply() {}
70
71         /// current word being checked and lang code
72         WordLangTuple word_;
73
74         /// values for progress
75         float newval_;
76         int oldval_;
77         int newvalue_;
78
79         /// word count
80         int count_;
81
82         /// exit message
83         string message_;
84
85         /// set to true to stop checking
86         bool stop_;
87
88         /// The actual spellchecker object
89         SpellBase * speller_;
90 };
91
92 #endif // CONTROLSPELLCHECKER_H