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 purpose 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.
41 void dispatch(FuncRequest const & fr) const;
43 /** The dialog has received a request from the user
44 * (who pressed the "Restore" button) to update contents.
45 * It must, therefore, ask the kernel to provide this information.
46 * \param name is used to identify the dialog to the kernel.
48 void updateDialog(std::string const & name) const;
50 /** A request from the Controller that future changes to the data
51 * stored by the dialog are not applied to the inset currently
52 * connected to the dialog. Instead, they will be used to generate
53 * a new inset at the cursor position.
54 * \param name is used to identify the dialog to the kernel.
56 void disconnect(std::string const & name) const;
58 /** \name Kernel Wrappers
59 * Simple wrapper functions to Buffer methods.
62 bool isBufferAvailable() const;
63 bool isBufferReadonly() const;
64 std::string const bufferFilepath() const;
67 /** \enum DocType used to flag the different kinds of buffer
68 * without making the kernel header files available to the
69 * dialog's Controller or View.
77 /// The type of the current buffer.
78 DocType docType() const;
80 /** A request that the GUI be redrawn,
81 * e.g. because the colors have been remapped.
83 void redrawGUI() const;
85 /** \name Kernel Nasties
86 * Unpleasantly public internals of the LyX kernel.
87 * We should aim to reduce/remove these from the interface.
90 LyXView & lyxview() { return lyxview_; }
91 LyXView const & lyxview() const { return lyxview_; }
94 Buffer const & buffer() const;
96 BufferView * bufferview();
97 BufferView const * bufferview() const;
105 /** \c KernelDocType is a wrapper for Kernel::DocType.
106 * It can be forward-declared and passed as a function argument without
107 * having to expose Kernel.h.
109 class KernelDocType {
111 KernelDocType(Kernel::DocType val) : val_(val) {}
112 operator Kernel::DocType() const { return val_; }
114 Kernel::DocType val_;
117 } // namespace frontend