]> git.lyx.org Git - lyx.git/blob - src/insets/InsetMarginal.cpp
* InsetCollapsable:
[lyx.git] / src / insets / InsetMarginal.cpp
1 /**
2  * \file InsetMarginal.cpp
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 "Buffer.h"
17 #include "gettext.h"
18 #include "OutputParams.h"
19
20 #include "support/std_ostream.h"
21
22
23 namespace lyx {
24
25
26 InsetMarginal::InsetMarginal(BufferParams const & bp)
27         : InsetFootlike(bp)
28 {}
29
30
31 InsetMarginal::InsetMarginal(InsetMarginal const & in)
32         : InsetFootlike(in)
33 {}
34
35
36 Inset * InsetMarginal::clone() const
37 {
38         return new InsetMarginal(*this);
39 }
40
41
42 docstring const InsetMarginal::editMessage() const
43 {
44         return _("Opened Marginal Note Inset");
45 }
46
47
48 int InsetMarginal::latex(Buffer const & buf, odocstream & os,
49                          OutputParams const & runparams) const
50 {
51         os << "%\n\\marginpar{";
52         int const i = InsetText::latex(buf, os, runparams);
53         os << "%\n}";
54         return i + 2;
55 }
56
57
58 int InsetMarginal::plaintext(Buffer const & buf, odocstream & os,
59                              OutputParams const & runparams) const
60 {
61         os << '[' << buf.B_("margin") << ":\n";
62         InsetText::plaintext(buf, os, runparams);
63         os << "\n]";
64
65         return PLAINTEXT_NEWLINE + 1; // one char on a separate line
66 }
67
68
69 int InsetMarginal::docbook(Buffer const & buf, odocstream & os,
70                            OutputParams const & runparams) const
71 {
72         os << "<note role=\"margin\">";
73         int const i = InsetText::docbook(buf, os, runparams);
74         os << "</note>";
75
76         return i;
77 }
78
79
80 } // namespace lyx