2 * \file InsetEnvironment.cpp
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.
13 #include "InsetEnvironment.h"
15 #include "BufferParams.h"
18 #include "OutputParams.h"
19 #include "output_latex.h"
26 InsetEnvironment::InsetEnvironment
27 (BufferParams const & bp, docstring const & name)
28 : InsetText(bp), layout_(bp.getTextClass()[name]), name_(name)
30 setAutoBreakRows(true);
35 InsetEnvironment::InsetEnvironment(InsetEnvironment const & in)
36 : InsetText(in), layout_(in.layout_)
40 Inset * InsetEnvironment::clone() const
42 return new InsetEnvironment(*this);
46 void InsetEnvironment::write(Buffer const & buf, std::ostream & os) const
48 os << "Environment " << to_utf8(name()) << "\n";
49 InsetText::write(buf, os);
53 void InsetEnvironment::read(Buffer const & buf, Lexer & lex)
55 InsetText::read(buf, lex);
59 docstring const InsetEnvironment::editMessage() const
61 return _("Opened Environment Inset: ") + name();
65 int InsetEnvironment::latex(Buffer const & buf, odocstream & os,
66 OutputParams const & runparams) const
69 os << from_utf8(layout_->latexheader);
71 latexParagraphs(buf, paragraphs(), os, texrow, runparams,
72 layout_->latexparagraph);
74 os << from_utf8(layout_->latexfooter);
79 int InsetEnvironment::plaintext(Buffer const & buf, odocstream & os,
80 OutputParams const & runparams) const
82 os << '[' << to_utf8(name()) << ":\n";
83 InsetText::plaintext(buf, os, runparams);
86 return PLAINTEXT_NEWLINE + 1; // one char on a separate line
90 LayoutPtr const & InsetEnvironment::layout() const