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 "funcrequest.h"
16 #include "LaTeXFeatures.h"
17 #include "metricsinfo.h"
19 #include "support/std_ostream.h"
25 InsetIndex::InsetIndex(InsetCommandParams const & p)
30 // InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
31 // : InsetCommand(p, false)
35 InsetIndex::~InsetIndex()
37 InsetCommandMailer mailer("index", *this);
42 string const InsetIndex::getScreenLabel(Buffer const &) const
48 void InsetPrintIndex::metrics(MetricsInfo & mi, Dimension & dim) const
50 InsetCommand::metrics(mi, dim);
51 center_indent_ = (mi.base.textwidth - dim.wid) / 2;
52 dim.wid = mi.base.textwidth;
57 void InsetPrintIndex::draw(PainterInfo & pi, int x, int y) const
59 InsetCommand::draw(pi, x + center_indent_, y);
64 InsetIndex::priv_dispatch(FuncRequest const & cmd,
65 idx_type & idx, pos_type & pos)
69 InsetCommandMailer("index", *this).showDialog(cmd.view());
73 return InsetCommand::priv_dispatch(cmd, idx, pos);
78 int InsetIndex::docbook(Buffer const &, ostream & os, bool) const
80 os << "<indexterm><primary>" << getContents()
81 << "</primary></indexterm>";
86 InsetOld::Code InsetIndex::lyxCode() const
88 return InsetOld::INDEX_CODE;
93 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
98 // InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
99 // : InsetCommand(p, false)
103 InsetPrintIndex::~InsetPrintIndex()
107 string const InsetPrintIndex::getScreenLabel(Buffer const &) const
113 void InsetPrintIndex::validate(LaTeXFeatures & features) const
115 features.require("makeidx");
119 InsetOld::Code InsetPrintIndex::lyxCode() const
121 return InsetOld::INDEX_PRINT_CODE;