]> git.lyx.org Git - lyx.git/blob - src/insets/insetindex.C
remove Inset::deletable() as it returns always 'true'
[lyx.git] / src / insets / insetindex.C
1 /**
2  * \file insetindex.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  *
8  * Full author contact details are available in file CREDITS
9  */
10 #include <config.h>
11
12
13 #include "insetindex.h"
14 #include "BufferView.h"
15 #include "frontends/LyXView.h"
16 #include "frontends/Dialogs.h"
17 #include "LaTeXFeatures.h"
18 #include "gettext.h"
19 #include "support/LOstream.h"
20
21 using std::ostream;
22
23 InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
24         : InsetCommand(p)
25 {}
26
27
28 string const InsetIndex::getScreenLabel(Buffer const *) const
29 {
30         return _("Idx");
31 }
32
33
34 void InsetIndex::edit(BufferView * bv, int, int, mouse_button::state)
35 {
36         bv->owner()->getDialogs().showIndex(this);
37 }
38
39
40 void InsetIndex::edit(BufferView * bv, bool)
41 {
42         edit(bv, 0, 0, mouse_button::none);
43 }
44
45
46 int InsetIndex::docbook(Buffer const *, ostream & os, bool) const
47 {
48         os << "<indexterm><primary>" << getContents()
49            << "</primary></indexterm>";
50         return 0;
51 }
52
53
54 Inset::Code InsetIndex::lyxCode() const
55 {
56         return Inset::INDEX_CODE;
57 }
58
59
60 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
61         : InsetCommand(p)
62 {}
63
64
65 string const InsetPrintIndex::getScreenLabel(Buffer const *) const
66 {
67         return _("Index");
68 }
69
70
71 void InsetPrintIndex::validate(LaTeXFeatures & features) const
72 {
73         features.require("makeidx");
74 }
75
76
77 Inset::Code InsetPrintIndex::lyxCode() const
78 {
79         return Inset::INDEX_PRINT_CODE;
80 }