]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Dialog.h
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / Dialog.h
index 0b5488f325bc16f83dd8152cb8d119f40c4cb563..a9769ff4abe30cb686a7d88e102575492368791c 100644 (file)
@@ -44,7 +44,6 @@ enum KernelDocType
        DOCBOOK
 };
 
-
 /** \c Dialog collects the different parts of a Model-Controller-View
  *  split of a generic dialog together.
  */
@@ -93,7 +92,7 @@ public:
        //@}
 
        /// \return inset at current cursor location.
-       Inset * inset(InsetCode code) const;
+       Inset const * inset(InsetCode code) const;
 
        /** Check whether we may apply our data.
         *
@@ -121,9 +120,17 @@ public:
        /// Hide the dialog from sight
        void hideView();
 
-       /// Create the dialog if necessary, update it and display it.
+       /// Prepare dialog and display it.
        void showView();
 
+       /// Prepare dialog before view.
+       void prepareView();
+
+       /// Decide wether the dialog should grab thekeyboard focus when shown.
+       /// This method defaults to true, override if a different behaviour
+       /// is wanted.
+       virtual bool wantInitialFocus() const { return true; }
+
        /// Update the display of the dialog whilst it is still visible.
        virtual void updateView() = 0;
 
@@ -151,10 +158,15 @@ public:
        /// Enable the Controller to dispatch its data back to the LyX kernel.
        virtual void dispatchParams() = 0;
 
+       /** \return true if the dialog should be updated when the
+        *  buffer has changed.
+        */
+       virtual bool isBufferDependent() const = 0;
+
        /** \return true if the dialog should be shown only when
         *  a buffer is open.
         */
-       virtual bool isBufferDependent() const = 0;
+       virtual bool needBufferOpen() const = 0;
 
        /** \return true if the dialog can apply data also
         *  for ReadOnly buffers.
@@ -190,11 +202,6 @@ public:
         */
        virtual bool disconnectOnApply() const { return false; }
 
-       /** \return true if Dialog::View::show() should not display the dialog
-        *   after running update. Currently, only ControlSpellchecker
-        *   makes use of that.
-       */
-       virtual bool exitEarly() const { return false; }
        //@}
 
        /** \c Kernel part: a wrapper making the LyX kernel available to the dialog.
@@ -223,7 +230,6 @@ public:
         *  stored by the dialog are not applied to the inset currently
         *  connected to the dialog. Instead, they will be used to generate
         *  a new inset at the cursor position.
-        *  \param name is used to identify the dialog to the kernel.
         */
        void disconnect() const;
 
@@ -233,7 +239,7 @@ public:
        //@{
        bool isBufferAvailable() const;
        bool isBufferReadonly() const;
-       QString bufferFilepath() const;
+       QString bufferFilePath() const;
        //@}
 
        /// The type of the current buffer.
@@ -244,13 +250,12 @@ public:
         *  We should aim to reduce/remove these from the interface.
         */
        //@{
-       GuiView & lyxview() { return *lyxview_; }
        GuiView const & lyxview() const { return *lyxview_; }
-
-       Buffer & buffer();
+       /// Current buffer
        Buffer const & buffer() const;
-
-       BufferView * bufferview();
+       /// Main document buffer
+       Buffer const & documentBuffer() const;
+       /// Current BufferView
        BufferView const * bufferview() const;
        //@}
 
@@ -262,7 +267,7 @@ protected:
 
 private:
        /** The Dialog's name is the means by which a dialog identifies
-        *  itself to the LyXView.
+        *  itself to the GuiView.
         */
        QString const name_;
        ///
@@ -273,7 +278,6 @@ private:
        /// intentionally unimplemented, therefore uncopiable
        Dialog(Dialog const &);
        void operator=(Dialog const &);
-
 };