]> git.lyx.org Git - lyx.git/blob - src/insets/insetfootlike.C
Move depth_type to support/types.h.
[lyx.git] / src / insets / insetfootlike.C
1 /**
2  * \file insetfootlike.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "insetfootlike.h"
14
15 #include "buffer.h"
16 #include "metricsinfo.h"
17 #include "paragraph.h"
18
19 using std::ostream;
20
21
22 InsetFootlike::InsetFootlike(BufferParams const & bp)
23         : InsetCollapsable(bp)
24 {
25         LyXFont font(LyXFont::ALL_SANE);
26         font.decSize();
27         font.decSize();
28         font.setColor(LColor::collapsable);
29         setLabelFont(font);
30 }
31
32
33 InsetFootlike::InsetFootlike(InsetFootlike const & in)
34         : InsetCollapsable(in)
35 {
36         LyXFont font(LyXFont::ALL_SANE);
37         font.decSize();
38         font.decSize();
39         font.setColor(LColor::collapsable);
40         setLabelFont(font);
41 }
42
43
44 void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
45 {
46         InsetCollapsable::metrics(mi, dim);
47         if (isOpen())
48                 dim.wid = mi.base.textwidth;
49         dim_ = dim;
50 }
51
52
53 void InsetFootlike::write(Buffer const & buf, ostream & os) const
54 {
55         os << getInsetName() << "\n";
56         InsetCollapsable::write(buf, os);
57 }
58
59
60 bool InsetFootlike::insetAllowed(InsetOld::Code code) const
61 {
62         if (code == InsetOld::FOOT_CODE || code == InsetOld::MARGIN_CODE
63             || code == InsetOld::FLOAT_CODE)
64                 return false;
65         return InsetCollapsable::insetAllowed(code);
66 }