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"
24 InsetFootlike::InsetFootlike(BufferParams const & bp)
25 : InsetCollapsable(bp)
29 InsetFootlike::InsetFootlike(InsetFootlike const & in)
30 : InsetCollapsable(in)
34 void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
36 Font tmpfont = mi.base.font;
37 mi.base.font = mi.base.bv->buffer().params().getFont();
38 InsetCollapsable::metrics(mi, dim);
39 mi.base.font = tmpfont;
43 void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
45 Font tmpfont = pi.base.font;
46 pi.base.font = pi.base.bv->buffer().params().getFont();
47 InsetCollapsable::draw(pi, x, y);
48 pi.base.font = tmpfont;
52 void InsetFootlike::write(Buffer const & buf, std::ostream & os) const
54 os << to_utf8(name()) << "\n";
55 InsetCollapsable::write(buf, os);
59 bool InsetFootlike::insetAllowed(InsetCode code) const
61 if (code == FOOT_CODE || code == MARGIN_CODE
62 || code == FLOAT_CODE)
64 return InsetCollapsable::insetAllowed(code);