]> git.lyx.org Git - lyx.git/blob - src/insets/InsetIndex.h
Further cleanup of collapsable insets. The layouts are now properly read and applied.
[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 private:
46         ///
47         virtual Inset * clone() const;
48 };
49
50
51 class InsetPrintIndex : public InsetCommand {
52 public:
53         ///
54         InsetPrintIndex(InsetCommandParams const &);
55         /// Updates needed features for this inset.
56         void validate(LaTeXFeatures & features) const;
57         ///
58         EDITABLE editable() const { return NOT_EDITABLE; }
59         ///
60         InsetCode lyxCode() const;
61         ///
62         DisplayType display() const { return AlignCenter; }
63         ///
64         docstring const getScreenLabel(Buffer const &) const;
65         ///
66         static CommandInfo const * findInfo(std::string const & cmdName = "");
67         ///
68         static std::string defaultCommand() { return "printindex"; };
69         ///
70         static bool isCompatibleCommand(std::string const & s) 
71                 { return s == "printindex"; }
72 private:
73         virtual Inset * clone() const {
74                 return new InsetPrintIndex(params());
75         }
76 };
77
78
79 } // namespace lyx
80
81 #endif