]> git.lyx.org Git - lyx.git/blob - src/insets/insetfoot.C
reformatting and remove using delc
[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
28
29 InsetFoot::InsetFoot()
30         : InsetFootlike()
31 {
32         setLabel(_("foot"));
33         setInsetName("Foot");
34 }
35
36
37 Inset * InsetFoot::Clone(Buffer const &) const
38 {
39         InsetFoot * result = new InsetFoot;
40         result->inset.init(&inset);
41
42         result->collapsed = collapsed;
43         return result;
44 }
45
46
47 string 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 const 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 }