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.
16 #include "dispatchresult.h"
17 #include "funcrequest.h"
19 #include "metricsinfo.h"
20 #include "TocBackend.h"
22 #include "support/std_ostream.h"
31 InsetTOC::InsetTOC(InsetCommandParams const & p)
32 : InsetCommand(p, "toc")
36 std::auto_ptr<InsetBase> InsetTOC::doClone() const
38 return std::auto_ptr<InsetBase>(new InsetTOC(*this));
42 docstring const InsetTOC::getScreenLabel(Buffer const &) const
44 if (getCmdName() == "tableofcontents")
45 return _("Table of Contents");
46 return _("Unknown toc list");
50 InsetBase::Code InsetTOC::lyxCode() const
52 if (getCmdName() == "tableofcontents")
53 return InsetBase::TOC_CODE;
54 return InsetBase::NO_CODE;
58 int InsetTOC::plaintext(Buffer const & buffer, odocstream & os,
59 OutputParams const &) const
61 os << getScreenLabel(buffer) << "\n\n";
63 buffer.tocBackend().asciiTocList(getCmdName(), os);
70 int InsetTOC::docbook(Buffer const &, odocstream & os,
71 OutputParams const &) const
73 if (getCmdName() == "tableofcontents")