]> git.lyx.org Git - lyx.git/blob - src/insets/insetindex.C
The markDirty() and fitCursor() changes
[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 InsetIndex::~InsetIndex()
29 {
30         InsetCommandMailer mailer("index", *this);
31         mailer.hideDialog();
32 }
33
34
35 string const InsetIndex::getScreenLabel(Buffer const *) const
36 {
37         return _("Idx");
38 }
39
40
41 void InsetIndex::edit(BufferView * bv, int, int, mouse_button::state)
42 {
43         InsetCommandMailer mailer("index", *this);
44         mailer.showDialog(bv);
45 }
46
47
48 void InsetIndex::edit(BufferView * bv, bool)
49 {
50         edit(bv, 0, 0, mouse_button::none);
51 }
52
53
54 int InsetIndex::docbook(Buffer const *, ostream & os, bool) const
55 {
56         os << "<indexterm><primary>" << getContents()
57            << "</primary></indexterm>";
58         return 0;
59 }
60
61
62 Inset::Code InsetIndex::lyxCode() const
63 {
64         return Inset::INDEX_CODE;
65 }
66
67
68 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
69         : InsetCommand(p)
70 {}
71
72
73 string const InsetPrintIndex::getScreenLabel(Buffer const *) const
74 {
75         return _("Index");
76 }
77
78
79 void InsetPrintIndex::validate(LaTeXFeatures & features) const
80 {
81         features.require("makeidx");
82 }
83
84
85 Inset::Code InsetPrintIndex::lyxCode() const
86 {
87         return Inset::INDEX_PRINT_CODE;
88 }