3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Angus Leeming
8 * Full author contact details are available in file CREDITS.
16 #include "BufferView.h"
17 #include "funcrequest.h"
19 #include "frontends/Dialogs.h"
20 #include "frontends/LyXView.h"
28 Kernel::Kernel(LyXView & lyxview)
33 void Kernel::dispatch(FuncRequest const & fr, bool verbose) const
35 lyxview_.getLyXFunc().dispatch(fr, verbose);
39 void Kernel::updateDialog(string const & name) const
41 dispatch(FuncRequest(LFUN_DIALOG_UPDATE, name));
45 void Kernel::disconnect(string const & name) const
47 lyxview_.getDialogs().disconnect(name);
50 bool Kernel::isBufferAvailable() const
52 if (!lyxview_.view().get())
54 return lyxview_.view()->available();
58 bool Kernel::isBufferReadonly() const
60 if (!lyxview_.buffer())
62 return lyxview_.buffer()->isReadonly();
66 string const Kernel::bufferFilepath() const
68 return buffer().filePath();
72 Kernel::DocTypes Kernel::docType() const
74 if (buffer().isLatex())
76 if (buffer().isLiterate())
78 if (buffer().isLinuxDoc())
85 void Kernel::redrawGUI() const
87 lyxview_.getDialogs().redrawGUI();
91 BufferView * Kernel::bufferview()
93 return lyxview_.view().get();
97 BufferView const * Kernel::bufferview() const
99 return lyxview_.view().get();
103 Buffer & Kernel::buffer()
105 BOOST_ASSERT(lyxview_.buffer());
106 return *lyxview_.buffer();
110 Buffer const & Kernel::buffer() const
112 BOOST_ASSERT(lyxview_.buffer());
113 return *lyxview_.buffer();
116 } // namespace frontend