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 "InsetCollapsible.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 InsetCollapsible {
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 layoutName() const { return from_ascii("Index"); }
54 ColorCode labelColor() const;
56 void write(std::ostream & os) const;
58 void read(Lexer & lex);
60 void docbook(XMLStream &, OutputParams const &) const;
62 docstring xhtml(XMLStream &, OutputParams const &) const;
64 void latex(otexstream &, 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 indentation be omitted in any case?
72 bool neverIndent() const { return true; }
74 void addToToc(DocIterator const & di, bool output_active,
75 UpdateType utype, TocBackend & backend) const;
77 docstring toolTip(BufferView const & bv, int x, int y) const;
79 docstring const buttonLabel(BufferView const & bv) const;
80 /// Updates needed features for this inset.
81 void validate(LaTeXFeatures & features) const;
83 std::string contextMenuName() const;
85 Inset * clone() const { return new InsetIndex(*this); }
86 /// Is the content of this inset part of the immediate text sequence?
87 bool isPartOfTextSequence() const { return false; }
90 friend class InsetIndexParams;
92 InsetIndexParams params_;
96 class InsetPrintIndex : public InsetCommand {
99 InsetPrintIndex(Buffer * buf, InsetCommandParams const &);
101 /// \name Public functions inherited from Inset class
104 InsetCode lyxCode() const { return INDEX_PRINT_CODE; }
106 void latex(otexstream &, OutputParams const &) const;
108 docstring xhtml(XMLStream &, OutputParams const &) const;
110 void doDispatch(Cursor & cur, FuncRequest & cmd);
112 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
114 void updateBuffer(ParIterator const & it, UpdateType, bool const deleted = false);
116 std::string contextMenuName() const;
117 /// Updates needed features for this inset.
118 void validate(LaTeXFeatures & features) const;
120 bool hasSettings() const;
122 RowFlags rowFlags() const { return Display; }
125 /// \name Static public methods obligated for InsetCommand derived classes
128 static ParamInfo const & findInfo(std::string const &);
130 static std::string defaultCommand() { return "printindex"; }
132 static bool isCompatibleCommand(std::string const & s);
136 /// \name Private functions inherited from Inset class
139 Inset * clone() const { return new InsetPrintIndex(*this); }
142 /// \name Private functions inherited from InsetCommand class
145 docstring screenLabel() const;