]> git.lyx.org Git - lyx.git/blob - src/frontends/qt/GuiSpellchecker.h
Add accelerators
[lyx.git] / src / frontends / qt / 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  * \author Abdelrazak Younes
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef GUISPELLCHECKER_H
16 #define GUISPELLCHECKER_H
17
18 #include "DockView.h"
19 #include <QTabWidget>
20
21 class QListWidgetItem;
22
23 namespace lyx {
24
25 namespace frontend {
26
27 class SpellcheckerWidget : public QTabWidget
28 {
29         Q_OBJECT
30
31 public:
32         SpellcheckerWidget(GuiView * gv, DockView * dv, QWidget * parent = nullptr);
33         ~SpellcheckerWidget();
34         ///
35         void updateView();
36         ///
37         bool initialiseParams(std::string const &);
38
39 private Q_SLOTS:
40         void on_replaceAllPB_clicked();
41         void on_suggestionsLW_itemClicked(QListWidgetItem *);
42         void on_replaceCO_highlighted(int index);
43         void on_languageCO_activated(int index);
44         void on_ignoreAllPB_clicked();
45         void on_skipAllPB_clicked();
46         void on_addPB_clicked();
47         void on_skipPB_clicked();
48         void on_ignorePB_clicked();
49         void on_replacePB_clicked();
50
51 private:
52         ///
53         bool eventFilter(QObject *obj, QEvent *event) override;
54         struct Private;
55         Private * const d;
56 };
57
58
59 class GuiSpellchecker : public DockView
60 {
61         Q_OBJECT
62
63 public:
64         GuiSpellchecker(
65                 GuiView & parent, ///< the main window where to dock.
66                 Qt::DockWidgetArea area = Qt::RightDockWidgetArea, ///< Position of the dock (and also drawer)
67                 Qt::WindowFlags flags = {});
68         ~GuiSpellchecker();
69
70 private:
71         ///{
72         void updateView() override;
73         bool initialiseParams(std::string const & sdata) override
74                 { return widget_->initialiseParams(sdata); }
75         void clearParams() override {}
76         void dispatchParams() override {}
77         bool isBufferDependent() const override { return false; }
78         ///}
79         /// The encapsulated widget.
80         SpellcheckerWidget * widget_;
81 };
82
83 } // namespace frontend
84 } // namespace lyx
85
86 #endif // GUISPELLCHECKER_H