]> git.lyx.org Git - lyx.git/blob - src/insets/insetindex.C
static_cast-based key/mouse-state. Kill insetKeyPress.
[lyx.git] / src / insets / insetindex.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "insetindex.h"
8 #include "BufferView.h"
9 #include "frontends/LyXView.h"
10 #include "frontends/Dialogs.h"
11 #include "LaTeXFeatures.h"
12 #include "gettext.h"
13 #include "support/LOstream.h"
14
15 using std::ostream;
16
17 InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
18         : InsetCommand(p)
19 {}
20
21
22 string const InsetIndex::getScreenLabel(Buffer const *) const
23 {
24         return _("Idx");
25 }
26
27
28 void InsetIndex::edit(BufferView * bv, int, int, mouse_button::state)
29 {
30         bv->owner()->getDialogs()->showIndex(this);
31 }
32
33
34 void InsetIndex::edit(BufferView * bv, bool)
35 {
36         edit(bv, 0, 0, mouse_button::none);
37 }
38
39
40 int InsetIndex::docbook(Buffer const *, ostream & os) const
41 {
42         os << "<indexterm><primary>" << getContents()
43            << "</primary></indexterm>";
44         return 0;
45 }
46
47
48 Inset::Code InsetIndex::lyxCode() const
49 {
50         return Inset::INDEX_CODE;
51 }
52
53
54 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
55         : InsetCommand(p)
56 {}
57
58
59 string const InsetPrintIndex::getScreenLabel(Buffer const *) const
60 {
61         return _("Index");
62 }
63
64
65 void InsetPrintIndex::validate(LaTeXFeatures & features) const
66 {
67         features.require("makeidx");
68 }
69
70
71 Inset::Code InsetPrintIndex::lyxCode() const
72 {
73         return Inset::INDEX_PRINT_CODE;
74 }