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 "BufferParams.h"
18 #include "OutputParams.h"
19 #include "TocBackend.h"
20 
21 #include "support/docstream.h"
22 #include "support/gettext.h"
23 #include "support/lstrings.h"
24 
25 namespace lyx {
26 
27 
InsetMarginal(Buffer * buf)28 InsetMarginal::InsetMarginal(Buffer * buf)
29 	: InsetFootlike(buf)
30 {}
31 
32 
plaintext(odocstringstream & os,OutputParams const & runparams,size_t max_length) const33 int InsetMarginal::plaintext(odocstringstream & os,
34 			     OutputParams const & runparams, size_t max_length) const
35 {
36 	os << '[' << buffer().B_("margin") << ":\n";
37 	InsetText::plaintext(os, runparams, max_length);
38 	os << "\n]";
39 
40 	return PLAINTEXT_NEWLINE + 1; // one char on a separate line
41 }
42 
43 
docbook(odocstream & os,OutputParams const & runparams) const44 int InsetMarginal::docbook(odocstream & os,
45 			   OutputParams const & runparams) const
46 {
47 	os << "<note role=\"margin\">";
48 	int const i = InsetText::docbook(os, runparams);
49 	os << "</note>";
50 
51 	return i;
52 }
53 
54 
55 } // namespace lyx
56