4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS
16 #include "lyxtextclass.h"
17 #include "lyxlayout.h"
18 #include "bufferparams.h"
19 #include "support/LOstream.h"
27 InsetEnvironment::InsetEnvironment
28 (BufferParams const & bp, string const & name)
29 : InsetCollapsable(bp)
33 // needs more stuff in lyxlayout. coming in later patches.
34 //LyXTextClass const & tc = bp.getLyXTextClass();
35 //LyXLayout_ptr const & layout = tc.getEnv(name);
36 //header_ = layout->latexheader;
37 //footer_ = layout->latexfooter;
38 header_ = "\\begin{" + name + "}";
39 footer_ = "\\end{" + name + "}";
43 InsetEnvironment::InsetEnvironment(InsetEnvironment const & in, bool same_id)
44 : InsetCollapsable(in, same_id), header_(in.header_), footer_(in.footer_)
48 Inset * InsetEnvironment::clone(Buffer const &, bool same_id) const
50 return new InsetEnvironment(*this, same_id);
54 void InsetEnvironment::write(Buffer const * buf, ostream & os) const
56 os << "Environment " << getInsetName() << "\n";
57 InsetCollapsable::write(buf, os);
61 void InsetEnvironment::read(Buffer const * buf, LyXLex & lex)
63 InsetCollapsable::read(buf, lex);
67 string const InsetEnvironment::editMessage() const
69 return _("Opened Environment Inset: ") + getInsetName();
73 int InsetEnvironment::latex(Buffer const * buf,
74 ostream & os, bool fragile, bool fp) const
77 int i = inset.latex(buf, os, fragile, fp);