]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Dialog.h
Compil fix.
[lyx.git] / src / frontends / qt4 / Dialog.h
index 64dd73008644fb1b63c3d2fca40d0a92ae26f2d5..9c7b3b6c56cad85a3c4e778cc8269222595cd8cc 100644 (file)
 #ifndef DIALOG_H
 #define DIALOG_H
 
-#include "lfuns.h"
+#include "FuncCode.h"
 
-#include <string>
+#include "support/strfwd.h"
+
+#include <QString>
 
 class QWidget;
 
@@ -49,13 +51,34 @@ public:
        /// \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.
-       Dialog(GuiView & lv, std::string const & name);
+       /// \param title is the window title used for decoration.
+       Dialog(GuiView & lv, QString const & name, QString const & title);
 
        virtual ~Dialog();
 
        virtual QWidget * asQWidget() = 0;
        virtual QWidget const * asQWidget() const = 0;
 
+       /// Session key.
+       /**
+        * This key must be used for any session setting.
+        **/
+       QString sessionKey() const;
+
+       /// Save session settings.
+       /**
+        * This default implementation saves the geometry state.
+        * Reimplement to save more settings.
+        **/
+       virtual void saveSession() const;
+
+       /// Restore session settings.
+       /**
+        * This default implementation restores the geometry state.
+        * Reimplement to restore more settings.
+        **/
+       virtual void restoreSession();
+
        /** \name Container Access
         *  These methods are publicly accessible because they are invoked
         *  by the parent container acting on commands from the LyX kernel.
@@ -64,7 +87,6 @@ public:
        /// \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.
        virtual void showData(std::string const & data);
-       virtual void updateData(std::string const & data);
        //@}
 
        /** Check whether we may apply our data.
@@ -108,10 +130,7 @@ public:
        //@}
 
        /// Dialog identifier.
-       /// FIXME for Andre': Now that Dialog is entirely within qt4/
-       /// We can use QString instead in order to avoid <string> inclusion
-       /// or we can pimpl name_.
-       std::string const & name() const;
+       QString name() const { return name_; }
 
        //@{
        /** Enable the controller to initialise its data structures.
@@ -145,7 +164,7 @@ public:
         * It should be used in dispatchParams(), too for consistency reasons.
         *  \returns the lfun that is sent for applying the data.
         */
-       virtual kb_action getLfun() const { return LFUN_INSET_APPLY; }
+       virtual FuncCode getLfun() const { return LFUN_INSET_APPLY; }
 
        /** Check whether we may apply our data.
         *
@@ -208,7 +227,7 @@ public:
        //@{
        bool isBufferAvailable() const;
        bool isBufferReadonly() const;
-       std::string const bufferFilepath() const;
+       QString bufferFilepath() const;
        //@}
 
        /// The type of the current buffer.
@@ -230,13 +249,18 @@ public:
        //@}
 
 protected:
+       ///
+       void setTitle(QString const & title) { title_ = title; }
+       ///
        virtual void apply();
 
 private:
        /** The Dialog's name is the means by which a dialog identifies
         *  itself to the LyXView.
         */
-       std::string const name_;
+       QString const name_;
+       ///
+       QString title_;
        ///
        GuiView * lyxview_;