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 bool hasSettings() const;
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;
59 /// At the moment, this does nothing. See development/HTML.notes
60 /// for some remarks on what could be done.
61 docstring xhtml(odocstream &, OutputParams const &) const;
63 int latex(odocstream &, OutputParams const &) const;
65 bool showInsetDialog(BufferView *) const;
67 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
69 void doDispatch(Cursor & cur, FuncRequest & cmd);
70 /// should paragraph indendation be omitted in any case?
71 bool neverIndent() const { return true; }
73 void addToToc(DocIterator const &);
75 docstring const buttonLabel(BufferView const & bv) const;
77 docstring toolTip(BufferView const & bv, int x, int y) const;
78 /// Updates needed features for this inset.
79 void validate(LaTeXFeatures & features) const;
81 docstring contextMenu(BufferView const & bv, int x, int y) const;
83 Inset * clone() const { return new InsetIndex(*this); }
86 friend class InsetIndexParams;
88 InsetIndexParams params_;
92 class InsetPrintIndex : public InsetCommand {
95 InsetPrintIndex(InsetCommandParams const &);
97 InsetCode lyxCode() const { return INDEX_PRINT_CODE; }
100 static ParamInfo const & findInfo(std::string const &);
102 static std::string defaultCommand() { return "printindex"; };
104 static bool isCompatibleCommand(std::string const & s);
106 int latex(odocstream &, OutputParams const &) const;
107 /// Does nothing yet.
108 docstring xhtml(odocstream &, OutputParams const &) const;
110 void doDispatch(Cursor & cur, FuncRequest & cmd);
112 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
114 virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
116 /// Updates needed features for this inset.
117 void validate(LaTeXFeatures & features) const;
119 bool hasSettings() const;
122 DisplayType display() const { return AlignCenter; }
124 docstring screenLabel() const;
126 Inset * clone() const { return new InsetPrintIndex(*this); }