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"
30 InsetTOC::InsetTOC(InsetCommandParams const & p)
31 : InsetCommand(p, "toc")
35 ParamInfo const & InsetTOC::findInfo(string const & /* cmdName */)
37 static ParamInfo param_info_;
38 if (param_info_.empty()) {
39 param_info_.add("type", ParamInfo::LATEX_REQUIRED);
45 Inset * InsetTOC::clone() const
47 return new InsetTOC(*this);
51 docstring InsetTOC::screenLabel() const
53 if (getCmdName() == "tableofcontents")
54 return buffer().B_("Table of Contents");
55 return _("Unknown TOC type");
59 int InsetTOC::plaintext(odocstream & os, OutputParams const &) const
61 os << screenLabel() << "\n\n";
62 buffer().tocBackend().writePlaintextTocList(getCmdName(), os);
63 return PLAINTEXT_NEWLINE;
67 int InsetTOC::docbook(odocstream & os, OutputParams const &) const
69 if (getCmdName() == "tableofcontents")