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"
20 #include "lyxscreen.h"
22 #include "support/LOstream.h"
26 InsetFoot::InsetFoot(Buffer * bf)
27 : InsetCollapsable(bf)
30 LyXFont font(LyXFont::ALL_SANE);
33 font.setColor(LColor::footnote);
35 setAutoCollapse(false);
39 Inset * InsetFoot::Clone() const
41 InsetFoot * result = new InsetFoot(buffer);
42 result->init(buffer, this);
44 result->collapsed = collapsed;
49 char const * InsetFoot::EditMessage() const
51 return _("Opened Footnote Inset");
55 int InsetFoot::Latex(ostream & os, signed char fragile, bool fp) const
58 os << "\\footnote{"; // was footnotemark but that won't work
62 int i = InsetText::Latex(os, fragile, fp);
69 void InsetFoot::Write(ostream & os) const
77 WriteParagraphData(os);
81 void InsetFoot::Read(LyXLex & lex)
85 string token = lex.GetString();
86 if (token == "collapsed") {
88 collapsed = lex.GetBool();
95 bool InsetFoot::InsertInset(BufferView * bv, Inset * inset)
97 if (!InsertInsetAllowed(inset))
100 return InsetText::InsertInset(bv, inset);
103 bool InsetFoot::InsertInsetAllowed(Inset * inset) const
105 if ((inset->LyxCode() == Inset::FOOT_CODE) ||
106 (inset->LyxCode() == Inset::MARGIN_CODE)) {
112 LyXFont InsetFoot::GetDrawFont(LyXParagraph * par, int pos) const
114 LyXFont fn = InsetCollapsable::GetDrawFont(par, pos);