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