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"
16 #include "BufferView.h"
17 #include "bufferparams.h"
19 #include "metricsinfo.h"
20 #include "paragraph.h"
25 InsetFootlike::InsetFootlike(BufferParams const & bp)
26 : InsetCollapsable(bp)
28 LyXFont font(LyXFont::ALL_SANE);
31 font.setColor(LColor::collapsable);
36 InsetFootlike::InsetFootlike(InsetFootlike const & in)
37 : InsetCollapsable(in)
39 LyXFont font(LyXFont::ALL_SANE);
42 font.setColor(LColor::collapsable);
47 void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
49 LyXFont tmpfont = mi.base.font;
50 mi.base.font = mi.base.bv->buffer()->params().getFont();
51 InsetCollapsable::metrics(mi, dim);
52 mi.base.font = tmpfont;
57 void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
59 LyXFont 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(getInsetName()) << "\n";
69 InsetCollapsable::write(buf, os);
73 bool InsetFootlike::insetAllowed(InsetBase::Code code) const
75 if (code == InsetBase::FOOT_CODE || code == InsetBase::MARGIN_CODE
76 || code == InsetBase::FLOAT_CODE)
78 return InsetCollapsable::insetAllowed(code);