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.
26 /** \c Kernel is a wrapper making the LyX kernel available to the dialog.
27 * (Ie, it provides an interface to the Model part of the Model-Controller-
29 * In an ideal world, it will shrink as more info is passed to the
30 * Dialog::show() and Dialog::update() methods.
34 /// \param lv is the access point for the dialog to the LyX kernel.
37 /** This method is the primary purpose of the class. It provides
38 * the "gateway" by which the dialog can send a request (of a
39 * change in the data, for more information) to the kernel.
40 * \param fr is the encoding of the request.
42 void dispatch(FuncRequest const & fr) const;
44 /** The dialog has received a request from the user
45 * (who pressed the "Restore" button) to update contents.
46 * It must, therefore, ask the kernel to provide this information.
47 * \param name is used to identify the dialog to the kernel.
49 void updateDialog(std::string const & name) const;
51 /** A request from the Controller that future changes to the data
52 * stored by the dialog are not applied to the inset currently
53 * connected to the dialog. Instead, they will be used to generate
54 * a new inset at the cursor position.
55 * \param name is used to identify the dialog to the kernel.
57 void disconnect(std::string const & name) const;
59 /** \name Kernel Wrappers
60 * Simple wrapper functions to Buffer methods.
63 bool isBufferAvailable() const;
64 bool isBufferReadonly() const;
65 std::string const bufferFilepath() const;
68 /** \enum DocType used to flag the different kinds of buffer
69 * without making the kernel header files available to the
70 * dialog's Controller or View.
77 /// The type of the current buffer.
78 DocType docType() const;
80 /** \name Kernel Nasties
81 * Unpleasantly public internals of the LyX kernel.
82 * We should aim to reduce/remove these from the interface.
85 LyXView & lyxview() { return lyxview_; }
86 LyXView const & lyxview() const { return lyxview_; }
89 Buffer const & buffer() const;
91 BufferView * bufferview();
92 BufferView const * bufferview() const;
100 /** \c KernelDocType is a wrapper for Kernel::DocType.
101 * It can be forward-declared and passed as a function argument without
102 * having to expose Kernel.h.
104 class KernelDocType {
106 KernelDocType(Kernel::DocType val) : val_(val) {}
107 operator Kernel::DocType() const { return val_; }
109 Kernel::DocType val_;
112 } // namespace frontend