]> git.lyx.org Git - lyx.git/blob - src/insets/insetindex.C
move everything into namespace lyx
[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         // FIXME UNICODE
50         os << "<indexterm><primary>"
51            << from_ascii(sgml::escapeString(lyx::to_ascii(getParam("name"))))
52            << "</primary></indexterm>";
53         return 0;
54 }
55
56
57 InsetBase::Code InsetIndex::lyxCode() const
58 {
59         return InsetBase::INDEX_CODE;
60 }
61
62
63
64 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
65         : InsetCommand(p, string())
66 {}
67
68
69 // InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
70 //      : InsetCommand(p, false)
71 // {}
72
73
74 docstring const InsetPrintIndex::getScreenLabel(Buffer const &) const
75 {
76         return _("Index");
77 }
78
79
80 void InsetPrintIndex::validate(LaTeXFeatures & features) const
81 {
82         features.require("makeidx");
83 }
84
85
86 InsetBase::Code InsetPrintIndex::lyxCode() const
87 {
88         return InsetBase::INDEX_PRINT_CODE;
89 }
90
91
92 } // namespace lyx