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)
35 // needs more stuff in lyxlayout. coming in later patches.
36 //LyXTextClass const & tc = bp.getLyXTextClass();
37 //LyXLayout_ptr const & layout = tc.getEnv(name);
38 //header_ = layout->latexheader;
39 //footer_ = layout->latexfooter;
40 header_ = "\\begin{" + name + "}";
41 footer_ = "\\end{" + name + "}";
45 InsetEnvironment::InsetEnvironment(InsetEnvironment const & in, bool same_id)
46 : InsetText(in, same_id), header_(in.header_), footer_(in.footer_)
50 Inset * InsetEnvironment::clone(Buffer const &, bool same_id) const
52 return new InsetEnvironment(*this, same_id);
56 void InsetEnvironment::write(Buffer const * buf, ostream & os) const
58 os << "Environment " << getInsetName() << "\n";
59 InsetText::write(buf, os);
63 void InsetEnvironment::read(Buffer const * buf, LyXLex & lex)
65 InsetText::read(buf, lex);
69 string const InsetEnvironment::editMessage() const
71 return _("Opened Environment Inset: ") + getInsetName();
75 int InsetEnvironment::latex(Buffer const * buf,
76 ostream & os, bool fragile, bool fp) const
79 int i = InsetText::latex(buf, os, fragile, fp);