4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
15 #include "InsetCommand.h"
23 /// Used to insert table of contents and similar lists
24 /// at present, supports only \tableofcontents and \listoflistings.
25 /// Other such commands, such as \listoffigures, are supported
26 /// by InsetFloatList.
27 class InsetTOC : public InsetCommand {
30 InsetTOC(Buffer * buf, InsetCommandParams const &);
32 /// \name Public functions inherited from Inset class
35 InsetCode lyxCode() const { return TOC_CODE; }
37 docstring layoutName() const;
39 DisplayType display() const { return AlignCenter; }
41 virtual void validate(LaTeXFeatures &) const;
43 int plaintext(odocstringstream & ods, OutputParams const & op,
44 size_t max_length = INT_MAX) const;
46 int docbook(odocstream &, OutputParams const &) const;
48 docstring xhtml(XHTMLStream & xs, OutputParams const &) const;
50 void doDispatch(Cursor & cur, FuncRequest & cmd);
52 bool clickable(int, int) const { return true; }
55 /// \name Static public methods obligated for InsetCommand derived classes
58 static ParamInfo const & findInfo(std::string const &);
60 static std::string defaultCommand() { return "tableofcontents"; }
62 static bool isCompatibleCommand(std::string const & cmd);
67 void makeTOCWithDepth(XHTMLStream & xs, Toc toc, const OutputParams & op) const;
69 void makeTOCNoDepth(XHTMLStream & xs, Toc toc, const OutputParams & op) const;
71 void makeTOCEntry(XHTMLStream & xs, Paragraph const & par, OutputParams const & op) const;
73 /// \name Private functions inherited from Inset class
76 Inset * clone() const { return new InsetTOC(*this); }
79 /// \name Private functions inherited from InsetCommand class
82 docstring screenLabel() const;