#include "DispatchResult.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
#include "LaTeXFeatures.h"
#include "MetricsInfo.h"
#include "sgml.h"
-#include "support/std_ostream.h"
+#include <ostream>
+using namespace std;
namespace lyx {
-using std::string;
-using std::ostream;
-
InsetIndex::InsetIndex(BufferParams const & bp)
: InsetCollapsable(bp)
-{
- setLayout(bp);
-}
+{}
InsetIndex::InsetIndex(InsetIndex const & in)
}
-Inset::Code InsetIndex::lyxCode() const
-{
- return Inset::INDEX_CODE;
-}
-
-
Inset * InsetIndex::clone() const
{
return new InsetIndex(*this);
}
-void InsetIndex::write(Buffer const & buf, std::ostream & os) const
+void InsetIndex::write(Buffer const & buf, ostream & os) const
{
os << to_utf8(name()) << "\n";
InsetCollapsable::write(buf, os);
}
-void InsetIndex::metrics(MetricsInfo & mi, Dimension & dim) const
-{
- Font tmpfont = mi.base.font;
- getDrawFont(mi.base.font);
- mi.base.font.realize(tmpfont);
- InsetCollapsable::metrics(mi, dim);
- mi.base.font = tmpfont;
-}
-
-
-void InsetIndex::draw(PainterInfo & pi, int x, int y) const
-{
- Font tmpfont = pi.base.font;
- getDrawFont(pi.base.font);
- pi.base.font.realize(tmpfont);
- InsetCollapsable::draw(pi, x, y);
- pi.base.font = tmpfont;
-}
-
-
-void InsetIndex::getDrawFont(Font & font) const
-{
- font = Font(Font::ALL_INHERIT);
- font.realize(layout_.font);
-}
+InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
+ : InsetCommand(p, string())
+{}
-bool InsetIndex::getStatus(Cursor & cur, FuncRequest const & cmd,
- FuncStatus & status) const
+CommandInfo const * InsetPrintIndex::findInfo(string const & /* cmdName */)
{
- switch (cmd.action) {
- // paragraph breaks not allowed
- case LFUN_BREAK_PARAGRAPH:
- case LFUN_BREAK_PARAGRAPH_SKIP:
- status.enabled(false);
- return true;
-
- default:
- return InsetCollapsable::getStatus(cur, cmd, status);
- }
+ static const char * const paramnames[] = {"name", ""};
+ static const bool isoptional[] = {false};
+ static const CommandInfo info = {1, paramnames, isoptional};
+ return &info;
}
-
-InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
- : InsetCommand(p, string())
-{}
-
-
docstring const InsetPrintIndex::getScreenLabel(Buffer const &) const
{
return _("Index");
}
-Inset::Code InsetPrintIndex::lyxCode() const
+InsetCode InsetPrintIndex::lyxCode() const
{
- return Inset::INDEX_PRINT_CODE;
+ return INDEX_PRINT_CODE;
}