DOCBOOK
};
-
/** \c Dialog collects the different parts of a Model-Controller-View
* split of a generic dialog together.
*/
/// 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.
/// 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.
*/
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.
//@{
bool isBufferAvailable() const;
bool isBufferReadonly() const;
- QString bufferFilepath() const;
+ QString bufferFilePath() const;
//@}
/// The type of the current buffer.
* We should aim to reduce/remove these from the interface.
*/
//@{
- GuiView const & lyxview() const { return *lyxview_; }
+ GuiView const & lyxview() const { return lyxview_; }
+ /// Current buffer
Buffer const & buffer() const;
+ /// Main document buffer
+ Buffer const & documentBuffer() const;
+ /// Current BufferView
BufferView const * bufferview() const;
//@}
void setTitle(QString const & title) { title_ = title; }
///
virtual void apply();
+ /// To be called when the buffer view has changed
+ virtual void onBufferViewChanged() = 0;
private:
/** The Dialog's name is the means by which a dialog identifies
- * itself to the LyXView.
+ * itself to the GuiView.
*/
QString const name_;
///
QString title_;
///
- GuiView * lyxview_;
+ GuiView & lyxview_;
/// intentionally unimplemented, therefore uncopiable
Dialog(Dialog const &);
void operator=(Dialog const &);
-
};