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>
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
|
#pragma implementation
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "insetindex.h"
|
2000-08-03 12:56:25 +00:00
|
|
|
|
#include "BufferView.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;
|
|
|
|
|
|
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");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-05-26 17:33:14 +00:00
|
|
|
|
void InsetIndex::edit(BufferView * bv, int, int, mouse_button::state)
|
1999-09-27 18:44:28 +00:00
|
|
|
|
{
|
2002-08-13 14:40:38 +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)
|
|
|
|
|
{
|
2002-05-26 17:33:14 +00:00
|
|
|
|
edit(bv, 0, 0, mouse_button::none);
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|