1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1998 The LyX Team.
8 *======================================================*/
13 #pragma implementation
16 #include "insetfoot.h"
19 #include "BufferView.h"
22 #include "support/LOstream.h"
27 InsetFoot::InsetFoot() : InsetCollapsable()
30 LyXFont font(LyXFont::ALL_SANE);
33 font.setColor(LColor::footnote);
35 setAutoCollapse(false);
40 void InsetFoot::Write(Buffer const * buf, ostream & os) const
42 os << getInsetName() << "\n";
43 InsetCollapsable::Write(buf, os);
47 Inset * InsetFoot::Clone() const
49 InsetFoot * result = new InsetFoot;
52 result->collapsed = collapsed;
57 char const * InsetFoot::EditMessage() const
59 return _("Opened Footnote Inset");
63 int InsetFoot::Latex(Buffer const * buf, ostream & os, bool fragile, bool fp) const
65 os << "\\footnote{%\n";
67 int i = InsetText::Latex(buf, os, fragile, fp);
74 bool InsetFoot::InsertInset(BufferView * bv, Inset * inset)
76 if (!InsertInsetAllowed(inset))
79 return InsetText::InsertInset(bv, inset);
83 bool InsetFoot::InsertInsetAllowed(Inset * inset) const
85 if ((inset->LyxCode() == Inset::FOOT_CODE) ||
86 (inset->LyxCode() == Inset::MARGIN_CODE)) {
93 LyXFont InsetFoot::GetDrawFont(BufferView * bv,LyXParagraph * p, int pos) const
95 LyXFont fn = getLyXText(bv)->GetFont(bv->buffer(), p, pos);
96 fn.decSize().decSize();