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