]> git.lyx.org Git - lyx.git/blob - src/insets/insetfoot.C
48572075290c4ed113ddf9f6103d317136739c35
[lyx.git] / src / insets / insetfoot.C
1 /* This file is part of
2  * ======================================================
3  * 
4  *           LyX, The Document Processor
5  *       
6  *          Copyright 1998 The LyX Team.
7  *
8  * ======================================================
9  */
10
11 #include <config.h>
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "insetfoot.h"
18 #include "gettext.h"
19 #include "lyxfont.h"
20 #include "BufferView.h"
21 #include "lyxtext.h"
22 #include "insets/insettext.h"
23 #include "support/LOstream.h"
24 #include "debug.h"
25
26 using std::ostream;
27 using std::endl;
28
29
30 InsetFoot::InsetFoot() : InsetFootlike()
31 {
32     setLabel(_("foot"));
33     setInsetName("Foot");
34 }
35
36
37 Inset * InsetFoot::Clone() const
38 {
39     InsetFoot * result = new InsetFoot;
40     result->inset->init(inset);
41
42     result->collapsed = collapsed;
43     return result;
44 }
45
46
47 char const * InsetFoot::EditMessage() const
48 {
49     return _("Opened Footnote Inset");
50 }
51
52
53 int InsetFoot::Latex(Buffer const * buf,
54                      ostream & os, bool fragile, bool fp) const
55 {
56     os << "\\footnote{%\n";
57     
58     int i = inset->Latex(buf, os, fragile, fp);
59     os << "}%\n";
60     
61     return i + 2;
62 }
63
64
65 bool InsetFoot::InsertInsetAllowed(Inset * in) const
66 {
67     if ((in->LyxCode() == Inset::FOOT_CODE) ||
68         (in->LyxCode() == Inset::MARGIN_CODE)) {
69         return false;
70     }
71     return true;
72 }
73
74
75 #if 0
76 LyXFont InsetFoot::GetDrawFont(BufferView * bv,
77                                LyXParagraph * p, int pos) const
78 {
79     LyXFont fn = getLyXText(bv)->GetFont(bv->buffer(), p, pos);
80     fn.decSize().decSize();
81     return fn;
82 }
83 #endif