]> git.lyx.org Git - lyx.git/blob - src/insets/insetenv.C
Removed all redundant using directives from the source.
[lyx.git] / src / insets / insetenv.C
1 /**
2  * \file insetenv.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "insetenv.h"
14
15 #include "bufferparams.h"
16 #include "gettext.h"
17 #include "paragraph.h"
18 #include "paragraph_funcs.h"
19 #include "texrow.h"
20
21 using std::auto_ptr;
22 using std::ostream;
23
24
25 InsetEnvironment::InsetEnvironment
26                 (BufferParams const & bp, string const & name)
27         : InsetText(bp), layout_(bp.getLyXTextClass()[name])
28 {
29         setInsetName(name);
30         autoBreakRows = true;
31         drawFrame_ = ALWAYS;
32 }
33
34
35 InsetEnvironment::InsetEnvironment(InsetEnvironment const & in)
36         : InsetText(in), layout_(in.layout_)
37 {}
38
39
40 auto_ptr<InsetBase> InsetEnvironment::clone() const
41 {
42         return auto_ptr<InsetBase>(new InsetEnvironment(*this));
43 }
44
45
46 void InsetEnvironment::write(Buffer const & buf, ostream & os) const
47 {
48         os << "Environment " << getInsetName() << "\n";
49         InsetText::write(buf, os);
50 }
51
52
53 void InsetEnvironment::read(Buffer const & buf, LyXLex & lex)
54 {
55         InsetText::read(buf, lex);
56 }
57
58
59 string const InsetEnvironment::editMessage() const
60 {
61         return _("Opened Environment Inset: ") + getInsetName();
62 }
63
64
65 int InsetEnvironment::latex(Buffer const & buf, ostream & os,
66                             LatexRunParams const & runparams) const
67 {
68         os << layout_->latexheader;
69         TexRow texrow;
70         latexParagraphs(buf, paragraphs, os, texrow, runparams,
71                         layout_->latexparagraph);
72         os << layout_->latexfooter;
73         return texrow.rows();
74 }
75
76
77 LyXLayout_ptr const & InsetEnvironment::layout() const
78 {
79         return layout_;
80 }