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"
31 /////////////////////////////////////////////////////////////////////
35 ///////////////////////////////////////////////////////////////////////
38 InsetIndex::InsetIndex(Buffer const & buf)
39 : InsetCollapsable(buf)
43 int InsetIndex::docbook(odocstream & os, OutputParams const & runparams) const
45 os << "<indexterm><primary>";
46 int const i = InsetText::docbook(os, runparams);
47 os << "</primary></indexterm>";
52 void InsetIndex::write(ostream & os) const
54 os << to_utf8(name()) << "\n";
55 InsetCollapsable::write(os);
59 void InsetIndex::addToToc(ParConstIterator const & cpit) const
61 ParConstIterator pit = cpit;
64 Toc & toc = buffer().tocBackend().toc("index");
66 str = getNewLabel(str);
67 toc.push_back(TocItem(pit, 0, str));
71 /////////////////////////////////////////////////////////////////////
75 ///////////////////////////////////////////////////////////////////////
77 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
78 : InsetCommand(p, string())
82 ParamInfo const & InsetPrintIndex::findInfo(string const & /* cmdName */)
84 static ParamInfo param_info_;
85 if (param_info_.empty())
86 param_info_.add("name", ParamInfo::LATEX_REQUIRED);
91 docstring InsetPrintIndex::screenLabel() const
97 void InsetPrintIndex::validate(LaTeXFeatures & features) const
99 features.require("makeidx");
103 InsetCode InsetPrintIndex::lyxCode() const
105 return INDEX_PRINT_CODE;