]> git.lyx.org Git - lyx.git/blob - src/insets/InsetPhantom.h
Update Win installer for new dictionary links. Untested.
[lyx.git] / src / insets / InsetPhantom.h
1 // -*- C++ -*-
2 /**
3  * \file InsetPhantom.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Uwe Stöhr
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_PHANTOM_H
13 #define INSET_PHANTOM_H
14
15 #include "InsetCollapsible.h"
16
17
18 namespace lyx {
19
20 class InsetPhantomParams
21 {
22 public:
23         enum Type {
24                 Phantom,
25                 HPhantom,
26                 VPhantom
27         };
28         /// \c type defaults to Phantom
29         InsetPhantomParams();
30         ///
31         void write(std::ostream & os) const;
32         ///
33         void read(Lexer & lex);
34         ///
35         Type type;
36 };
37
38
39 /////////////////////////////////////////////////////////////////////////
40 //
41 // InsetPhantom
42 //
43 /////////////////////////////////////////////////////////////////////////
44
45 /// The phantom inset
46 class InsetPhantom : public InsetCollapsible
47 {
48 public:
49         ///
50         InsetPhantom(Buffer *, std::string const &);
51         ///
52         ~InsetPhantom();
53         ///
54         static std::string params2string(InsetPhantomParams const &);
55         ///
56         static void string2params(std::string const &, InsetPhantomParams &);
57         ///
58         InsetPhantomParams const & params() const { return params_; }
59 private:
60         ///
61         InsetCode lyxCode() const override { return PHANTOM_CODE; }
62         ///
63         docstring layoutName() const override;
64         ///
65         void draw(PainterInfo & pi, int x, int y) const override;
66         ///
67         void write(std::ostream &) const override;
68         ///
69         void read(Lexer & lex) override;
70         ///
71         void setButtonLabel() override;
72         /// show the phantom dialog
73         bool showInsetDialog(BufferView * bv) const override;
74         ///
75         bool neverIndent() const override { return true; }
76         ///
77         void latex(otexstream &, OutputParams const &) const override;
78         ///
79         int plaintext(odocstringstream & ods, OutputParams const & op,
80                       size_t max_length = INT_MAX) const override;
81         ///
82         void docbook(XMLStream &, OutputParams const &) const override;
83         /// Makes no sense for XHTML.
84         docstring xhtml(XMLStream &, OutputParams const &) const override;
85         ///
86         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
87         ///
88         void doDispatch(Cursor & cur, FuncRequest & cmd) override;
89         ///
90         docstring toolTip(BufferView const & bv, int x, int y) const override;
91         ///
92         Inset * clone() const override { return new InsetPhantom(*this); }
93         /// used by the constructors
94         void init();
95         ///
96         std::string contextMenuName() const override;
97         ///
98         friend class InsetPhantomParams;
99
100         ///
101         InsetPhantomParams params_;
102 };
103
104
105 } // namespace lyx
106
107 #endif // INSET_PHANTOM_H