]> git.lyx.org Git - lyx.git/blob - src/insets/insetfoot.C
remove noload/don't typeset
[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 // the following are needed just to get the layout of the enclosing
26 // paragraph. This seems a bit too much to me (JMarc)
27 #include "lyxlayout.h"
28 #include "buffer.h"
29 #include "paragraph.h"
30
31
32 using std::ostream;
33
34
35 InsetFoot::InsetFoot(BufferParams const & bp)
36         : InsetFootlike(bp)
37 {
38         setLabel(_("foot"));
39         setInsetName("Foot");
40 }
41
42
43 InsetFoot::InsetFoot(InsetFoot const & in, bool same_id)
44         : InsetFootlike(in, same_id)
45 {
46         setLabel(_("foot"));
47         setInsetName("Foot");
48 }
49
50
51 Inset * InsetFoot::clone(Buffer const &, bool same_id) const
52 {
53         return new InsetFoot(*const_cast<InsetFoot *>(this), same_id);
54 }
55
56
57 string const InsetFoot::editMessage() const
58 {
59         return _("Opened Footnote Inset");
60 }
61
62
63 int InsetFoot::latex(Buffer const * buf,
64                      ostream & os, bool fragile, bool fp) const
65 {
66         if (buf && parOwner()) {
67                 LyXLayout_ptr const & layout = parOwner()->layout();
68                 fragile |= layout->intitle;
69         }
70
71         os << "%\n\\footnote{";
72
73         int const i = inset.latex(buf, os, fragile, fp);
74         os << "%\n}";
75
76         return i + 2;
77 }
78
79
80 int InsetFoot::docbook(Buffer const * buf, ostream & os, bool mixcont) const
81 {
82         os << "<footnote>";
83         int const i = inset.docbook(buf, os, mixcont);
84         os << "</footnote>";
85
86         return i;
87 }