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.
18 #include "FuncRequest.h"
19 #include "FuncStatus.h"
31 bool Dialog::canApply() const
33 FuncRequest const fr(getLfun(), name());
34 FuncStatus const fs(getStatus(fr));
39 void Dialog::dispatch(FuncRequest const & fr) const
41 lyxview_->dispatch(fr);
45 void Dialog::updateDialog(std::string const & name) const
47 dispatch(FuncRequest(LFUN_DIALOG_UPDATE, name));
51 void Dialog::disconnect(std::string const & name) const
53 lyxview_->disconnectDialog(name);
57 bool Dialog::isBufferAvailable() const
59 return lyxview_->buffer() != 0;
63 bool Dialog::isBufferReadonly() const
65 if (!lyxview_->buffer())
67 return lyxview_->buffer()->isReadonly();
71 std::string const Dialog::bufferFilepath() const
73 return buffer().filePath();
77 KernelDocType Dialog::docType() const
79 if (buffer().isLatex())
81 if (buffer().isLiterate())
88 BufferView * Dialog::bufferview()
90 return lyxview_->view();
94 BufferView const * Dialog::bufferview() const
96 return lyxview_->view();
100 Buffer & Dialog::buffer()
102 BOOST_ASSERT(lyxview_->buffer());
103 return *lyxview_->buffer();
107 Buffer const & Dialog::buffer() const
109 BOOST_ASSERT(lyxview_->buffer());
110 return *lyxview_->buffer();
113 } // namespace frontend