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"
22 /// Used to insert table of contents and similar lists
23 /// at present, supports only \tableofcontents and \listoflistings.
24 /// Other such commands, such as \listoffigures, are supported
25 /// by InsetFloatList.
26 class InsetTOC : public InsetCommand {
29 InsetTOC(Buffer * buf, InsetCommandParams const &);
31 /// \name Public functions inherited from Inset class
34 InsetCode lyxCode() const { return TOC_CODE; }
36 docstring layoutName() const;
38 DisplayType display() const { return AlignCenter; }
40 virtual void validate(LaTeXFeatures &) const;
42 int plaintext(odocstringstream & ods, OutputParams const & op,
43 size_t max_length = INT_MAX) const;
45 int docbook(odocstream &, OutputParams const &) const;
47 docstring xhtml(XHTMLStream & xs, OutputParams const &) const;
49 void doDispatch(Cursor & cur, FuncRequest & cmd);
51 bool clickable(int, int) const { return true; }
54 /// \name Static public methods obligated for InsetCommand derived classes
57 static ParamInfo const & findInfo(std::string const &);
59 static std::string defaultCommand() { return "tableofcontents"; }
61 static bool isCompatibleCommand(std::string const & cmd);
66 void makeTOCWithDepth(XHTMLStream xs, Toc toc, const OutputParams & op) const;
68 void makeTOCNoDepth(XHTMLStream xs, Toc toc, const OutputParams & op) const;
69 /// \name Private functions inherited from Inset class
72 Inset * clone() const { return new InsetTOC(*this); }
75 /// \name Private functions inherited from InsetCommand class
78 docstring screenLabel() const;