]> git.lyx.org Git - lyx.git/blob - src/insets/InsetTOC.h
Get rid of Qt resources
[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 #include "Toc.h"
18
19
20 namespace lyx {
21
22 class Paragraph;
23
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 {
29 public:
30         ///
31         InsetTOC(Buffer * buf, InsetCommandParams const &);
32
33         /// \name Public functions inherited from Inset class
34         //@{
35         ///
36         InsetCode lyxCode() const { return TOC_CODE; }
37         ///
38         docstring layoutName() const;
39         ///
40         DisplayType display() const { return AlignCenter; }
41         ///
42         virtual void validate(LaTeXFeatures &) const;
43         ///
44         int plaintext(odocstringstream & ods, OutputParams const & op,
45                       size_t max_length = INT_MAX) const;
46         ///
47         int docbook(odocstream &, OutputParams const &) const;
48         ///
49         docstring xhtml(XHTMLStream & xs, OutputParams const &) const;
50         ///
51         void doDispatch(Cursor & cur, FuncRequest & cmd);
52         ///
53         bool clickable(BufferView const &, int, int) const { return true; }
54         //@}
55
56         /// \name Static public methods obligated for InsetCommand derived classes
57         //@{
58         ///
59         static ParamInfo const & findInfo(std::string const &);
60         ///
61         static std::string defaultCommand() { return "tableofcontents"; }
62         ///
63         static bool isCompatibleCommand(std::string const & cmd);
64         //@}
65
66 private:
67         ///
68         void makeTOCWithDepth(XHTMLStream & xs, Toc const & toc, const OutputParams & op) const;
69         ///
70         void makeTOCNoDepth(XHTMLStream & xs, Toc const & toc, const OutputParams & op) const;
71         ///
72         void makeTOCEntry(XHTMLStream & xs, Paragraph const & par, OutputParams const & op) const;
73
74         /// \name Private functions inherited from Inset class
75         //@{
76         ///
77         Inset * clone() const { return new InsetTOC(*this); }
78         //@}
79
80         /// \name Private functions inherited from InsetCommand class
81         //@{
82         ///
83         docstring screenLabel() const;
84         //@}
85 };
86
87
88 } // namespace lyx
89
90 #endif