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 "support/LOstream.h"
28 InsetFoot::InsetFoot() : InsetCollapsable()
31 LyXFont font(LyXFont::ALL_SANE);
34 font.setColor(LColor::footnote);
36 setAutoCollapse(false);
41 void InsetFoot::Write(Buffer const * buf, ostream & os) const
43 os << getInsetName() << "\n";
44 InsetCollapsable::Write(buf, os);
48 Inset * InsetFoot::Clone() const
50 InsetFoot * result = new InsetFoot;
53 result->collapsed = collapsed;
58 char const * InsetFoot::EditMessage() const
60 return _("Opened Footnote Inset");
64 int InsetFoot::Latex(Buffer const * buf,
65 ostream & os, bool fragile, bool fp) const
67 os << "\\footnote{%\n";
69 int i = InsetText::Latex(buf, os, fragile, fp);
76 bool InsetFoot::InsertInset(BufferView * bv, Inset * inset)
78 if (!InsertInsetAllowed(inset))
81 return InsetText::InsertInset(bv, inset);
85 bool InsetFoot::InsertInsetAllowed(Inset * inset) const
87 if ((inset->LyxCode() == Inset::FOOT_CODE) ||
88 (inset->LyxCode() == Inset::MARGIN_CODE)) {
95 LyXFont InsetFoot::GetDrawFont(BufferView * bv,
96 LyXParagraph * p, int pos) const
98 LyXFont fn = getLyXText(bv)->GetFont(bv->buffer(), p, pos);
99 fn.decSize().decSize();