]> git.lyx.org Git - lyx.git/blob - src/insets/insetindex.C
changelogs
[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         return _("Idx");
40 }
41
42
43 int InsetIndex::docbook(Buffer const &, ostream & os,
44                         OutputParams const &) const
45 {
46         os << "<indexterm><primary>" << sgml::escapeString(getContents())
47            << "</primary></indexterm>";
48         return 0;
49 }
50
51
52 InsetOld::Code InsetIndex::lyxCode() const
53 {
54         return InsetOld::INDEX_CODE;
55 }
56
57
58
59 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
60         : InsetCommand(p, string())
61 {}
62
63
64 // InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
65 //      : InsetCommand(p, false)
66 // {}
67
68
69 string const InsetPrintIndex::getScreenLabel(Buffer const &) const
70 {
71         return _("Index");
72 }
73
74
75 void InsetPrintIndex::validate(LaTeXFeatures & features) const
76 {
77         features.require("makeidx");
78 }
79
80
81 InsetOld::Code InsetPrintIndex::lyxCode() const
82 {
83         return InsetOld::INDEX_PRINT_CODE;
84 }