]> git.lyx.org Git - lyx.git/blob - src/insets/insetindex.C
6e5bcff1800d68980daf2b9a93198d02fd891501
[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 "LyXView.h"
10 #include "frontends/Dialogs.h"
11 #include "LaTeXFeatures.h"
12 #include "gettext.h"
13
14 using std::ostream;
15
16 InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
17         : InsetCommand(p)
18 {}
19
20
21 string const InsetIndex::getScreenLabel(Buffer const *) const
22 {
23         return _("Idx");
24 }
25
26
27 void InsetIndex::edit(BufferView * bv, int, int, unsigned int)
28 {
29         bv->owner()->getDialogs()->showIndex( this );
30 }
31
32
33 void InsetIndex::edit(BufferView * bv, bool)
34 {
35         edit(bv, 0, 0, 0);
36 }
37
38
39 int InsetIndex::docbook(Buffer const *, ostream & os) const
40 {
41   os << "<indexterm><primary>" << getContents() << "</primary></indexterm>";
42   return 0;
43 }
44
45
46 Inset::Code InsetIndex::lyxCode() const
47 {
48         return Inset::INDEX_CODE;
49 }
50
51
52 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
53         : InsetCommand(p)
54 {}
55
56 string const InsetPrintIndex::getScreenLabel(Buffer const *) const
57 {
58         return _("Index");
59 }
60
61
62 void InsetPrintIndex::validate(LaTeXFeatures & features) const
63 {
64         features.makeidx = true;
65 }
66
67
68 Inset::Code InsetPrintIndex::lyxCode() const
69 {
70         return Inset::INDEX_PRINT_CODE;
71 }