3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS.
15 #include "dispatchresult.h"
16 #include "funcrequest.h"
18 #include "metricsinfo.h"
21 #include "support/std_ostream.h"
28 InsetTOC::InsetTOC(InsetCommandParams const & p)
29 : InsetCommand(p, "toc")
33 std::auto_ptr<InsetBase> InsetTOC::doClone() const
35 return std::auto_ptr<InsetBase>(new InsetTOC(*this));
39 string const InsetTOC::getScreenLabel(Buffer const &) const
42 if (getCmdName() == "tableofcontents")
43 return lyx::to_utf8(_("Table of Contents"));
44 return lyx::to_utf8(_("Unknown toc list"));
48 InsetBase::Code InsetTOC::lyxCode() const
50 if (getCmdName() == "tableofcontents")
51 return InsetBase::TOC_CODE;
52 return InsetBase::NO_CODE;
56 int InsetTOC::plaintext(Buffer const & buffer, ostream & os,
57 OutputParams const &) const
59 os << getScreenLabel(buffer) << "\n\n";
61 lyx::toc::asciiTocList(lyx::toc::getType(getCmdName()), buffer, os);
68 int InsetTOC::docbook(Buffer const &, ostream & os,
69 OutputParams const &) const
71 if (getCmdName() == "tableofcontents")