]> git.lyx.org Git - lyx.git/blob - src/insets/insetfoot.C
use the new sstream return non-pods as const, use string instead of char * in a lot...
[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()
31         : InsetFootlike()
32 {
33     setLabel(_("foot"));
34     setInsetName("Foot");
35 }
36
37
38 Inset * InsetFoot::Clone() const
39 {
40     InsetFoot * result = new InsetFoot;
41     result->inset->init(inset);
42
43     result->collapsed = collapsed;
44     return result;
45 }
46
47
48 string const InsetFoot::EditMessage() const
49 {
50     return _("Opened Footnote Inset");
51 }
52
53
54 int InsetFoot::Latex(Buffer const * buf,
55                      ostream & os, bool fragile, bool fp) const
56 {
57     os << "\\footnote{%\n";
58     
59     int i = inset->Latex(buf, os, fragile, fp);
60     os << "}%\n";
61     
62     return i + 2;
63 }
64
65
66 bool InsetFoot::InsertInsetAllowed(Inset * in) const
67 {
68     if ((in->LyxCode() == Inset::FOOT_CODE) ||
69         (in->LyxCode() == Inset::MARGIN_CODE)) {
70         return false;
71     }
72     return true;
73 }