]> git.lyx.org Git - lyx.git/blob - src/insets/insetindex.C
prevent crash when inserting minipage in table cell,
[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)
25         : InsetCommand(p)
26 {}
27
28
29 // InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
30 //      : InsetCommand(p, false)
31 // {}
32
33
34 InsetIndex::~InsetIndex()
35 {
36         InsetCommandMailer mailer("index", *this);
37         mailer.hideDialog();
38 }
39
40
41 string const InsetIndex::getScreenLabel(Buffer const *) const
42 {
43         return _("Idx");
44 }
45
46
47 dispatch_result InsetIndex::localDispatch(FuncRequest const & cmd)
48 {
49         switch (cmd.action) {
50                 case LFUN_INSET_EDIT:
51                         InsetCommandMailer("index", *this).showDialog(cmd.view());
52                         return DISPATCHED;
53
54                 default:
55                         return InsetCommand::localDispatch(cmd);
56         }
57 }
58
59
60 int InsetIndex::docbook(Buffer const *, ostream & os, bool) const
61 {
62         os << "<indexterm><primary>" << getContents()
63            << "</primary></indexterm>";
64         return 0;
65 }
66
67
68 InsetOld::Code InsetIndex::lyxCode() const
69 {
70         return InsetOld::INDEX_CODE;
71 }
72
73
74
75 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
76         : InsetCommand(p)
77 {}
78
79
80 // InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
81 //      : InsetCommand(p, false)
82 // {}
83
84
85 InsetPrintIndex::~InsetPrintIndex()
86 {}
87
88
89 string const InsetPrintIndex::getScreenLabel(Buffer const *) const
90 {
91         return _("Index");
92 }
93
94
95 void InsetPrintIndex::validate(LaTeXFeatures & features) const
96 {
97         features.require("makeidx");
98 }
99
100
101 InsetOld::Code InsetPrintIndex::lyxCode() const
102 {
103         return InsetOld::INDEX_PRINT_CODE;
104 }