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 &);
43 static std::string params2string(InsetIndexParams const &);
45 static void string2params(std::string const &, InsetIndexParams &);
48 EDITABLE editable() const { return HIGHLY_EDITABLE; }
50 InsetCode lyxCode() const { return INDEX_CODE; }
52 docstring name() const { return from_ascii("Index"); }
54 void write(std::ostream & os) const;
56 void read(Lexer & lex);
58 int docbook(odocstream &, OutputParams const &) const;
60 int latex(odocstream &, OutputParams const &) const;
62 bool showInsetDialog(BufferView *) const;
64 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
66 void doDispatch(Cursor & cur, FuncRequest & cmd);
67 /// should paragraph indendation be omitted in any case?
68 bool neverIndent() const { return true; }
70 void addToToc(DocIterator const &);
72 docstring const buttonLabel(BufferView const & bv) const;
74 docstring toolTip(BufferView const & bv, int x, int y) const;
75 /// Updates needed features for this inset.
76 void validate(LaTeXFeatures & features) const;
78 docstring contextMenu(BufferView const & bv, int x, int y) const;
80 Inset * clone() const { return new InsetIndex(*this); }
83 friend class InsetIndexParams;
85 InsetIndexParams params_;
89 class InsetPrintIndex : public InsetCommand {
92 InsetPrintIndex(InsetCommandParams const &);
94 InsetCode lyxCode() const { return INDEX_PRINT_CODE; }
97 static ParamInfo const & findInfo(std::string const &);
99 static std::string defaultCommand() { return "printindex"; };
101 static bool isCompatibleCommand(std::string const & s)
102 { return s == "printindex"; }
104 int latex(odocstream &, OutputParams const &) const;
106 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
108 virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
110 /// Updates needed features for this inset.
111 void validate(LaTeXFeatures & features) const;
113 EDITABLE editable() const { return NOT_EDITABLE; }
115 DisplayType display() const { return AlignCenter; }
117 docstring screenLabel() const;
119 Inset * clone() const { return new InsetPrintIndex(*this); }