]> git.lyx.org Git - lyx.git/blob - src/insets/InsetIndex.h
Enable InsetQuote in verbatim and Hebrew
[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 InsetIndexParams {
23 public:
24         ///
25         explicit InsetIndexParams(docstring const & b = docstring())
26                 : index(b) {}
27         ///
28         void write(std::ostream & os) const;
29         ///
30         void read(Lexer & lex);
31         ///
32         docstring index;
33 };
34
35
36 /** Used to insert index labels
37   */
38 class InsetIndex : public InsetCollapsable {
39 public:
40         ///
41         InsetIndex(Buffer *, InsetIndexParams const &);
42         ///
43         static std::string params2string(InsetIndexParams const &);
44         ///
45         static void string2params(std::string const &, InsetIndexParams &);
46 private:
47         ///
48         bool hasSettings() const;
49         ///
50         InsetCode lyxCode() const { return INDEX_CODE; }
51         ///
52         docstring layoutName() const { return from_ascii("Index"); }
53         ///
54         ColorCode labelColor() const;
55         ///
56         void write(std::ostream & os) const;
57         ///
58         void read(Lexer & lex);
59         ///
60         int docbook(odocstream &, OutputParams const &) const;
61         ///
62         docstring xhtml(XHTMLStream &, OutputParams const &) const;
63         ///
64         void latex(otexstream &, OutputParams const &) const;
65         ///
66         bool showInsetDialog(BufferView *) const;
67         ///
68         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
69         ///
70         void doDispatch(Cursor & cur, FuncRequest & cmd);
71         /// should paragraph indendation be omitted in any case?
72         bool neverIndent() const { return true; }
73         ///
74         void addToToc(DocIterator const & di, bool output_active,
75                                   UpdateType utype) const;
76         ///
77         docstring toolTip(BufferView const & bv, int x, int y) const;
78         ///
79         docstring const buttonLabel(BufferView const & bv) const;
80         /// Updates needed features for this inset.
81         void validate(LaTeXFeatures & features) const;
82         ///
83         std::string contextMenuName() const;
84         ///
85         Inset * clone() const { return new InsetIndex(*this); }
86
87         ///
88         friend class InsetIndexParams;
89         ///
90         InsetIndexParams params_;
91 };
92
93
94 class InsetPrintIndex : public InsetCommand {
95 public:
96         ///
97         InsetPrintIndex(Buffer * buf, InsetCommandParams const &);
98
99         /// \name Public functions inherited from Inset class
100         //@{
101         ///
102         InsetCode lyxCode() const { return INDEX_PRINT_CODE; }
103         ///
104         void latex(otexstream &, OutputParams const &) const;
105         ///
106         docstring xhtml(XHTMLStream &, OutputParams const &) const;
107         ///
108         void doDispatch(Cursor & cur, FuncRequest & cmd);
109         ///
110         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
111         ///
112         std::string contextMenuName() const;
113         /// Updates needed features for this inset.
114         void validate(LaTeXFeatures & features) const;
115         ///
116         bool hasSettings() const;
117         ///
118         DisplayType display() const { return AlignCenter; }
119         //@}
120
121         /// \name Static public methods obligated for InsetCommand derived classes
122         //@{
123         ///
124         static ParamInfo const & findInfo(std::string const &);
125         ///
126         static std::string defaultCommand() { return "printindex"; }
127         ///
128         static bool isCompatibleCommand(std::string const & s);
129         //@}
130
131 private:
132         /// \name Private functions inherited from Inset class
133         //@{
134         ///
135         Inset * clone() const { return new InsetPrintIndex(*this); }
136         //@}
137
138         /// \name Private functions inherited from InsetCommand class
139         //@{
140         ///
141         docstring screenLabel() const;
142         //@}
143 };
144
145
146 } // namespace lyx
147
148 #endif