]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiSpellchecker.h
Spellchecker: More simplifications.
[lyx.git] / src / frontends / qt4 / GuiSpellchecker.h
1 // -*- C++ -*-
2 /**
3  * \file GuiSpellchecker.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  * \author Kalle Dalheimer
9  * \author Edwin Leuven
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef GUISPELLCHECKER_H
15 #define GUISPELLCHECKER_H
16
17 #include "GuiDialog.h"
18 #include "ui_SpellcheckerUi.h"
19 #include "Dialog.h"
20 #include "WordLangTuple.h"
21
22 class QListWidgetItem;
23
24 namespace lyx {
25
26 class docstring_list;
27 class SpellChecker;
28
29 namespace frontend {
30
31 class GuiSpellchecker : public GuiDialog, public Ui::SpellcheckerUi
32 {
33         Q_OBJECT
34
35 public:
36         GuiSpellchecker(GuiView & lv);
37
38 public Q_SLOTS:
39         void suggestionChanged(QListWidgetItem *);
40
41 private Q_SLOTS:
42         /// ignore all occurances of word
43         void accept();
44         void add();
45         void ignore();
46         void replace();
47         void replaceChanged(const QString &);
48         void reject();
49
50 private:
51         /// update from controller
52         void updateSuggestions(docstring_list & words);
53         ///
54         void updateContents();
55
56         ///
57         bool initialiseParams(std::string const & data);
58         ///
59         void clearParams() {}
60         /// Not needed here
61         void dispatchParams() {}
62         ///
63         bool isBufferDependent() const { return true; }
64
65         /// replace word with replacement
66         void replace(docstring const &);
67
68         /// replace all occurances of word
69         void replaceAll(docstring const &);
70         /// insert word in personal dictionary
71         void insert();
72         /// check text until next misspelled/unknown word
73         /// returns true when finished
74         void check();
75         /// show count of checked words at normal exit
76         void showSummary();
77
78         /// current word being checked and lang code
79         WordLangTuple word_;
80         /// values for progress
81         int total_;
82         int progress_;
83         /// word count
84         int count_;
85 };
86
87 } // namespace frontend
88 } // namespace lyx
89
90 #endif // GUISPELLCHECKER_H