]> git.lyx.org Git - lyx.git/blob - src/frontends/qt/InsetParamsDialog.h
Amend 4cd568d31266
[lyx.git] / src / frontends / qt / InsetParamsDialog.h
1 // -*- C++ -*-
2 /**
3  * \file InsetParamsDialog.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Abdelrazak Younes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_PARAMS_DIALOG_H
13 #define INSET_PARAMS_DIALOG_H
14
15 #include "DialogView.h"
16 #include "ui_InsetParamsUi.h"
17
18 #include <QPushButton>
19
20 namespace lyx {
21
22 class Inset;
23
24 namespace frontend {
25
26 class InsetParamsWidget;
27
28 /// An InsetParamsDialog wraps an InsetParamsWidget, which is what
29 /// will contain all the specific dialog parts for a given inset.
30 /// This class manages the OK, etc, buttons and immediate apply
31 /// checkbox, etc.
32 class InsetParamsDialog : public DialogView, public Ui::InsetParamsUi
33 {
34         Q_OBJECT
35 public:
36         InsetParamsDialog(GuiView & lv, InsetParamsWidget * widget);
37         ~InsetParamsDialog();
38
39         ///
40         void setInsetParamsWidget(InsetParamsWidget * widget);
41
42 protected Q_SLOTS:
43         void onWidget_changed();
44         void applyView() override;
45         void resetDialog();
46         void on_buttonBox_clicked(QAbstractButton *);
47         void on_immediateApplyCB_stateChanged(int state);
48         void on_synchronizedCB_stateChanged(int state);
49
50 private:
51         /// \name DialogView inherited methods
52         //@{
53         void updateView() override;
54         void dispatchParams() override {}
55         bool isBufferDependent() const override { return true; }
56         bool canApply() const override { return true; }
57         bool initialiseParams(std::string const &) override;
58         //@}
59         ///
60         void newInset();
61         ///
62         bool newInsetAllowed() const;
63         ///
64         void updateView(bool update_widget);
65         ///
66         docstring checkWidgets(bool immediate);
67         ///
68         QPushButton * newPB;
69         /// pimpl
70         struct Private;
71         Private * d;
72 };
73
74 } // namespace frontend
75 } // namespace lyx
76
77 #endif // INSET_PARAMS_DIALOG_H