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 CommandInfo const * InsetTOC::findInfo(string const & /* cmdName */)
37 static const char * const paramnames[] = {"type", ""};
38 static const bool isoptional[] = {false};
39 static const CommandInfo info = {1, paramnames, isoptional};
44 Inset * InsetTOC::clone() const
46 return new InsetTOC(*this);
50 docstring const InsetTOC::getScreenLabel(Buffer const & buf) const
52 if (getCmdName() == "tableofcontents")
53 return buf.B_("Table of Contents");
54 return _("Unknown TOC type");
58 int InsetTOC::plaintext(Buffer const & buffer, odocstream & os,
59 OutputParams const &) const
61 os << getScreenLabel(buffer) << "\n\n";
63 buffer.tocBackend().writePlaintextTocList(getCmdName(), os);
65 return PLAINTEXT_NEWLINE;
69 int InsetTOC::docbook(Buffer const &, odocstream & os,
70 OutputParams const &) const
72 if (getCmdName() == "tableofcontents")