]> git.lyx.org Git - lyx.git/blob - src/insets/InsetIndex.h
c3c5fb7a7ef0662ad722cffe3713909cba8e74fd
[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;
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 private:
54         ///
55         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
56         ///
57         virtual Inset * clone() const;
58 };
59
60
61 class InsetPrintIndex : public InsetCommand {
62 public:
63         ///
64         InsetPrintIndex(InsetCommandParams const &);
65         /// Updates needed features for this inset.
66         void validate(LaTeXFeatures & features) const;
67         ///
68         EDITABLE editable() const { return NOT_EDITABLE; }
69         ///
70         InsetCode lyxCode() const;
71         ///
72         DisplayType display() const { return AlignCenter; }
73         ///
74         docstring const getScreenLabel(Buffer const &) const;
75 private:
76         virtual Inset * clone() const {
77                 return new InsetPrintIndex(params());
78         }
79 };
80
81
82 } // namespace lyx
83
84 #endif