]> git.lyx.org Git - lyx.git/blob - src/insets/insetfoot.C
The speed patch: redraw only rows that have changed
[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::doClone() 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         // footnotes in titling commands like \title have moving arguments
65         runparams.moving_arg |= runparams_in.intitle;
66
67         // in titling commands, \thanks should be used instead of \footnote.
68         // some classes (e.g. memoir) do not understand \footnote.
69         if (runparams_in.intitle)
70                 os << "%\n\\thanks{";
71         else
72                 os << "%\n\\footnote{";
73
74         int const i = InsetText::latex(buf, os, runparams);
75         os << "%\n}";
76
77         return i + 2;
78 }
79
80
81 int InsetFoot::docbook(Buffer const & buf, ostream & os,
82                        OutputParams const & runparams) const
83 {
84         os << "<footnote>";
85         int const i = InsetText::docbook(buf, os, runparams);
86         os << "</footnote>";
87
88         return i;
89 }