]> git.lyx.org Git - lyx.git/blob - src/insets/InsetIndex.h
8ffab82b9c8ac77a73a56e00790abf05ed01cd19
[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         ///
38         void metrics(MetricsInfo &, Dimension &) const;
39         ///
40         void draw(PainterInfo &, int, int) const;
41         ///
42         docstring name() const { return from_ascii("Index"); }
43         ///
44         void getDrawFont(FontInfo &) const;
45         ///
46         void write(Buffer const & buf, std::ostream & os) const;
47         ///
48         int docbook(Buffer const &, odocstream &,
49                     OutputParams const &) const;
50         /// should paragraph indendation be omitted in any case?
51         bool neverIndent(Buffer const &) const { return true; }
52 private:
53         ///
54         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
55         ///
56         virtual Inset * clone() const;
57 };
58
59
60 class InsetPrintIndex : public InsetCommand {
61 public:
62         ///
63         InsetPrintIndex(InsetCommandParams const &);
64         /// Updates needed features for this inset.
65         void validate(LaTeXFeatures & features) const;
66         ///
67         EDITABLE editable() const { return NOT_EDITABLE; }
68         ///
69         InsetCode lyxCode() const;
70         ///
71         DisplayType display() const { return AlignCenter; }
72         ///
73         docstring const getScreenLabel(Buffer const &) const;
74         ///
75         static CommandInfo const * findInfo(std::string const & cmdName = "");
76         ///
77         static std::string defaultCommand() { return "printindex"; };
78         ///
79         static bool isCompatibleCommand(std::string const & s) 
80                 { return s == "printindex"; }
81 private:
82         virtual Inset * clone() const {
83                 return new InsetPrintIndex(params());
84         }
85 };
86
87
88 } // namespace lyx
89
90 #endif