]> git.lyx.org Git - features.git/blob - src/insets/InsetFlex.cpp
be730417410f3ccdabd49580de057f2bf7e52c29
[features.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         status_= Collapsed;
34 }
35
36
37 InsetFlex::InsetFlex(InsetFlex const & in)
38         : InsetCollapsable(in), name_(in.name_)
39 {}
40
41
42 InsetLayout::InsetDecoration InsetFlex::decoration() const
43 {
44         InsetLayout::InsetDecoration const dec = getLayout().decoration();
45         return dec == InsetLayout::DEFAULT ? InsetLayout::CONGLOMERATE : dec;
46 }
47
48
49 docstring InsetFlex::editMessage() const
50 {
51         return _("Opened Flex Inset");
52 }
53
54
55 void InsetFlex::write(ostream & os) const
56 {
57         os << "Flex " <<
58                 (name_.empty() ? "undefined" : name_) << "\n";
59         InsetCollapsable::write(os);
60 }
61
62
63 } // namespace lyx