]> git.lyx.org Git - lyx.git/blob - src/insets/InsetTOC.h
f0f6169e75ab8e814a84226d01190f43653fa71b
[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
21 /// Used to insert table of contents and similar lists
22 /// at present, supports only \tableofcontents and \listoflistings.
23 /// Other such commands, such as \listoffigures, are supported
24 /// by InsetFloatList.
25 class InsetTOC : public InsetCommand {
26 public:
27         ///
28         InsetTOC(Buffer * buf, InsetCommandParams const &);
29
30         /// \name Public functions inherited from Inset class
31         //@{
32         ///
33         InsetCode lyxCode() const { return TOC_CODE; }
34         ///
35         docstring layoutName() const;
36         ///
37         DisplayType display() const { return AlignCenter; }
38         ///
39         virtual void validate(LaTeXFeatures &) const;
40         ///
41         int plaintext(odocstringstream & ods, OutputParams const & op,
42                       size_t max_length = INT_MAX) const;
43         ///
44         int docbook(odocstream &, OutputParams const &) const;
45         ///
46         docstring xhtml(XHTMLStream & xs, OutputParams const &) const;
47         ///
48         void doDispatch(Cursor & cur, FuncRequest & cmd);
49         ///
50         bool clickable(int, int) const { return true; }
51         //@}
52
53         /// \name Static public methods obligated for InsetCommand derived classes
54         //@{
55         ///
56         static ParamInfo const & findInfo(std::string const &);
57         ///
58         static std::string defaultCommand() { return "tableofcontents"; }
59         ///
60         static bool isCompatibleCommand(std::string const & cmd);
61         //@}
62
63 private:
64         /// \name Private functions inherited from Inset class
65         //@{
66         ///
67         Inset * clone() const { return new InsetTOC(*this); }
68         //@}
69
70         /// \name Private functions inherited from InsetCommand class
71         //@{
72         ///
73         docstring screenLabel() const;
74         //@}
75 };
76
77
78 } // namespace lyx
79
80 #endif