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