]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiSpellchecker.h
merge ButtonController and its view (Qt2BC in this case)
[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  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef GUISPELLCHECKER_H
14 #define GUISPELLCHECKER_H
15
16 #include "GuiDialogView.h"
17 #include "ControlSpellchecker.h"
18 #include "ui_SpellcheckerUi.h"
19
20 #include <QDialog>
21
22 class QListWidgetItem;
23
24
25 namespace lyx {
26 namespace frontend {
27
28 class GuiSpellchecker;
29
30 class GuiSpellcheckerDialog: public QDialog, public Ui::SpellcheckerUi {
31         Q_OBJECT
32 public:
33         GuiSpellcheckerDialog(GuiSpellchecker * form);
34 public Q_SLOTS:
35         virtual void suggestionChanged(QListWidgetItem *);
36
37 protected Q_SLOTS:
38         virtual void acceptClicked();
39         virtual void addClicked();
40         virtual void replaceClicked();
41         virtual void ignoreClicked();
42         virtual void replaceChanged(const QString &);
43         virtual void reject();
44
45 protected:
46         virtual void closeEvent(QCloseEvent * e);
47
48 private:
49         GuiSpellchecker * form_;
50 };
51
52
53 class GuiSpellchecker : public GuiView<GuiSpellcheckerDialog>
54 {
55 public:
56         friend class GuiSpellcheckerDialog;
57
58         GuiSpellchecker(GuiDialog &);
59
60         /// update from controller
61         void partialUpdate(int id);
62         /// parent controller
63         ControlSpellchecker & controller()
64         { return static_cast<ControlSpellchecker &>(this->getController()); }
65         /// parent controller
66         ControlSpellchecker const & controller() const
67         { return static_cast<ControlSpellchecker const &>(this->getController()); }
68 private:
69         void accept();
70         void add();
71         void ignore();
72         void replace();
73
74         /// Apply changes
75         virtual void apply() {}
76         ///
77         virtual void update_contents();
78         /// build the dialog
79         virtual void build_dialog();
80 };
81
82 } // namespace frontend
83 } // namespace lyx
84
85 #endif // GUISPELLCHECKER_H