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