2 * \file InsetMarginal.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
14 #include "InsetMarginal.h"
17 #include "BufferParams.h"
18 #include "OutputParams.h"
19 #include "TocBackend.h"
21 #include "support/docstream.h"
22 #include "support/gettext.h"
27 InsetMarginal::InsetMarginal(Buffer * buf)
32 int InsetMarginal::plaintext(odocstream & os,
33 OutputParams const & runparams) const
35 os << '[' << buffer().B_("margin") << ":\n";
36 InsetText::plaintext(os, runparams);
39 return PLAINTEXT_NEWLINE + 1; // one char on a separate line
43 int InsetMarginal::docbook(odocstream & os,
44 OutputParams const & runparams) const
46 os << "<note role=\"margin\">";
47 int const i = InsetText::docbook(os, runparams);
54 void InsetMarginal::addToToc(DocIterator const & cpit) const
56 DocIterator pit = cpit;
57 pit.push_back(CursorSlice(const_cast<InsetMarginal &>(*this)));
59 Toc & toc = buffer().tocBackend().toc("marginalnote");
61 text().forToc(str, TOC_ENTRY_LENGTH);
62 toc.push_back(TocItem(pit, 0, str, toolTipText(docstring(), 3, 60)));
63 // Proceed with the rest of the inset.
64 InsetFootlike::addToToc(cpit);