]> git.lyx.org Git - lyx.git/blob - src/insets/InsetIndex.h
This should be the last of the commits refactoring the InsetLayout code.
[lyx.git] / src / insets / InsetIndex.h
1 // -*- C++ -*-
2 /**
3  * \file InsetIndex.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_INDEX_H
13 #define INSET_INDEX_H
14
15
16 #include "InsetCollapsable.h"
17 #include "InsetCommand.h"
18
19
20 namespace lyx {
21
22 class LaTeXFeatures;
23
24 /** Used to insert index labels
25   */
26 class InsetIndex : public InsetCollapsable {
27 public:
28         ///
29         InsetIndex(BufferParams const &);
30         ///
31         InsetIndex(InsetIndex const &);
32         ///
33         EDITABLE editable() const { return IS_EDITABLE; }
34         ///
35         InsetCode lyxCode() const { return INDEX_CODE; }
36         ///
37         docstring name() const { return from_ascii("Index"); }
38         ///
39         void write(Buffer const & buf, std::ostream & os) const;
40         ///
41         int docbook(Buffer const &, odocstream &,
42                     OutputParams const &) const;
43         /// should paragraph indendation be omitted in any case?
44         bool neverIndent(Buffer const &) const { return true; }
45         ///
46         void addToToc(Buffer const &, ParConstIterator const &) const;
47 private:
48         ///
49         virtual Inset * clone() const;
50 };
51
52
53 class InsetPrintIndex : public InsetCommand {
54 public:
55         ///
56         InsetPrintIndex(InsetCommandParams const &);
57         /// Updates needed features for this inset.
58         void validate(LaTeXFeatures & features) const;
59         ///
60         EDITABLE editable() const { return NOT_EDITABLE; }
61         ///
62         InsetCode lyxCode() const;
63         ///
64         DisplayType display() const { return AlignCenter; }
65         ///
66         docstring const getScreenLabel(Buffer const &) const;
67         ///
68         static CommandInfo const * findInfo(std::string const & cmdName = "");
69         ///
70         static std::string defaultCommand() { return "printindex"; };
71         ///
72         static bool isCompatibleCommand(std::string const & s) 
73                 { return s == "printindex"; }
74 private:
75         virtual Inset * clone() const {
76                 return new InsetPrintIndex(params());
77         }
78 };
79
80
81 } // namespace lyx
82
83 #endif