4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
16 #include "InsetCollapsable.h"
17 #include "InsetCommand.h"
22 class InsetIndexParams {
25 explicit InsetIndexParams(docstring const & b = docstring())
28 void write(std::ostream & os) const;
30 void read(Lexer & lex);
36 /** Used to insert index labels
38 class InsetIndex : public InsetCollapsable {
41 InsetIndex(Buffer const &, InsetIndexParams const &);
44 EDITABLE editable() const { return HIGHLY_EDITABLE; }
46 InsetCode lyxCode() const { return INDEX_CODE; }
48 docstring name() const { return from_ascii("Index"); }
50 void write(std::ostream & os) const;
52 void read(Lexer & lex);
54 int docbook(odocstream &, OutputParams const &) const;
56 int latex(odocstream &, OutputParams const &) const;
58 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
60 void doDispatch(Cursor & cur, FuncRequest & cmd);
61 /// should paragraph indendation be omitted in any case?
62 bool neverIndent() const { return true; }
64 void addToToc(DocIterator const &);
66 docstring const buttonLabel(BufferView const & bv) const;
68 docstring toolTip(BufferView const & bv, int x, int y) const;
69 /// Updates needed features for this inset.
70 void validate(LaTeXFeatures & features) const;
72 docstring contextMenu(BufferView const & bv, int x, int y) const;
74 Inset * clone() const { return new InsetIndex(*this); }
77 friend class InsetIndexParams;
79 InsetIndexParams params_;
83 class InsetPrintIndex : public InsetCommand {
86 InsetPrintIndex(InsetCommandParams const &);
88 InsetCode lyxCode() const { return INDEX_PRINT_CODE; }
91 static ParamInfo const & findInfo(std::string const &);
93 static std::string defaultCommand() { return "printindex"; };
95 static bool isCompatibleCommand(std::string const & s)
96 { return s == "printindex"; }
98 int latex(odocstream &, OutputParams const &) const;
100 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
102 virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
104 /// Updates needed features for this inset.
105 void validate(LaTeXFeatures & features) const;
107 EDITABLE editable() const { return NOT_EDITABLE; }
109 DisplayType display() const { return AlignCenter; }
111 docstring screenLabel() const;
113 Inset * clone() const { return new InsetPrintIndex(*this); }