]> git.lyx.org Git - features.git/blob - src/insets/InsetIndex.cpp
getting rid of superfluous std:: statements.
[features.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 "FuncStatus.h"
17 #include "support/gettext.h"
18 #include "LaTeXFeatures.h"
19 #include "MetricsInfo.h"
20 #include "sgml.h"
21
22 #include <ostream>
23
24 using namespace std;
25
26 namespace lyx {
27
28
29 InsetIndex::InsetIndex(BufferParams const & bp)
30         : InsetCollapsable(bp)
31 {}
32
33
34 InsetIndex::InsetIndex(InsetIndex const & in)
35         : InsetCollapsable(in)
36 {}
37
38
39 int InsetIndex::docbook(Buffer const & buf, odocstream & os,
40                         OutputParams const & runparams) const
41 {
42         os << "<indexterm><primary>";
43         int const i = InsetText::docbook(buf, os, runparams);
44         os << "</primary></indexterm>";
45         return i;
46 }
47
48
49 Inset * InsetIndex::clone() const
50 {
51         return new InsetIndex(*this);
52 }
53
54
55 void InsetIndex::write(Buffer const & buf, ostream & os) const
56 {
57         os << to_utf8(name()) << "\n";
58         InsetCollapsable::write(buf, os);
59 }
60
61
62 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
63         : InsetCommand(p, string())
64 {}
65
66
67 CommandInfo const * InsetPrintIndex::findInfo(string const & /* cmdName */)
68 {
69         static const char * const paramnames[] = {"name", ""};
70         static const bool isoptional[] = {false};
71         static const CommandInfo info = {1, paramnames, isoptional};
72         return &info;
73 }
74
75
76 docstring const InsetPrintIndex::getScreenLabel(Buffer const &) const
77 {
78         return _("Index");
79 }
80
81
82 void InsetPrintIndex::validate(LaTeXFeatures & features) const
83 {
84         features.require("makeidx");
85 }
86
87
88 InsetCode InsetPrintIndex::lyxCode() const
89 {
90         return INDEX_PRINT_CODE;
91 }
92
93
94 } // namespace lyx