]> git.lyx.org Git - lyx.git/blob - src/insets/InsetWrap.h
Fix GRAPHICS_EDIT of InsetGraphics
[lyx.git] / src / insets / InsetWrap.h
1 // -*- C++ -*-
2 /**
3  * \file InsetWrap.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Dekel Tsur
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSETWRAP_H
13 #define INSETWRAP_H
14
15 #include "InsetCollapsable.h"
16 #include "Length.h"
17 #include "MailInset.h"
18
19
20 namespace lyx {
21
22
23 class InsetWrapParams {
24 public:
25         ///
26         void write(std::ostream &) const;
27         ///
28         void read(Lexer &);
29
30         ///
31         std::string type;
32         ///
33         int lines;
34         ///
35         std::string placement;
36         ///
37         Length overhang;
38         ///
39         Length width;
40 };
41
42
43 /** The wrap inset
44  */
45 class InsetWrap : public InsetCollapsable {
46 public:
47         ///
48         InsetWrap(Buffer const &, std::string const &);
49         ///
50         ~InsetWrap();
51         ///
52         InsetWrapParams const & params() const { return params_; }
53 private:
54         ///
55         void write(std::ostream & os) const;
56         ///
57         void read(Lexer & lex);
58         ///
59         void validate(LaTeXFeatures & features) const;
60         ///
61         InsetCode lyxCode() const { return WRAP_CODE; }
62         ///
63         int latex(odocstream &, OutputParams const &) const;
64         ///
65         int plaintext(odocstream &, OutputParams const &) const;
66         ///
67         int docbook(odocstream &, OutputParams const &) const;
68         ///
69         docstring editMessage() const;
70         ///
71         bool insetAllowed(InsetCode) const;
72         ///
73         bool showInsetDialog(BufferView *) const;
74         ///
75         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
76         // Update the counters of this inset and of its contents
77         void updateLabels(ParIterator const &);
78         ///
79         void doDispatch(Cursor & cur, FuncRequest & cmd);
80         ///
81         docstring name() const { return name_; }
82         ///
83         Inset * clone() const { return new InsetWrap(*this); }
84
85         ///
86         InsetWrapParams params_;
87         ///
88         docstring name_;
89 };
90
91
92 class InsetWrapMailer : public MailInset {
93 public:
94         ///
95         InsetWrapMailer(InsetWrap & inset);
96         ///
97         virtual Inset & inset() const { return inset_; }
98         ///
99         virtual std::string const & name() const { return name_; }
100         ///
101         virtual std::string const inset2string(Buffer const &) const;
102         ///
103         static void string2params(std::string const &, InsetWrapParams &);
104         ///
105         static std::string const params2string(InsetWrapParams const &);
106 private:
107         ///
108         static std::string const name_;
109         ///
110         InsetWrap & inset_;
111 };
112
113
114 } // namespace lyx
115
116 #endif