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 "OutputParams.h"
21 #include "TocBackend.h"
23 #include "support/std_ostream.h"
32 InsetTOC::InsetTOC(InsetCommandParams const & p)
33 : InsetCommand(p, "toc")
37 CommandInfo const * InsetTOC::findInfo(std::string const & /* cmdName */)
39 static const char * const paramnames[] = {"type", ""};
40 static const bool isoptional[] = {false};
41 static const CommandInfo info = {1, paramnames, isoptional};
46 Inset * InsetTOC::clone() const
48 return new InsetTOC(*this);
52 docstring const InsetTOC::getScreenLabel(Buffer const & buf) const
54 if (getCmdName() == "tableofcontents")
55 return buf.B_("Table of Contents");
56 return _("Unknown TOC type");
60 int InsetTOC::plaintext(Buffer const & buffer, odocstream & os,
61 OutputParams const &) const
63 os << getScreenLabel(buffer) << "\n\n";
65 buffer.tocBackend().writePlaintextTocList(getCmdName(), os);
67 return PLAINTEXT_NEWLINE;
71 int InsetTOC::docbook(Buffer const &, odocstream & os,
72 OutputParams const &) const
74 if (getCmdName() == "tableofcontents")