2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file insetindex.C
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS
|
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "insetindex.h"
|
2000-08-03 12:56:25 +00:00
|
|
|
|
#include "BufferView.h"
|
2003-05-16 07:44:00 +00:00
|
|
|
|
#include "funcrequest.h"
|
2002-05-23 12:08:47 +00:00
|
|
|
|
#include "frontends/LyXView.h"
|
2000-08-03 12:56:25 +00:00
|
|
|
|
#include "frontends/Dialogs.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
#include "LaTeXFeatures.h"
|
2001-04-05 12:26:41 +00:00
|
|
|
|
#include "gettext.h"
|
2001-11-06 15:32:43 +00:00
|
|
|
|
#include "support/LOstream.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2001-11-03 11:43:23 +00:00
|
|
|
|
using std::ostream;
|
|
|
|
|
|
2003-05-26 09:13:55 +00:00
|
|
|
|
InsetIndex::InsetIndex(InsetCommandParams const & p)
|
2000-08-03 12:56:25 +00:00
|
|
|
|
: InsetCommand(p)
|
2000-07-15 23:51:46 +00:00
|
|
|
|
{}
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
|
2003-05-26 09:13:55 +00:00
|
|
|
|
// InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
|
|
|
|
|
// : InsetCommand(p, false)
|
|
|
|
|
// {}
|
|
|
|
|
|
|
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
|
InsetIndex::~InsetIndex()
|
|
|
|
|
{
|
|
|
|
|
InsetCommandMailer mailer("index", *this);
|
|
|
|
|
mailer.hideDialog();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-07-28 12:24:16 +00:00
|
|
|
|
string const InsetIndex::getScreenLabel(Buffer const *) const
|
1999-09-27 18:44:28 +00:00
|
|
|
|
{
|
|
|
|
|
return _("Idx");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-16 07:44:00 +00:00
|
|
|
|
dispatch_result InsetIndex::localDispatch(FuncRequest const & cmd)
|
1999-09-27 18:44:28 +00:00
|
|
|
|
{
|
2003-05-16 07:44:00 +00:00
|
|
|
|
switch (cmd.action) {
|
|
|
|
|
case LFUN_INSET_EDIT:
|
|
|
|
|
InsetCommandMailer("index", *this).showDialog(cmd.view());
|
|
|
|
|
return DISPATCHED;
|
2003-05-26 09:13:55 +00:00
|
|
|
|
|
2003-05-16 07:44:00 +00:00
|
|
|
|
default:
|
2003-05-28 16:36:55 +00:00
|
|
|
|
return InsetCommand::localDispatch(cmd);
|
2003-05-16 07:44:00 +00:00
|
|
|
|
}
|
2001-07-20 14:18:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
|
int InsetIndex::docbook(Buffer const *, ostream & os, bool) const
|
2001-11-02 16:11:19 +00:00
|
|
|
|
{
|
2002-05-01 22:17:09 +00:00
|
|
|
|
os << "<indexterm><primary>" << getContents()
|
|
|
|
|
<< "</primary></indexterm>";
|
|
|
|
|
return 0;
|
2001-11-02 16:11:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-07-25 21:20:24 +00:00
|
|
|
|
InsetOld::Code InsetIndex::lyxCode() const
|
2001-07-23 09:11:14 +00:00
|
|
|
|
{
|
2003-07-25 21:20:24 +00:00
|
|
|
|
return InsetOld::INDEX_CODE;
|
2001-07-23 09:11:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-16 07:44:00 +00:00
|
|
|
|
|
2003-05-26 09:13:55 +00:00
|
|
|
|
InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
|
2000-08-03 12:56:25 +00:00
|
|
|
|
: InsetCommand(p)
|
2000-07-15 23:51:46 +00:00
|
|
|
|
{}
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2002-05-01 22:17:09 +00:00
|
|
|
|
|
2003-05-26 09:13:55 +00:00
|
|
|
|
// InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
|
|
|
|
|
// : InsetCommand(p, false)
|
|
|
|
|
// {}
|
|
|
|
|
|
|
|
|
|
|
2003-05-16 07:44:00 +00:00
|
|
|
|
InsetPrintIndex::~InsetPrintIndex()
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2001-07-28 12:24:16 +00:00
|
|
|
|
string const InsetPrintIndex::getScreenLabel(Buffer const *) const
|
1999-09-27 18:44:28 +00:00
|
|
|
|
{
|
2000-08-03 12:56:25 +00:00
|
|
|
|
return _("Index");
|
1999-09-27 18:44:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void InsetPrintIndex::validate(LaTeXFeatures & features) const
|
1999-09-27 18:44:28 +00:00
|
|
|
|
{
|
2001-11-19 15:34:11 +00:00
|
|
|
|
features.require("makeidx");
|
1999-09-27 18:44:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-07-25 21:20:24 +00:00
|
|
|
|
InsetOld::Code InsetPrintIndex::lyxCode() const
|
1999-09-27 18:44:28 +00:00
|
|
|
|
{
|
2003-07-25 21:20:24 +00:00
|
|
|
|
return InsetOld::INDEX_PRINT_CODE;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
}
|