3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
15 #include "bufferparams.h"
17 #include "paragraph.h"
18 #include "output_latex.h"
23 using lyx::odocstream;
30 InsetEnvironment::InsetEnvironment
31 (BufferParams const & bp, string const & name)
32 : InsetText(bp), layout_(bp.getLyXTextClass()[name])
35 setAutoBreakRows(true);
40 InsetEnvironment::InsetEnvironment(InsetEnvironment const & in)
41 : InsetText(in), layout_(in.layout_)
45 auto_ptr<InsetBase> InsetEnvironment::doClone() const
47 return auto_ptr<InsetBase>(new InsetEnvironment(*this));
51 void InsetEnvironment::write(Buffer const & buf, ostream & os) const
53 os << "Environment " << getInsetName() << "\n";
54 InsetText::write(buf, os);
58 void InsetEnvironment::read(Buffer const & buf, LyXLex & lex)
60 InsetText::read(buf, lex);
64 docstring const InsetEnvironment::editMessage() const
67 return _("Opened Environment Inset: ") + lyx::from_utf8(getInsetName());
71 int InsetEnvironment::latex(Buffer const & buf, odocstream & os,
72 OutputParams const & runparams) const
75 os << lyx::from_utf8(layout_->latexheader);
77 latexParagraphs(buf, paragraphs(), os, texrow, runparams,
78 layout_->latexparagraph);
80 os << lyx::from_utf8(layout_->latexfooter);
85 LyXLayout_ptr const & InsetEnvironment::layout() const