]> git.lyx.org Git - lyx.git/blob - src/insets/insetfoot.C
* insetCollapsable:
[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 using lyx::docstring;
27
28 using std::string;
29 using std::auto_ptr;
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)
42         : InsetFootlike(in)
43 {
44         setLabel(_("foot"));
45         setInsetName("Foot");
46 }
47
48
49 auto_ptr<InsetBase> InsetFoot::doClone() const
50 {
51         return auto_ptr<InsetBase>(new InsetFoot(*this));
52 }
53
54
55 docstring const InsetFoot::editMessage() const
56 {
57         return _("Opened Footnote Inset");
58 }
59
60
61 int InsetFoot::latex(Buffer const & buf, ostream & os,
62                      OutputParams const & runparams_in) const
63 {
64         OutputParams runparams = runparams_in;
65         // footnotes in titling commands like \title have moving arguments
66         runparams.moving_arg |= runparams_in.intitle;
67
68         // in titling commands, \thanks should be used instead of \footnote.
69         // some classes (e.g. memoir) do not understand \footnote.
70         if (runparams_in.intitle)
71                 os << "%\n\\thanks{";
72         else
73                 os << "%\n\\footnote{";
74
75         int const i = InsetText::latex(buf, os, runparams);
76         os << "%\n}";
77
78         return i + 2;
79 }
80
81
82 int InsetFoot::docbook(Buffer const & buf, ostream & os,
83                        OutputParams const & runparams) const
84 {
85         os << "<footnote>";
86         int const i = InsetText::docbook(buf, os, runparams);
87         os << "</footnote>";
88
89         return i;
90 }