]> git.lyx.org Git - lyx.git/blob - src/insets/insetmarginal.C
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetmarginal.C
1 /**
2  * \file insetmarginal.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 "insetmarginal.h"
15
16 #include "gettext.h"
17 #include "paragraph.h"
18
19 #include "support/std_ostream.h"
20
21
22 namespace lyx {
23
24 using std::string;
25 using std::auto_ptr;
26 using std::ostream;
27
28
29 InsetMarginal::InsetMarginal(BufferParams const & bp)
30         : InsetFootlike(bp)
31 {
32         setLabel(_("margin"));
33         setInsetName(from_ascii("Marginal"));
34 }
35
36
37 InsetMarginal::InsetMarginal(InsetMarginal const & in)
38         : InsetFootlike(in)
39 {
40         setLabel(_("margin"));
41         setInsetName(from_ascii("Marginal"));
42 }
43
44
45 auto_ptr<InsetBase> InsetMarginal::doClone() const
46 {
47         return auto_ptr<InsetBase>(new InsetMarginal(*this));
48 }
49
50
51 docstring const InsetMarginal::editMessage() const
52 {
53         return _("Opened Marginal Note Inset");
54 }
55
56
57 int InsetMarginal::latex(Buffer const & buf, odocstream & os,
58                          OutputParams const & runparams) const
59 {
60         os << "%\n\\marginpar{";
61         int const i = InsetText::latex(buf, os, runparams);
62         os << "%\n}";
63         return i + 2;
64 }
65
66 int InsetMarginal::docbook(Buffer const & buf, odocstream & os,
67                        OutputParams const & runparams) const
68 {
69         os << "<note role=\"margin\">";
70         int const i = InsetText::docbook(buf, os, runparams);
71         os << "</note>";
72
73         return i;
74 }
75
76
77 } // namespace lyx