4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_PHANTOM_H
13 #define INSET_PHANTOM_H
15 #include "InsetCollapsible.h"
20 class InsetPhantomParams
28 /// \c type defaults to Phantom
31 void write(std::ostream & os) const;
33 void read(Lexer & lex);
39 /////////////////////////////////////////////////////////////////////////
43 /////////////////////////////////////////////////////////////////////////
46 class InsetPhantom : public InsetCollapsible
50 InsetPhantom(Buffer *, std::string const &);
54 static std::string params2string(InsetPhantomParams const &);
56 static void string2params(std::string const &, InsetPhantomParams &);
58 InsetPhantomParams const & params() const { return params_; }
61 InsetCode lyxCode() const override { return PHANTOM_CODE; }
63 docstring layoutName() const override;
65 void draw(PainterInfo & pi, int x, int y) const override;
67 void write(std::ostream &) const override;
69 void read(Lexer & lex) override;
71 void setButtonLabel() override;
72 /// show the phantom dialog
73 bool showInsetDialog(BufferView * bv) const override;
75 bool neverIndent() const override { return true; }
77 void latex(otexstream &, OutputParams const &) const override;
79 int plaintext(odocstringstream & ods, OutputParams const & op,
80 size_t max_length = INT_MAX) const override;
82 void docbook(XMLStream &, OutputParams const &) const override;
83 /// Makes no sense for XHTML.
84 docstring xhtml(XMLStream &, OutputParams const &) const override;
86 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
88 void doDispatch(Cursor & cur, FuncRequest & cmd) override;
90 docstring toolTip(BufferView const & bv, int x, int y) const override;
92 Inset * clone() const override { return new InsetPhantom(*this); }
93 /// used by the constructors
96 std::string contextMenuName() const override;
98 friend class InsetPhantomParams;
101 InsetPhantomParams params_;
107 #endif // INSET_PHANTOM_H