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 "support/gettext.h"
19 #include "MetricsInfo.h"
20 #include "OutputParams.h"
21 #include "TocBackend.h"
28 InsetTOC::InsetTOC(InsetCommandParams const & p)
29 : InsetCommand(p, "toc")
33 ParamInfo const & InsetTOC::findInfo(string const & /* cmdName */)
35 static ParamInfo param_info_;
36 if (param_info_.empty()) {
37 param_info_.add("type", ParamInfo::LATEX_REQUIRED);
43 docstring InsetTOC::screenLabel() const
45 if (getCmdName() == "tableofcontents")
46 return buffer().B_("Table of Contents");
47 return _("Unknown TOC type");
51 int InsetTOC::plaintext(odocstream & os, OutputParams const &) const
53 os << screenLabel() << "\n\n";
54 buffer().tocBackend().writePlaintextTocList(getCmdName(), os);
55 return PLAINTEXT_NEWLINE;
59 int InsetTOC::docbook(odocstream & os, OutputParams const &) const
61 if (getCmdName() == "tableofcontents")