]> git.lyx.org Git - lyx.git/blob - src/insets/insetfootlike.C
Strip out redundant includes (193 of 'em).
[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
18 using std::ostream;
19
20
21 InsetFootlike::InsetFootlike(BufferParams const & bp)
22         : InsetCollapsable(bp)
23 {
24         LyXFont font(LyXFont::ALL_SANE);
25         font.decSize();
26         font.decSize();
27         font.setColor(LColor::collapsable);
28         setLabelFont(font);
29 }
30
31
32 InsetFootlike::InsetFootlike(InsetFootlike const & in)
33         : InsetCollapsable(in)
34 {
35         LyXFont font(LyXFont::ALL_SANE);
36         font.decSize();
37         font.decSize();
38         font.setColor(LColor::collapsable);
39         setLabelFont(font);
40 }
41
42
43 void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
44 {
45         InsetCollapsable::metrics(mi, dim);
46         if (isOpen())
47                 dim.wid = mi.base.textwidth;
48         dim_ = dim;
49 }
50
51
52 void InsetFootlike::write(Buffer const & buf, ostream & os) const
53 {
54         os << getInsetName() << "\n";
55         InsetCollapsable::write(buf, os);
56 }
57
58
59 bool InsetFootlike::insetAllowed(InsetOld::Code code) const
60 {
61         if (code == InsetOld::FOOT_CODE || code == InsetOld::MARGIN_CODE
62             || code == InsetOld::FLOAT_CODE)
63                 return false;
64         return InsetCollapsable::insetAllowed(code);
65 }