]> git.lyx.org Git - lyx.git/blob - src/insets/InsetTOC.h
e5127d62c38504a2e437b57ce3d2da4bb51670cf
[lyx.git] / src / insets / InsetTOC.h
1 // -*- C++ -*-
2 /**
3  * \file InsetTOC.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_TOC_H
13 #define INSET_TOC_H
14
15 #include "InsetCommand.h"
16
17
18 namespace lyx {
19
20 class Toc;
21
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 {
27 public:
28         ///
29         InsetTOC(Buffer * buf, InsetCommandParams const &);
30
31         /// \name Public functions inherited from Inset class
32         //@{
33         ///
34         InsetCode lyxCode() const { return TOC_CODE; }
35         ///
36         docstring layoutName() const;
37         ///
38         DisplayType display() const { return AlignCenter; }
39         ///
40         virtual void validate(LaTeXFeatures &) const;
41         ///
42         int plaintext(odocstringstream & ods, OutputParams const & op,
43                       size_t max_length = INT_MAX) const;
44         ///
45         int docbook(odocstream &, OutputParams const &) const;
46         ///
47         docstring xhtml(XHTMLStream & xs, OutputParams const &) const;
48         ///
49         void doDispatch(Cursor & cur, FuncRequest & cmd);
50         ///
51         bool clickable(int, int) const { return true; }
52         //@}
53
54         /// \name Static public methods obligated for InsetCommand derived classes
55         //@{
56         ///
57         static ParamInfo const & findInfo(std::string const &);
58         ///
59         static std::string defaultCommand() { return "tableofcontents"; }
60         ///
61         static bool isCompatibleCommand(std::string const & cmd);
62         //@}
63
64 private:
65         ///
66         void makeTOCWithDepth(XHTMLStream xs, Toc toc, const OutputParams & op) const;
67         ///
68         void makeTOCNoDepth(XHTMLStream xs, Toc toc, const OutputParams & op) const;
69         /// \name Private functions inherited from Inset class
70         //@{
71         ///
72         Inset * clone() const { return new InsetTOC(*this); }
73         //@}
74
75         /// \name Private functions inherited from InsetCommand class
76         //@{
77         ///
78         docstring screenLabel() const;
79         //@}
80 };
81
82
83 } // namespace lyx
84
85 #endif