]> git.lyx.org Git - features.git/blob - src/insets/InsetIndex.h
664a47db2de2f79a8de721c33252e57266ed45eb
[features.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(Font &) 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         ///
53         static CommandInfo const * findInfo(std::string const & cmdName = "");
54         ///
55         static std::string defaultCommand() { return "index"; };
56         ///
57         static bool isCompatibleCommand(std::string const & s) 
58                 { return s == "index"; }
59 private:
60         ///
61         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
62         ///
63         virtual Inset * clone() const;
64 };
65
66
67 class InsetPrintIndex : public InsetCommand {
68 public:
69         ///
70         InsetPrintIndex(InsetCommandParams const &);
71         /// Updates needed features for this inset.
72         void validate(LaTeXFeatures & features) const;
73         ///
74         EDITABLE editable() const { return NOT_EDITABLE; }
75         ///
76         InsetCode lyxCode() const;
77         ///
78         DisplayType display() const { return AlignCenter; }
79         ///
80         docstring const getScreenLabel(Buffer const &) const;
81         ///
82         static CommandInfo const * findInfo(std::string const & cmdName = "");
83         ///
84         static std::string defaultCommand() { return "printindex"; };
85         ///
86         static bool isCompatibleCommand(std::string const & s) 
87                 { return s == "printindex"; }
88 private:
89         virtual Inset * clone() const {
90                 return new InsetPrintIndex(params());
91         }
92 };
93
94
95 } // namespace lyx
96
97 #endif