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.
15 #include "FuncRequest.h"
16 #include "FuncStatus.h"
19 #include "frontends/LyXView.h"
20 #include "frontends/Dialogs.h" // FIXME
33 bool Dialog::canApply() const
35 FuncRequest const fr(getLfun(), name());
36 FuncStatus const fs(getStatus(fr));
41 void Dialog::dispatch(FuncRequest const & fr) const
43 lyxview_->dispatch(fr);
47 void Dialog::updateDialog(std::string const & name) const
49 dispatch(FuncRequest(LFUN_DIALOG_UPDATE, name));
53 void Dialog::disconnect(std::string const & name) const
55 lyxview_->getDialogs().disconnect(name);
59 bool Dialog::isBufferAvailable() const
61 return lyxview_->buffer() != 0;
65 bool Dialog::isBufferReadonly() const
67 if (!lyxview_->buffer())
69 return lyxview_->buffer()->isReadonly();
73 std::string const Dialog::bufferFilepath() const
75 return buffer().filePath();
79 KernelDocType Dialog::docType() const
81 if (buffer().isLatex())
83 if (buffer().isLiterate())
90 BufferView * Dialog::bufferview()
92 return lyxview_->view();
96 BufferView const * Dialog::bufferview() const
98 return lyxview_->view();
102 Buffer & Dialog::buffer()
104 BOOST_ASSERT(lyxview_->buffer());
105 return *lyxview_->buffer();
109 Buffer const & Dialog::buffer() const
111 BOOST_ASSERT(lyxview_->buffer());
112 return *lyxview_->buffer();
115 } // namespace frontend