]> git.lyx.org Git - lyx.git/blob - src/insets/insetindex.C
Introduce wide streams. This fixes the remaining problems of plain text
[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 lyx::docstring;
24
25 using std::string;
26 using std::ostream;
27
28
29 InsetIndex::InsetIndex(InsetCommandParams const & p)
30         : InsetCommand(p, "index")
31 {}
32
33
34 // InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
35 //      : InsetCommand(p, false)
36 // {}
37
38
39 docstring const InsetIndex::getScreenLabel(Buffer const &) const
40 {
41         return _("Idx");
42 }
43
44
45 int InsetIndex::docbook(Buffer const &, ostream & os,
46                         OutputParams const &) const
47 {
48         os << "<indexterm><primary>" << sgml::escapeString(getContents())
49            << "</primary></indexterm>";
50         return 0;
51 }
52
53
54 InsetBase::Code InsetIndex::lyxCode() const
55 {
56         return InsetBase::INDEX_CODE;
57 }
58
59
60
61 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
62         : InsetCommand(p, string())
63 {}
64
65
66 // InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
67 //      : InsetCommand(p, false)
68 // {}
69
70
71 docstring const InsetPrintIndex::getScreenLabel(Buffer const &) const
72 {
73         return _("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 }