#include "mathed/MathSupport.h"
#include "frontends/alert.h"
+#include "frontends/Delegates.h"
#include "frontends/WorkAreaManager.h"
#include "graphics/Previews.h"
Buffer::Buffer(string const & file, bool readonly)
- : pimpl_(new Impl(*this, FileName(file), readonly))
+ : pimpl_(new Impl(*this, FileName(file), readonly)), gui_(0)
{
LYXERR(Debug::INFO) << "Buffer::Buffer()" << endl;
}
}
-void Buffer::changed()
+void Buffer::changed() const
{
if (pimpl_->wa_)
pimpl_->wa_->redrawAll();
}
-frontend::WorkAreaManager * Buffer::workAreaManager() const
+frontend::WorkAreaManager & Buffer::workAreaManager() const
{
- return pimpl_->wa_;
+ BOOST_ASSERT(pimpl_->wa_);
+ return *pimpl_->wa_;
}
+
Text & Buffer::text() const
{
return const_cast<Text &>(pimpl_->inset.text_);
}
+void Buffer::structureChanged() const
+{
+ if (gui_)
+ gui_->structureChanged();
+}
+
+
+void Buffer::embeddingChanged() const
+{
+ if (gui_)
+ gui_->embeddingChanged();
+}
+
+
+void Buffer::errors(std::string const & err) const
+{
+ if (gui_)
+ gui_->errors(err);
+}
+
+
+void Buffer::message(docstring const & msg) const
+{
+ if (gui_)
+ gui_->message(msg);
+}
+
+
+void Buffer::busy(bool on) const
+{
+ if (gui_)
+ gui_->busy(on);
+}
+
+
+void Buffer::readonly(bool on) const
+{
+ if (gui_)
+ gui_->readonly(on);
+}
+
+
+void Buffer::updateTitles() const
+{
+ if (gui_)
+ gui_->updateTitles();
+}
+
+
+void Buffer::resetAutosaveTimers() const
+{
+ if (gui_)
+ gui_->resetAutosaveTimers();
+}
+
+
+void Buffer::setGuiDelegate(frontend::GuiBufferDelegate * gui)
+{
+ gui_ = gui;
+}
+
} // namespace lyx