2 * \file InsetFootlike.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS.
13 #include "InsetFootlike.h"
16 #include "BufferView.h"
17 #include "BufferParams.h"
18 #include "MetricsInfo.h"
23 InsetFootlike::InsetFootlike(BufferParams const & bp)
24 : InsetCollapsable(bp)
26 Font font(Font::ALL_SANE);
29 font.setColor(Color::collapsable);
34 InsetFootlike::InsetFootlike(InsetFootlike const & in)
35 : InsetCollapsable(in)
37 Font font(Font::ALL_SANE);
40 font.setColor(Color::collapsable);
45 bool InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
47 Font tmpfont = mi.base.font;
48 mi.base.font = mi.base.bv->buffer()->params().getFont();
49 InsetCollapsable::metrics(mi, dim);
50 mi.base.font = tmpfont;
51 bool const changed = dim_ != dim;
57 void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
59 Font tmpfont = pi.base.font;
60 pi.base.font = pi.base.bv->buffer()->params().getFont();
61 InsetCollapsable::draw(pi, x, y);
62 pi.base.font = tmpfont;
66 void InsetFootlike::write(Buffer const & buf, std::ostream & os) const
68 os << to_utf8(name()) << "\n";
69 InsetCollapsable::write(buf, os);
73 bool InsetFootlike::insetAllowed(Inset::Code code) const
75 if (code == Inset::FOOT_CODE || code == Inset::MARGIN_CODE
76 || code == Inset::FLOAT_CODE)
78 return InsetCollapsable::insetAllowed(code);