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"
22 InsetIndex::InsetIndex(InsetCommandParams const & p)
27 // InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
28 // : InsetCommand(p, false)
32 InsetIndex::~InsetIndex()
34 InsetCommandMailer mailer("index", *this);
39 string const InsetIndex::getScreenLabel(Buffer const &) const
45 void InsetPrintIndex::metrics(MetricsInfo & mi, Dimension & dim) const
47 InsetCommand::metrics(mi, dim);
48 center_indent_ = (mi.base.textwidth - dim.wid) / 2;
49 dim.wid = mi.base.textwidth;
54 void InsetPrintIndex::draw(PainterInfo & pi, int x, int y) const
56 InsetCommand::draw(pi, x + center_indent_, y);
60 dispatch_result InsetIndex::localDispatch(FuncRequest const & cmd)
64 InsetCommandMailer("index", *this).showDialog(cmd.view());
68 return InsetCommand::localDispatch(cmd);
73 int InsetIndex::docbook(Buffer const &, ostream & os, bool) const
75 os << "<indexterm><primary>" << getContents()
76 << "</primary></indexterm>";
81 InsetOld::Code InsetIndex::lyxCode() const
83 return InsetOld::INDEX_CODE;
88 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
93 // InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
94 // : InsetCommand(p, false)
98 InsetPrintIndex::~InsetPrintIndex()
102 string const InsetPrintIndex::getScreenLabel(Buffer const &) const
108 void InsetPrintIndex::validate(LaTeXFeatures & features) const
110 features.require("makeidx");
114 InsetOld::Code InsetPrintIndex::lyxCode() const
116 return InsetOld::INDEX_PRINT_CODE;