]> git.lyx.org Git - lyx.git/blob - src/insets/InsetIndex.cpp
Fix text frame drawing.
[lyx.git] / src / insets / InsetIndex.cpp
1 /**
2  * \file InsetIndex.cpp
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 docstring const InsetIndex::getScreenLabel(Buffer const &) const
36 {
37         return _("Idx");
38 }
39
40
41 int InsetIndex::docbook(Buffer const &, odocstream & os,
42                         OutputParams const &) const
43 {
44         os << "<indexterm><primary>"
45            << sgml::escapeString(getParam("name"))
46            << "</primary></indexterm>";
47         return 0;
48 }
49
50
51 Inset::Code InsetIndex::lyxCode() const
52 {
53         return Inset::INDEX_CODE;
54 }
55
56
57
58 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
59         : InsetCommand(p, string())
60 {}
61
62
63 docstring const InsetPrintIndex::getScreenLabel(Buffer const &) const
64 {
65         return _("Index");
66 }
67
68
69 void InsetPrintIndex::validate(LaTeXFeatures & features) const
70 {
71         features.require("makeidx");
72 }
73
74
75 Inset::Code InsetPrintIndex::lyxCode() const
76 {
77         return Inset::INDEX_PRINT_CODE;
78 }
79
80
81 } // namespace lyx