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