]> git.lyx.org Git - lyx.git/blob - src/insets/insetindex.C
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[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 #include "insetindex.h"
13
14 #include "dispatchresult.h"
15 #include "funcrequest.h"
16 #include "gettext.h"
17 #include "LaTeXFeatures.h"
18 #include "metricsinfo.h"
19 #include "sgml.h"
20
21 #include "support/std_ostream.h"
22
23
24 namespace lyx {
25
26 using std::string;
27 using std::ostream;
28
29
30 InsetIndex::InsetIndex(InsetCommandParams const & p)
31         : InsetCommand(p, "index")
32 {}
33
34
35 // InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
36 //      : InsetCommand(p, false)
37 // {}
38
39
40 docstring const InsetIndex::getScreenLabel(Buffer const &) const
41 {
42         return _("Idx");
43 }
44
45
46 int InsetIndex::docbook(Buffer const &, odocstream & os,
47                         OutputParams const &) const
48 {
49         os << "<indexterm><primary>"
50            << sgml::escapeString(getParam("name"))
51            << "</primary></indexterm>";
52         return 0;
53 }
54
55
56 InsetBase::Code InsetIndex::lyxCode() const
57 {
58         return InsetBase::INDEX_CODE;
59 }
60
61
62
63 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
64         : InsetCommand(p, string())
65 {}
66
67
68 // InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
69 //      : InsetCommand(p, false)
70 // {}
71
72
73 docstring 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 InsetBase::Code InsetPrintIndex::lyxCode() const
86 {
87         return InsetBase::INDEX_PRINT_CODE;
88 }
89
90
91 } // namespace lyx