1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1998 The LyX Team.
8 * ======================================================
14 #pragma implementation
17 #include "insetfoot.h"
20 #include "BufferView.h"
23 #include "insets/insettext.h"
24 #include "support/LOstream.h"
29 InsetFoot::InsetFoot() : InsetCollapsable()
32 LyXFont font(LyXFont::ALL_SANE);
35 font.setColor(LColor::footnote);
37 setAutoCollapse(false);
42 void InsetFoot::Write(Buffer const * buf, ostream & os) const
44 os << getInsetName() << "\n";
45 InsetCollapsable::Write(buf, os);
49 Inset * InsetFoot::Clone() const
51 InsetFoot * result = new InsetFoot;
52 result->inset->init(inset);
54 result->collapsed = collapsed;
59 char const * InsetFoot::EditMessage() const
61 return _("Opened Footnote Inset");
65 int InsetFoot::Latex(Buffer const * buf,
66 ostream & os, bool fragile, bool fp) const
68 os << "\\footnote{%\n";
70 int i = inset->Latex(buf, os, fragile, fp);
77 bool InsetFoot::InsertInset(BufferView * bv, Inset * in)
79 if (!InsertInsetAllowed(in))
82 return inset->InsertInset(bv, in);
86 bool InsetFoot::InsertInsetAllowed(Inset * in) const
88 if ((in->LyxCode() == Inset::FOOT_CODE) ||
89 (in->LyxCode() == Inset::MARGIN_CODE)) {
96 LyXFont InsetFoot::GetDrawFont(BufferView * bv,
97 LyXParagraph * p, int pos) const
99 LyXFont fn = getLyXText(bv)->GetFont(bv->buffer(), p, pos);
100 fn.decSize().decSize();