]> git.lyx.org Git - lyx.git/blob - src/insets/insetfoot.C
Rename ascii to plaintext and LatexRunParams to OutputParams.
[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 // the following are needed just to get the layout of the enclosing
18 // paragraph. This seems a bit too much to me (JMarc)
19 #include "lyxlayout.h"
20 #include "outputparams.h"
21 #include "paragraph.h"
22 #include "paragraph_funcs.h"
23
24 #include "support/std_ostream.h"
25
26
27 using std::string;
28 using std::auto_ptr;
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)
41         : InsetFootlike(in)
42 {
43         setLabel(_("foot"));
44         setInsetName("Foot");
45 }
46
47
48 auto_ptr<InsetBase> InsetFoot::clone() const
49 {
50         return auto_ptr<InsetBase>(new InsetFoot(*this));
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,
61                      OutputParams const & runparams_in) const
62 {
63         OutputParams runparams = runparams_in;
64         runparams.moving_arg |= ownerPar(buf, this).layout()->intitle;
65
66         os << "%\n\\footnote{";
67
68         int const i = inset.latex(buf, os, runparams);
69         os << "%\n}";
70
71         return i + 2;
72 }
73
74
75 int InsetFoot::docbook(Buffer const & buf, ostream & os,
76                        OutputParams const & runparams) const
77 {
78         os << "<footnote>";
79         int const i = inset.docbook(buf, os, runparams);
80         os << "</footnote>";
81
82         return i;
83 }