]> git.lyx.org Git - features.git/blob - src/frontends/qt/DialogView.h
include "GuiView.h": DialogView.h -> DialogView.cpp
[features.git] / src / frontends / qt / DialogView.h
1 // -*- C++ -*-
2 /**
3  * \file DialogView.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 DIALOGVIEW_H
13 #define DIALOGVIEW_H
14
15 #include "Dialog.h"
16
17 #include <QCloseEvent>
18 #include <QDialog>
19
20 namespace lyx {
21 namespace frontend {
22
23 class DialogView : public QDialog, public Dialog
24 {
25         Q_OBJECT
26
27 public:
28         /// \param lv is the access point for the dialog to the LyX kernel.
29         /// \param name is the identifier given to the dialog by its parent
30         /// container.
31         /// \param title is the window title used for decoration.
32         DialogView(GuiView & lv, QString const & name, QString const & title);
33
34         QWidget * asQWidget() override { return this; }
35         QWidget const * asQWidget() const override { return this; }
36
37 protected:
38         /// \name Dialog inherited methods
39         //@{
40         void applyView() override {}
41         bool initialiseParams(std::string const & /*data*/) override { return true; }
42         void clearParams() override {}
43         bool needBufferOpen() const override { return isBufferDependent(); }
44         //@}
45         /// Any dialog that overrides this method should make sure to call it.
46         void closeEvent(QCloseEvent * ev) override;
47         /// Any dialog that overrides this method should make sure to call it.
48         void hideEvent(QHideEvent * ev) override;
49
50 protected Q_SLOTS:
51         void onBufferViewChanged() override {};
52 };
53
54 } // namespace frontend
55 } // namespace lyx
56
57 #endif // DIALOGVIEW_H