1999-09-27 18:44:28 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "insetindex.h"
|
2000-08-03 12:56:25 +00:00
|
|
|
#include "BufferView.h"
|
|
|
|
#include "LyXView.h"
|
|
|
|
#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;
|
|
|
|
|
2001-07-06 15:57:54 +00:00
|
|
|
InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
|
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
|
|
|
|
|
|
|
|
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");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
void InsetIndex::edit(BufferView * bv, int, int, unsigned int)
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
2002-02-16 15:59:55 +00:00
|
|
|
bv->owner()->getDialogs()->showIndex(this);
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-20 14:18:48 +00:00
|
|
|
void InsetIndex::edit(BufferView * bv, bool)
|
|
|
|
{
|
|
|
|
edit(bv, 0, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-02 16:11:19 +00:00
|
|
|
int InsetIndex::docbook(Buffer const *, ostream & os) const
|
|
|
|
{
|
2002-05-01 22:17:09 +00:00
|
|
|
os << "<indexterm><primary>" << getContents()
|
|
|
|
<< "</primary></indexterm>";
|
|
|
|
return 0;
|
2001-11-02 16:11:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-23 09:11:14 +00:00
|
|
|
Inset::Code InsetIndex::lyxCode() const
|
|
|
|
{
|
2002-03-21 17:09:55 +00:00
|
|
|
return Inset::INDEX_CODE;
|
2001-07-23 09:11:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-06 15:57:54 +00:00
|
|
|
InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
|
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
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
Inset::Code InsetPrintIndex::lyxCode() const
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
2002-03-21 17:09:55 +00:00
|
|
|
return Inset::INDEX_PRINT_CODE;
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|