3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS.
12 #include "InsetIndex.h"
15 #include "DispatchResult.h"
16 #include "FuncRequest.h"
17 #include "FuncStatus.h"
18 #include "LaTeXFeatures.h"
19 #include "MetricsInfo.h"
21 #include "TocBackend.h"
23 #include "support/gettext.h"
32 InsetIndex::InsetIndex(BufferParams const & bp)
33 : InsetCollapsable(bp)
37 InsetIndex::InsetIndex(InsetIndex const & in)
38 : InsetCollapsable(in)
42 int InsetIndex::docbook(Buffer const & buf, odocstream & os,
43 OutputParams const & runparams) const
45 os << "<indexterm><primary>";
46 int const i = InsetText::docbook(buf, os, runparams);
47 os << "</primary></indexterm>";
52 Inset * InsetIndex::clone() const
54 return new InsetIndex(*this);
58 void InsetIndex::write(Buffer const & buf, ostream & os) const
60 os << to_utf8(name()) << "\n";
61 InsetCollapsable::write(buf, os);
65 void InsetIndex::addToToc(Buffer const & buf,
66 ParConstIterator const & cpit) const
68 ParConstIterator pit = cpit;
71 Toc & toc = buf.tocBackend().toc("index");
73 str = getNewLabel(str);
74 toc.push_back(TocItem(pit, 0, str));
78 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
79 : InsetCommand(p, string())
83 ParamInfo const & InsetPrintIndex::findInfo(string const & /* cmdName */)
85 static ParamInfo param_info_;
86 if (param_info_.empty()) {
87 param_info_.add("name", false);
93 docstring const InsetPrintIndex::getScreenLabel(Buffer const &) const
99 void InsetPrintIndex::validate(LaTeXFeatures & features) const
101 features.require("makeidx");
105 InsetCode InsetPrintIndex::lyxCode() const
107 return INDEX_PRINT_CODE;