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"
14 #include "DispatchResult.h"
15 #include "FuncRequest.h"
17 #include "LaTeXFeatures.h"
18 #include "MetricsInfo.h"
21 #include "support/std_ostream.h"
30 InsetIndex::InsetIndex(InsetCommandParams const & p)
31 : InsetCommand(p, "index")
35 docstring const InsetIndex::getScreenLabel(Buffer const &) const
37 size_t const maxLabelChars = 25;
39 docstring label = _("Idx: ") + getParam("name");
40 if (label.size() > maxLabelChars) {
41 label.erase(maxLabelChars - 3);
48 int InsetIndex::docbook(Buffer const &, odocstream & os,
49 OutputParams const &) const
51 os << "<indexterm><primary>"
52 << sgml::escapeString(getParam("name"))
53 << "</primary></indexterm>";
58 Inset::Code InsetIndex::lyxCode() const
60 return Inset::INDEX_CODE;
65 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
66 : InsetCommand(p, string())
70 docstring const InsetPrintIndex::getScreenLabel(Buffer const &) const
76 void InsetPrintIndex::validate(LaTeXFeatures & features) const
78 features.require("makeidx");
82 Inset::Code InsetPrintIndex::lyxCode() const
84 return Inset::INDEX_PRINT_CODE;