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
41 if (getCmdName() == "tableofcontents")
42 return _("Table of Contents");
43 return _("Unknown toc list");
47 InsetBase::Code InsetTOC::lyxCode() const
49 if (getCmdName() == "tableofcontents")
50 return InsetBase::TOC_CODE;
51 return InsetBase::NO_CODE;
55 int InsetTOC::plaintext(Buffer const & buffer, ostream & os,
56 OutputParams const &) const
58 os << getScreenLabel(buffer) << "\n\n";
60 lyx::toc::asciiTocList(lyx::toc::getType(getCmdName()), buffer, os);
67 int InsetTOC::docbook(Buffer const &, ostream & os,
68 OutputParams const &) const
70 if (getCmdName() == "tableofcontents")