3 * \file InsetIndexMacro.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Jürgen Spitzmüller
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_INSETMACRO_H
13 #define INSET_INSETMACRO_H
17 #include "InsetCollapsible.h"
24 class InsetIndexMacroParams
34 InsetIndexMacroParams();
36 void write(std::ostream & os) const;
38 void read(Lexer & lex);
43 /////////////////////////////////////////////////////////////////////////
47 /////////////////////////////////////////////////////////////////////////
49 /// Used to insert index references
50 class InsetIndexMacro : public InsetCollapsible
54 InsetIndexMacro(Buffer *, std::string const &);
58 static std::string params2string(InsetIndexMacroParams const &);
60 static void string2params(std::string const &, InsetIndexMacroParams &);
62 InsetIndexMacroParams const & params() const { return params_; }
64 void getLatex(otexstream &, OutputParams const &) const;
66 int getPlaintext(odocstringstream &, OutputParams const &, size_t) const;
68 void getDocbook(XMLStream &, OutputParams const &) const;
71 InsetCode lyxCode() const override;
73 docstring layoutName() const override;
75 void write(std::ostream &) const override;
77 void read(Lexer & lex) override;
79 bool neverIndent() const override { return true; }
80 /// We do not output anything directly to the stream
81 void latex(otexstream &, OutputParams const &) const override {};
82 /// We do not output anything directly to the stream
83 int plaintext(odocstringstream &, OutputParams const &, size_t) const override { return 0; };
84 /// We do not output anything directly to the stream
85 void docbook(XMLStream &, OutputParams const &) const override {};
86 /// We do not output anything directly to the stream
87 docstring xhtml(XMLStream &, OutputParams const &) const override { return docstring(); };
89 docstring getXhtml(XMLStream &, OutputParams const &) const;
91 bool allowSpellCheck() const override { return false; }
93 bool insetAllowed(InsetCode code) const override;
95 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
97 void doDispatch(Cursor & cur, FuncRequest & cmd) override;
99 docstring toolTip(BufferView const & bv, int x, int y) const override;
101 void processLatexSorting(otexstream &, OutputParams const &,
102 docstring const, docstring const) const;
104 bool hasSortKey() const;
106 void getSortkey(otexstream &, OutputParams const &) const;
108 std::string contextMenuName() const override;
110 std::string contextMenu(BufferView const &, int, int) const override;
112 Inset * clone() const override { return new InsetIndexMacro(*this); }
113 /// used by the constructors
116 friend class InsetIndexMacroParams;
119 InsetIndexMacroParams params_;