2 * \file insetfootlike.C
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"
17 #include "metricsinfo.h"
18 #include "paragraph.h"
23 InsetFootlike::InsetFootlike(BufferParams const & bp)
24 : InsetCollapsable(bp)
26 LyXFont font(LyXFont::ALL_SANE);
29 font.setColor(LColor::collapsable);
34 InsetFootlike::InsetFootlike(InsetFootlike const & in)
35 : InsetCollapsable(in)
37 LyXFont font(LyXFont::ALL_SANE);
40 font.setColor(LColor::collapsable);
45 void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
47 LyXFont tmpfont = mi.base.font;
48 mi.base.font = LyXFont(LyXFont::ALL_SANE);
49 InsetCollapsable::metrics(mi, dim);
50 mi.base.font = tmpfont;
55 void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
57 LyXFont tmpfont = pi.base.font;
58 pi.base.font = LyXFont(LyXFont::ALL_SANE);
59 InsetCollapsable::draw(pi, x, y);
60 pi.base.font = tmpfont;
64 void InsetFootlike::write(Buffer const & buf, ostream & os) const
66 os << getInsetName() << "\n";
67 InsetCollapsable::write(buf, os);
71 bool InsetFootlike::insetAllowed(InsetBase::Code code) const
73 if (code == InsetBase::FOOT_CODE || code == InsetBase::MARGIN_CODE
74 || code == InsetBase::FLOAT_CODE)
76 return InsetCollapsable::insetAllowed(code);