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 "InsetCollapsable.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 InsetCollapsable
50 InsetPhantom(Buffer const &, 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 docstring editMessage() const;
63 InsetCode lyxCode() const { return PHANTOM_CODE; }
65 docstring name() const;
67 void metrics(MetricsInfo &, Dimension &) const;
69 void draw(PainterInfo & pi, int x, int y) const;
71 void write(std::ostream &) const;
73 void read(Lexer & lex);
75 void setButtonLabel();
76 /// show the phantom dialog
77 bool showInsetDialog(BufferView * bv) const;
79 bool neverIndent() const { return true; }
81 int latex(odocstream &, OutputParams const &) const;
83 int plaintext(odocstream &, OutputParams const &) const;
85 int docbook(odocstream &, OutputParams const &) const;
86 /// Makes no sense fof XHTML.
87 void xhtml(odocstream &, OutputParams const &) const { return; }
89 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
91 void doDispatch(Cursor & cur, FuncRequest & cmd);
93 docstring toolTip(BufferView const & bv, int x, int y) const;
95 Inset * clone() const { return new InsetPhantom(*this); }
96 /// used by the constructors
99 docstring contextMenu(BufferView const & bv, int x, int y) const;
101 friend class InsetPhantomParams;
104 InsetPhantomParams params_;
110 #endif // INSET_PHANTOM_H