]> git.lyx.org Git - lyx.git/blob - src/insets/insetindex.C
Change _() to return a docstring. Fixup callers with the help of lyx::to_utf8.
[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 using std::string;
24 using std::ostream;
25
26
27 InsetIndex::InsetIndex(InsetCommandParams const & p)
28         : InsetCommand(p, "index")
29 {}
30
31
32 // InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
33 //      : InsetCommand(p, false)
34 // {}
35
36
37 string const InsetIndex::getScreenLabel(Buffer const &) const
38 {
39         // FIXME UNICODE
40         return lyx::to_utf8(_("Idx"));
41 }
42
43
44 int InsetIndex::docbook(Buffer const &, ostream & os,
45                         OutputParams const &) const
46 {
47         os << "<indexterm><primary>" << sgml::escapeString(getContents())
48            << "</primary></indexterm>";
49         return 0;
50 }
51
52
53 InsetBase::Code InsetIndex::lyxCode() const
54 {
55         return InsetBase::INDEX_CODE;
56 }
57
58
59
60 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
61         : InsetCommand(p, string())
62 {}
63
64
65 // InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
66 //      : InsetCommand(p, false)
67 // {}
68
69
70 string const InsetPrintIndex::getScreenLabel(Buffer const &) const
71 {
72         // FIXME UNICODE
73         return lyx::to_utf8(_("Index"));
74 }
75
76
77 void InsetPrintIndex::validate(LaTeXFeatures & features) const
78 {
79         features.require("makeidx");
80 }
81
82
83 InsetBase::Code InsetPrintIndex::lyxCode() const
84 {
85         return InsetBase::INDEX_PRINT_CODE;
86 }