]> git.lyx.org Git - lyx.git/blob - src/insets/insetmarginal.C
Change editMessage to return a docstring, change functions to not use to_utf8.
[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 using lyx::docstring;
22
23 using std::string;
24 using std::auto_ptr;
25 using std::ostream;
26
27
28 InsetMarginal::InsetMarginal(BufferParams const & bp)
29         : InsetFootlike(bp)
30 {
31         // FIXME UNICODE
32         setLabel(lyx::to_utf8(_("margin")));
33         setInsetName("Marginal");
34 }
35
36
37 InsetMarginal::InsetMarginal(InsetMarginal const & in)
38         : InsetFootlike(in)
39 {
40         // FIXME UNICODE
41         setLabel(lyx::to_utf8(_("margin")));
42         setInsetName("Marginal");
43 }
44
45
46 auto_ptr<InsetBase> InsetMarginal::doClone() const
47 {
48         return auto_ptr<InsetBase>(new InsetMarginal(*this));
49 }
50
51
52 docstring const InsetMarginal::editMessage() const
53 {
54         return _("Opened Marginal Note Inset");
55 }
56
57
58 int InsetMarginal::latex(Buffer const & buf, ostream & os,
59                          OutputParams const & runparams) const
60 {
61         os << "%\n\\marginpar{";
62         int const i = InsetText::latex(buf, os, runparams);
63         os << "%\n}";
64         return i + 2;
65 }
66
67 int InsetMarginal::docbook(Buffer const & buf, ostream & os,
68                        OutputParams const & runparams) const
69 {
70         os << "<note role=\"margin\">";
71         int const i = InsetText::docbook(buf, os, runparams);
72         os << "</note>";
73
74         return i;
75 }