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 *, 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 ColorCode labelColor() const;
56 void write(std::ostream & os) const;
58 void read(Lexer & lex);
60 int docbook(odocstream &, OutputParams const &) const;
62 docstring xhtml(XHTMLStream &, OutputParams const &) const;
64 int latex(odocstream &, OutputParams const &) const;
66 bool showInsetDialog(BufferView *) const;
68 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
70 void doDispatch(Cursor & cur, FuncRequest & cmd);
71 /// should paragraph indendation be omitted in any case?
72 bool neverIndent() const { return true; }
74 void addToToc(DocIterator const &);
76 docstring toolTip(BufferView const & bv, int x, int y) const;
78 docstring const buttonLabel(BufferView const & bv) const;
79 /// Updates needed features for this inset.
80 void validate(LaTeXFeatures & features) const;
82 docstring contextMenu(BufferView const & bv, int x, int y) const;
84 Inset * clone() const { return new InsetIndex(*this); }
87 friend class InsetIndexParams;
89 InsetIndexParams params_;
93 class InsetPrintIndex : public InsetCommand {
96 InsetPrintIndex(Buffer * buf, InsetCommandParams const &);
98 /// \name Public functions inherited from Inset class
101 InsetCode lyxCode() const { return INDEX_PRINT_CODE; }
103 int latex(odocstream &, OutputParams const &) const;
105 docstring xhtml(XHTMLStream &, OutputParams const &) const;
107 void doDispatch(Cursor & cur, FuncRequest & cmd);
109 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
111 docstring contextMenu(BufferView const & bv, int x, int y) const;
112 /// Updates needed features for this inset.
113 void validate(LaTeXFeatures & features) const;
115 bool hasSettings() const;
117 DisplayType display() const { return AlignCenter; }
120 /// \name Static public methods obligated for InsetCommand derived classes
123 static ParamInfo const & findInfo(std::string const &);
125 static std::string defaultCommand() { return "printindex"; }
127 static bool isCompatibleCommand(std::string const & s);
131 /// \name Private functions inherited from Inset class
134 Inset * clone() const { return new InsetPrintIndex(*this); }
137 /// \name Private functions inherited from InsetCommand class
140 docstring screenLabel() const;