]> git.lyx.org Git - lyx.git/blob - src/insets/InsetWrap.h
following rev. 18724 boost/signal is not needed.
[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         std::string placement;
34         ///
35         Length width;
36 };
37
38
39 /** The wrap inset
40  */
41 class InsetWrap : public InsetCollapsable {
42 public:
43         ///
44         InsetWrap(BufferParams const &, std::string const &);
45         ///
46         ~InsetWrap();
47         ///
48         void write(Buffer const & buf, std::ostream & os) const;
49         ///
50         void read(Buffer const & buf, Lexer & lex);
51         ///
52         void validate(LaTeXFeatures & features) const;
53         ///
54         Inset::Code lyxCode() const { return Inset::WRAP_CODE; }
55         ///
56         int latex(Buffer const &, odocstream &,
57                   OutputParams const &) const;
58         ///
59         int plaintext(Buffer const &, odocstream &,
60                       OutputParams const &) const;
61         ///
62         int docbook(Buffer const &, odocstream &,
63                     OutputParams const &) const;
64         ///
65         virtual docstring const editMessage() const;
66         ///
67         bool insetAllowed(Inset::Code) const;
68         ///
69         bool showInsetDialog(BufferView *) const;
70         ///
71         InsetWrapParams const & params() const { return params_; }
72         ///
73         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
74 protected:
75         ///
76         virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
77         ///
78         virtual docstring name() const { return name_; }
79 private:
80         virtual std::auto_ptr<Inset> doClone() const;
81
82         ///
83         InsetWrapParams params_;
84         ///
85         docstring name_;
86 };
87
88
89 class InsetWrapMailer : public MailInset {
90 public:
91         ///
92         InsetWrapMailer(InsetWrap & inset);
93         ///
94         virtual Inset & inset() const { return inset_; }
95         ///
96         virtual std::string const & name() const { return name_; }
97         ///
98         virtual std::string const inset2string(Buffer const &) const;
99         ///
100         static void string2params(std::string const &, InsetWrapParams &);
101         ///
102         static std::string const params2string(InsetWrapParams const &);
103 private:
104         ///
105         static std::string const name_;
106         ///
107         InsetWrap & inset_;
108 };
109
110
111 } // namespace lyx
112
113 #endif