#include "InsetMarginal.h"
-#include "gettext.h"
-#include "paragraph.h"
-#include "outputparams.h"
+#include "Buffer.h"
+#include "OutputParams.h"
+#include "TocBackend.h"
-#include "support/std_ostream.h"
+#include "support/gettext.h"
+#include <ostream>
-namespace lyx {
-using std::string;
-using std::auto_ptr;
-using std::ostream;
+namespace lyx {
InsetMarginal::InsetMarginal(BufferParams const & bp)
: InsetFootlike(bp)
-{
- setLabel(_("margin"));
- setInsetName(from_ascii("Marginal"));
-}
+{}
InsetMarginal::InsetMarginal(InsetMarginal const & in)
: InsetFootlike(in)
-{
- setLabel(_("margin"));
- setInsetName(from_ascii("Marginal"));
-}
+{}
-auto_ptr<InsetBase> InsetMarginal::doClone() const
+Inset * InsetMarginal::clone() const
{
- return auto_ptr<InsetBase>(new InsetMarginal(*this));
+ return new InsetMarginal(*this);
}
int InsetMarginal::latex(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
os << "%\n\\marginpar{";
int const i = InsetText::latex(buf, os, runparams);
int InsetMarginal::plaintext(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
- os << '[' << _("margin") << ":\n";
+ os << '[' << buf.B_("margin") << ":\n";
InsetText::plaintext(buf, os, runparams);
os << "\n]";
int InsetMarginal::docbook(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
os << "<note role=\"margin\">";
int const i = InsetText::docbook(buf, os, runparams);
}
+void InsetMarginal::addToToc(Buffer const & buf,
+ ParConstIterator const & cpit) const
+{
+ ParConstIterator pit = cpit;
+ pit.push_back(*this);
+
+ Toc & toc = buf.tocBackend().toc("marginalnote");
+ docstring str;
+ str = getNewLabel(str);
+ toc.push_back(TocItem(pit, 0, str));
+}
+
} // namespace lyx