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"
30 InsetTOC::InsetTOC(InsetCommandParams const & p)
31 : InsetCommand(p, "toc")
35 std::auto_ptr<InsetBase> InsetTOC::doClone() const
37 return std::auto_ptr<InsetBase>(new InsetTOC(*this));
41 docstring const InsetTOC::getScreenLabel(Buffer const &) const
43 if (getCmdName() == "tableofcontents")
44 return _("Table of Contents");
45 return _("Unknown toc list");
49 InsetBase::Code InsetTOC::lyxCode() const
51 if (getCmdName() == "tableofcontents")
52 return InsetBase::TOC_CODE;
53 return InsetBase::NO_CODE;
57 int InsetTOC::plaintext(Buffer const & buffer, odocstream & os,
58 OutputParams const &) const
60 os << getScreenLabel(buffer) << "\n\n";
62 toc::asciiTocList(lyx::toc::getType(getCmdName()), buffer, os);
69 int InsetTOC::docbook(Buffer const &, odocstream & os,
70 OutputParams const &) const
72 if (getCmdName() == "tableofcontents")