]> git.lyx.org Git - lyx.git/blob - src/insets/insetwrap.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[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 "lyxlength.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(LyXLex &);
29
30         ///
31         std::string type;
32         ///
33         std::string placement;
34         ///
35         LyXLength 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, LyXLex & lex);
51         ///
52         void validate(LaTeXFeatures & features) const;
53         ///
54         InsetBase::Code lyxCode() const { return InsetBase::WRAP_CODE; }
55         ///
56         int latex(Buffer const &, odocstream &,
57                   OutputParams const &) const;
58         ///
59         int docbook(Buffer const &, odocstream &,
60                     OutputParams const &) const;
61         ///
62         virtual docstring const editMessage() const;
63         ///
64         bool insetAllowed(InsetBase::Code) const;
65         ///
66         void addToToc(TocList &, Buffer const &) const;
67         ///
68         bool showInsetDialog(BufferView *) const;
69         ///
70         InsetWrapParams const & params() const { return params_; }
71         ///
72         bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
73 protected:
74         ///
75         virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
76 private:
77         virtual std::auto_ptr<InsetBase> doClone() const;
78
79         ///
80         InsetWrapParams params_;
81 };
82
83
84 class InsetWrapMailer : public MailInset {
85 public:
86         ///
87         InsetWrapMailer(InsetWrap & inset);
88         ///
89         virtual InsetBase & inset() const { return inset_; }
90         ///
91         virtual std::string const & name() const { return name_; }
92         ///
93         virtual std::string const inset2string(Buffer const &) const;
94         ///
95         static void string2params(std::string const &, InsetWrapParams &);
96         ///
97         static std::string const params2string(InsetWrapParams const &);
98 private:
99         ///
100         static std::string const name_;
101         ///
102         InsetWrap & inset_;
103 };
104
105
106 } // namespace lyx
107
108 #endif