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"
18 #include "MetricsInfo.h"
19 #include "OutputParams.h"
20 #include "TocBackend.h"
22 #include "support/gettext.h"
31 InsetTOC::InsetTOC(InsetCommandParams const & p)
32 : InsetCommand(p, "toc")
36 ParamInfo const & InsetTOC::findInfo(string const & /* cmdName */)
38 static ParamInfo param_info_;
39 if (param_info_.empty()) {
40 param_info_.add("type", ParamInfo::LATEX_REQUIRED);
46 docstring InsetTOC::screenLabel() const
48 if (getCmdName() == "tableofcontents")
49 return buffer().B_("Table of Contents");
50 return _("Unknown TOC type");
54 int InsetTOC::plaintext(odocstream & os, OutputParams const &) const
56 os << screenLabel() << "\n\n";
57 buffer().tocBackend().writePlaintextTocList(getCmdName(), os);
58 return PLAINTEXT_NEWLINE;
62 int InsetTOC::docbook(odocstream & os, OutputParams const &) const
64 if (getCmdName() == "tableofcontents")