1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file InsetIndex.h
|
2002-09-25 14:26:13 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author Lars Gullik Bjønnes
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-25 14:26:13 +00:00
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
#ifndef INSET_INDEX_H
|
|
|
|
#define INSET_INDEX_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
2007-10-03 13:38:19 +00:00
|
|
|
#include "InsetCollapsable.h"
|
2007-04-25 01:24:38 +00:00
|
|
|
#include "InsetCommand.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2009-04-16 07:29:01 +00:00
|
|
|
class InsetIndexParams {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
explicit InsetIndexParams(docstring const & b = docstring())
|
|
|
|
: index(b) {}
|
|
|
|
///
|
|
|
|
void write(std::ostream & os) const;
|
|
|
|
///
|
|
|
|
void read(Lexer & lex);
|
|
|
|
///
|
|
|
|
docstring index;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-03-21 17:09:55 +00:00
|
|
|
/** Used to insert index labels
|
1999-09-27 18:44:28 +00:00
|
|
|
*/
|
2007-10-03 13:38:19 +00:00
|
|
|
class InsetIndex : public InsetCollapsable {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
2009-11-08 15:53:21 +00:00
|
|
|
InsetIndex(Buffer *, InsetIndexParams const &);
|
2009-04-17 09:22:44 +00:00
|
|
|
///
|
|
|
|
static std::string params2string(InsetIndexParams const &);
|
|
|
|
///
|
|
|
|
static void string2params(std::string const &, InsetIndexParams &);
|
2008-03-05 00:21:05 +00:00
|
|
|
private:
|
2000-07-07 07:46:37 +00:00
|
|
|
///
|
2009-04-22 20:55:13 +00:00
|
|
|
bool hasSettings() const;
|
2000-07-07 07:46:37 +00:00
|
|
|
///
|
2007-10-16 16:48:21 +00:00
|
|
|
InsetCode lyxCode() const { return INDEX_CODE; }
|
2001-11-02 16:11:19 +00:00
|
|
|
///
|
2007-10-03 13:38:19 +00:00
|
|
|
docstring name() const { return from_ascii("Index"); }
|
|
|
|
///
|
2009-07-13 06:46:52 +00:00
|
|
|
ColorCode labelColor() const;
|
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
void write(std::ostream & os) const;
|
2007-10-03 13:38:19 +00:00
|
|
|
///
|
2009-04-16 07:29:01 +00:00
|
|
|
void read(Lexer & lex);
|
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
int docbook(odocstream &, OutputParams const &) const;
|
2010-01-12 20:44:39 +00:00
|
|
|
///
|
2009-11-19 22:03:15 +00:00
|
|
|
docstring xhtml(XHTMLStream &, OutputParams const &) const;
|
2008-04-26 14:24:28 +00:00
|
|
|
///
|
|
|
|
int latex(odocstream &, OutputParams const &) const;
|
2009-04-16 07:29:01 +00:00
|
|
|
///
|
2009-04-17 09:22:44 +00:00
|
|
|
bool showInsetDialog(BufferView *) const;
|
|
|
|
///
|
2009-04-16 07:29:01 +00:00
|
|
|
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
|
|
|
|
///
|
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd);
|
2007-10-03 13:38:19 +00:00
|
|
|
/// should paragraph indendation be omitted in any case?
|
2008-02-27 20:43:16 +00:00
|
|
|
bool neverIndent() const { return true; }
|
2008-02-13 13:19:39 +00:00
|
|
|
///
|
2008-05-13 08:23:44 +00:00
|
|
|
void addToToc(DocIterator const &);
|
2007-10-03 13:38:19 +00:00
|
|
|
///
|
2009-04-16 07:29:01 +00:00
|
|
|
docstring toolTip(BufferView const & bv, int x, int y) const;
|
2010-01-17 14:47:45 +00:00
|
|
|
///
|
|
|
|
docstring const buttonLabel(BufferView const & bv) const;
|
2009-04-16 07:29:01 +00:00
|
|
|
/// Updates needed features for this inset.
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
|
|
|
///
|
|
|
|
docstring contextMenu(BufferView const & bv, int x, int y) const;
|
|
|
|
///
|
2008-03-05 00:21:05 +00:00
|
|
|
Inset * clone() const { return new InsetIndex(*this); }
|
2009-04-16 07:29:01 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
friend class InsetIndexParams;
|
|
|
|
///
|
|
|
|
InsetIndexParams params_;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-08-04 13:12:30 +00:00
|
|
|
class InsetPrintIndex : public InsetCommand {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
2009-11-08 16:10:34 +00:00
|
|
|
InsetPrintIndex(Buffer * buf, InsetCommandParams const &);
|
2009-04-16 07:29:01 +00:00
|
|
|
///
|
|
|
|
InsetCode lyxCode() const { return INDEX_PRINT_CODE; }
|
2008-03-05 00:21:05 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
static ParamInfo const & findInfo(std::string const &);
|
|
|
|
///
|
2009-11-21 23:28:20 +00:00
|
|
|
static std::string defaultCommand() { return "printindex"; }
|
2008-03-05 00:21:05 +00:00
|
|
|
///
|
2009-04-27 06:10:25 +00:00
|
|
|
static bool isCompatibleCommand(std::string const & s);
|
2009-04-16 07:29:01 +00:00
|
|
|
///
|
|
|
|
int latex(odocstream &, OutputParams const &) const;
|
2010-01-12 20:44:39 +00:00
|
|
|
///
|
2009-11-21 23:28:20 +00:00
|
|
|
docstring xhtml(XHTMLStream &, OutputParams const &) const;
|
2009-04-16 07:29:01 +00:00
|
|
|
///
|
2009-04-17 14:29:32 +00:00
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd);
|
|
|
|
///
|
2009-04-16 07:29:01 +00:00
|
|
|
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
|
|
|
|
///
|
|
|
|
virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
|
2008-03-05 00:21:05 +00:00
|
|
|
private:
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Updates needed features for this inset.
|
2001-06-28 10:25:20 +00:00
|
|
|
void validate(LaTeXFeatures & features) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2009-04-22 20:55:13 +00:00
|
|
|
bool hasSettings() const;
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2007-05-18 14:32:29 +00:00
|
|
|
DisplayType display() const { return AlignCenter; }
|
2003-10-22 10:22:09 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
docstring screenLabel() const;
|
2007-10-25 04:13:56 +00:00
|
|
|
///
|
2008-03-05 00:21:05 +00:00
|
|
|
Inset * clone() const { return new InsetPrintIndex(*this); }
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
#endif
|