]> git.lyx.org Git - lyx.git/blob - src/insets/insetfoot.C
Pass struct LatexRunParams around a bit...
[lyx.git] / src / insets / insetfoot.C
1 /**
2  * \file insetfoot.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Jürgen Vigna
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #include <config.h>
13
14 #include "insetfoot.h"
15 #include "gettext.h"
16 #include "lyxfont.h"
17 #include "BufferView.h"
18 #include "lyxtext.h"
19 #include "insets/insettext.h"
20 #include "support/LOstream.h"
21 #include "debug.h"
22 // the following are needed just to get the layout of the enclosing
23 // paragraph. This seems a bit too much to me (JMarc)
24 #include "lyxlayout.h"
25 #include "buffer.h"
26 #include "paragraph.h"
27
28
29 using std::ostream;
30
31
32 InsetFoot::InsetFoot(BufferParams const & bp)
33         : InsetFootlike(bp)
34 {
35         setLabel(_("foot"));
36         setInsetName("Foot");
37 }
38
39
40 InsetFoot::InsetFoot(InsetFoot const & in, bool same_id)
41         : InsetFootlike(in, same_id)
42 {
43         setLabel(_("foot"));
44         setInsetName("Foot");
45 }
46
47
48 Inset * InsetFoot::clone(Buffer const &, bool same_id) const
49 {
50         return new InsetFoot(*const_cast<InsetFoot *>(this), same_id);
51 }
52
53
54 string const InsetFoot::editMessage() const
55 {
56         return _("Opened Footnote Inset");
57 }
58
59
60 int InsetFoot::latex(Buffer const * buf, ostream & os, LatexRunParams const & runparams,
61                      bool fragile, bool fp) const
62 {
63         if (buf && parOwner()) {
64                 LyXLayout_ptr const & layout = parOwner()->layout();
65                 fragile |= layout->intitle;
66         }
67
68         os << "%\n\\footnote{";
69
70         int const i = inset.latex(buf, os, runparams, fragile, fp);
71         os << "%\n}";
72
73         return i + 2;
74 }
75
76
77 int InsetFoot::docbook(Buffer const * buf, ostream & os, bool mixcont) const
78 {
79         os << "<footnote>";
80         int const i = inset.docbook(buf, os, mixcont);
81         os << "</footnote>";
82
83         return i;
84 }