]> git.lyx.org Git - lyx.git/blob - src/insets/insetindex.C
Rename LatexRunParams::fragile as moving_arg.
[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 "funcrequest.h"
16 #include "frontends/LyXView.h"
17 #include "frontends/Dialogs.h"
18 #include "LaTeXFeatures.h"
19 #include "gettext.h"
20 #include "support/LOstream.h"
21
22 using std::ostream;
23
24 InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
25         : InsetCommand(p)
26 {}
27
28
29 InsetIndex::~InsetIndex()
30 {
31         InsetCommandMailer mailer("index", *this);
32         mailer.hideDialog();
33 }
34
35
36 string const InsetIndex::getScreenLabel(Buffer const *) const
37 {
38         return _("Idx");
39 }
40
41
42 dispatch_result InsetIndex::localDispatch(FuncRequest const & cmd)
43 {
44         switch (cmd.action) {
45                 case LFUN_INSET_EDIT:
46                         InsetCommandMailer("index", *this).showDialog(cmd.view());
47                         return DISPATCHED;
48                 
49                 default:
50                         return UNDISPATCHED;
51         }
52 }
53
54
55 int InsetIndex::docbook(Buffer const *, ostream & os, bool) const
56 {
57         os << "<indexterm><primary>" << getContents()
58            << "</primary></indexterm>";
59         return 0;
60 }
61
62
63 Inset::Code InsetIndex::lyxCode() const
64 {
65         return Inset::INDEX_CODE;
66 }
67
68
69
70 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
71         : InsetCommand(p)
72 {}
73
74
75 InsetPrintIndex::~InsetPrintIndex()
76 {}
77
78
79 string const InsetPrintIndex::getScreenLabel(Buffer const *) const
80 {
81         return _("Index");
82 }
83
84
85 void InsetPrintIndex::validate(LaTeXFeatures & features) const
86 {
87         features.require("makeidx");
88 }
89
90
91 Inset::Code InsetPrintIndex::lyxCode() const
92 {
93         return Inset::INDEX_PRINT_CODE;
94 }