]> git.lyx.org Git - lyx.git/blob - src/insets/insetfoot.C
Replace LString.h with support/std_string.h,
[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_funcs.h"
22
23 #include "support/std_ostream.h"
24
25 using std::auto_ptr;
26 using std::ostream;
27
28
29 InsetFoot::InsetFoot(BufferParams const & bp)
30         : InsetFootlike(bp)
31 {
32         setLabel(_("foot"));
33         setInsetName("Foot");
34 }
35
36
37 InsetFoot::InsetFoot(InsetFoot const & in)
38         : InsetFootlike(in)
39 {
40         setLabel(_("foot"));
41         setInsetName("Foot");
42 }
43
44
45 auto_ptr<InsetBase> InsetFoot::clone() const
46 {
47         return auto_ptr<InsetBase>(new InsetFoot(*this));
48 }
49
50
51 string const InsetFoot::editMessage() const
52 {
53         return _("Opened Footnote Inset");
54 }
55
56
57 int InsetFoot::latex(Buffer const & buf, ostream & os,
58                      LatexRunParams const & runparams_in) const
59 {
60         LatexRunParams runparams = runparams_in;
61         runparams.moving_arg |= ownerPar(buf, this).layout()->intitle;
62
63         os << "%\n\\footnote{";
64
65         int const i = inset.latex(buf, os, runparams);
66         os << "%\n}";
67
68         return i + 2;
69 }
70
71
72 int InsetFoot::docbook(Buffer const & buf, ostream & os, bool mixcont) const
73 {
74         os << "<footnote>";
75         int const i = inset.docbook(buf, os, mixcont);
76         os << "</footnote>";
77
78         return i;
79 }