]> git.lyx.org Git - lyx.git/blob - src/insets/InsetFlex.cpp
80c755bc28b1dee98c05157212b9fe70c20f6dd9
[lyx.git] / src / insets / InsetFlex.cpp
1 /**
2  * \file InsetFlex.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  * \author Martin Vermeer
8  * \author Jürgen Spitzmüller
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #include <config.h>
14
15 #include "InsetFlex.h"
16
17 #include "Buffer.h"
18 #include "BufferParams.h"
19 #include "Lexer.h"
20
21 #include "support/gettext.h"
22
23 #include <ostream>
24
25 using namespace std;
26
27 namespace lyx {
28
29
30 InsetFlex::InsetFlex(Buffer const & buf, string const & layoutName)
31         : InsetCollapsable(buf), name_(layoutName)
32 {
33         // again, because now the name is initialized
34         setLayout(buf.params().documentClassPtr());
35         status_= Collapsed;
36 }
37
38
39 InsetFlex::InsetFlex(InsetFlex const & in)
40         : InsetCollapsable(in), name_(in.name_)
41 {}
42
43
44 InsetLayout::InsetDecoration InsetFlex::decoration() const
45 {
46         InsetLayout::InsetDecoration const dec = getLayout().decoration();
47         return dec == InsetLayout::DEFAULT ? InsetLayout::CONGLOMERATE : dec;
48 }
49
50
51 docstring InsetFlex::editMessage() const
52 {
53         return _("Opened Flex Inset");
54 }
55
56
57 void InsetFlex::write(ostream & os) const
58 {
59         os << "Flex " <<
60                 (name_.empty() ? "undefined" : name_) << "\n";
61         InsetCollapsable::write(os);
62 }
63
64
65 } // namespace lyx