4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
25 /** \c Kernel is a wrapper making the LyX kernel available to the dialog.
26 * (Ie, it provides an interface to the Model part of the Model-Controller-
28 * In an ideal world, it will shrink as more info is passed to the
29 * Dialog::show() and Dialog::update() methods.
33 /// \param lv is the access point for the dialog to the LyX kernel.
36 /** This method is the primary puypose of the class. It provides
37 * the "gateway" by which the dialog can send a request (of a
38 * change in the data, for more information) to the kernel.
39 * \param fr is the encoding of the request.
40 * \param verbose is set to true if the completed action should
41 * be displayed in the minibuffer.
43 void dispatch(FuncRequest const & fr, bool verbose = false) const;
45 /** The dialog has received a request from the user
46 * (who pressed the "Restore" buuton) to update contents.
47 * It must, therefore, ask the kernel to provide this information.
48 * \param name is used to identify the dialog to the kernel.
50 void updateDialog(std::string const & name) const;
52 /** A request from the Controller that future changes to the data
53 * stored by the dialog are not applied to the inset currently
54 * connected to the dialog. Instead, they will be used to generate
55 * a new inset at the cursor position.
56 * \param name is used to identify the dialog to the kernel.
58 void disconnect(std::string const & name) const;
60 /** \name Kernel Wrappers
61 * Simple wrapper functions to Buffer methods.
64 bool isBufferAvailable() const;
65 bool isBufferReadonly() const;
66 std::string const bufferFilepath() const;
69 /** \enum DocTypes used to flag the different kinds of buffer
70 * without making the kernel header files available to the
71 * dialog's Controller or View.
79 /// The type of the current buffer.
80 DocTypes docType() const;
82 /** A request that the GUI be redrawn,
83 * e.g. because the colors have been remapped.
85 void redrawGUI() const;
87 /** \name Kernel Nasties
88 * Unpleasantly public internals of the LyX kernel.
89 * We should aim to reduce/remove these from the interface.
92 LyXView & lyxview() { return lyxview_; }
93 LyXView const & lyxview() const { return lyxview_; }
96 Buffer const & buffer() const;
98 BufferView * bufferview();
99 BufferView const * bufferview() const;
106 } // namespace frontend