#define DIALOGVIEW_H
#include "Dialog.h"
+#include "GuiView.h"
+#include <QCloseEvent>
#include <QDialog>
-class QCloseEvent;
-class QShowEvent;
-
namespace lyx {
namespace frontend {
-/** \c Dialog collects the different parts of a Model-Controller-View
- * split of a generic dialog together.
- */
class DialogView : public QDialog, public Dialog
{
Q_OBJECT
/// \param lv is the access point for the dialog to the LyX kernel.
/// \param name is the identifier given to the dialog by its parent
/// container.
- explicit DialogView(GuiView & lv, std::string const & name);
- virtual ~DialogView() {}
+ /// \param title is the window title used for decoration.
+ DialogView(GuiView & lv, QString const & name, QString const & title);
virtual QWidget * asQWidget() { return this; }
virtual QWidget const * asQWidget() const { return this; }
-public:
- ///
- void setViewTitle(docstring const & title);
-
- ///
- void closeEvent(QCloseEvent *);
- ///
- void showEvent(QShowEvent *);
+protected:
+ /// \name Dialog inherited methods
+ //@{
+ void applyView() {}
+ bool initialiseParams(std::string const & /*data*/) { return true; }
+ void clearParams() {}
+ bool needBufferOpen() const { return isBufferDependent(); }
+ //@}
+ /// Any dialog that overrides this method should make sure to call it.
+ void closeEvent(QCloseEvent * ev);
+ /// Any dialog that overrides this method should make sure to call it.
+ void hideEvent(QHideEvent * ev);
+
+protected Q_SLOTS:
+ void onBufferViewChanged() {};
};
} // namespace frontend