]> git.lyx.org Git - lyx.git/blob - src/insets/insetwrap.h
The markDirty() and fitCursor() changes
[lyx.git] / src / insets / insetwrap.h
1 /**
2  * \file insetwrap.h
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Dekel Tsur
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #ifndef InsetWrap_H
12 #define InsetWrap_H
13
14
15 #include "insetcollapsable.h"
16 #include "toc.h"
17 #include "lyxlength.h"
18
19
20 struct InsetWrapParams {
21         ///
22         void write(std::ostream &) const;
23         ///
24         void read(LyXLex &);
25     
26         ///
27         string type;
28         ///
29         string placement;
30         ///
31         LyXLength width;
32 };
33
34
35 /** The wrap inset
36  */
37 class InsetWrap : public InsetCollapsable {
38 public:
39         ///
40         InsetWrap(BufferParams const &, string const &);
41         ///
42         InsetWrap(InsetWrap const &, bool same_id = false);
43         ///
44         ~InsetWrap();
45         ///
46         virtual dispatch_result localDispatch(FuncRequest const & cmd); 
47         ///
48         void write(Buffer const * buf, std::ostream & os) const;
49         ///
50         void read(Buffer const * buf, LyXLex & lex);
51         ///
52         void validate(LaTeXFeatures & features) const;
53         ///
54         Inset * clone(Buffer const &, bool same_id = false) const;
55         ///
56         Inset::Code lyxCode() const { return Inset::WRAP_CODE; }
57         ///
58         int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
59         ///
60         int docbook(Buffer const *, std::ostream &, bool mixcont) const;
61         ///
62         string const editMessage() const;
63         ///
64         bool insetAllowed(Inset::Code) const;
65         ///
66         int getMaxWidth(BufferView *, UpdatableInset const *) const;
67         ///
68         string const & type() const;
69         ///
70         LyXLength const & pageWidth() const;
71         ///
72         void pageWidth(LyXLength const &);
73         ///
74         void placement(string const & p);
75         ///
76         string const & placement() const;
77         ///
78         void addToToc(toc::TocList &, Buffer const *) const;
79         ///
80         bool  showInsetDialog(BufferView *) const;
81         ///
82         int latexTextWidth(BufferView *) const;
83         ///
84         InsetWrapParams const & params() const { return params_; }
85 private:
86         ///
87         InsetWrapParams params_;
88 };
89
90
91
92 #include "mailinset.h"
93
94
95 class InsetWrapMailer : public MailInset {
96 public:
97         ///
98         InsetWrapMailer(InsetWrap & inset);
99         ///
100         virtual InsetBase & inset() const { return inset_; }
101         ///
102         virtual string const & name() const { return name_; }
103         ///
104         virtual string const inset2string() const;
105         ///
106         static void string2params(string const &, InsetWrapParams &);
107         ///
108         static string const params2string(InsetWrapParams const &);
109 private:
110         ///
111         static string const name_;
112         ///
113         InsetWrap & inset_;
114 };
115
116 #endif