]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiDialog.h
Factorize general code out of GuiDialog and into the base Dialog class. This is now...
[features.git] / src / frontends / qt4 / GuiDialog.h
index 977e361fa3cc27e03d5d7dcd95e1559ce36bfd86..76889b5ccb527052edb8716a585cae3bc3bf2310 100644 (file)
 #ifndef GUIDIALOG_H
 #define GUIDIALOG_H
 
-#include "Dialog.h"
+#include "DialogView.h"
 #include "ButtonController.h"
 
 #include "insets/InsetCommandParams.h"
 
-#include <QDialog>
-#include <QObject>
-
-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 GuiDialog : public QDialog, public Dialog
+class GuiDialog : public DialogView
 {
        Q_OBJECT
 
@@ -38,7 +32,6 @@ public:
        /// \param name is the identifier given to the dialog by its parent
        /// container.
        explicit GuiDialog(GuiView & lv, std::string const & name);
-       ~GuiDialog();
 
 public Q_SLOTS:
        /** \name Buttons
@@ -59,7 +52,6 @@ public:
         *
         *  The buttons are disabled if not and (re-)enabled if yes.
         */
-       void checkStatus();
        void setButtonsValid(bool valid);
 
        /** \name Dialog Components
@@ -70,53 +62,27 @@ public:
        ButtonController & bc() { return bc_; }
        //@}
 
-       void setViewTitle(docstring const & title);
-
-
        /// the dialog has changed contents
        virtual void changed();
 
+       virtual void enableView(bool enable);
+
        /// default: do nothing
        virtual void applyView() {}
        /// default: do nothing
        virtual void updateContents() {}
-       ///
-       void closeEvent(QCloseEvent *);
-       ///
-       void showEvent(QShowEvent *);
 
-protected:
-       /// Hide the dialog.
-       virtual void hideView();
-       /// Create the dialog if necessary, update it and display it.
-       virtual void showView();
-       ///
-       virtual bool isVisibleView() const;
+public:
        /// is the dialog currently valid ?
        virtual bool isValid() { return true; }
 
 public:
-       /** \name Container Access
-        *  These methods are publicly accessible because they are invoked
-        *  by the parent container acting on commands from the LyX kernel.
-        */
-       //@{
-       /// \param data is a string encoding of the data to be displayed.
-       /// It is passed to the Controller to be translated into a useable form.
-       void showData(std::string const & data);
-       void updateData(std::string const & data);
-
-       void hide();
-
-       //@}
 
        /** When applying, it's useful to know whether the dialog is about
         *  to close or not (no point refreshing the display for example).
         */
        bool isClosing() const { return is_closing_; }
 
-       void apply();
-
        /// Update the display of the dialog whilst it is still visible.
        virtual void updateView();