]> git.lyx.org Git - lyx.git/blob - src/insets/insetwrap.h
changelogs
[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 "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         std::string type;
28         ///
29         std::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 &, std::string const &);
41         ///
42         ~InsetWrap();
43         ///
44         void write(Buffer const & buf, std::ostream & os) const;
45         ///
46         void read(Buffer const & buf, LyXLex & lex);
47         ///
48         void validate(LaTeXFeatures & features) const;
49         ///
50         InsetOld::Code lyxCode() const { return InsetOld::WRAP_CODE; }
51         ///
52         int latex(Buffer const &, std::ostream &,
53                   OutputParams const &) const;
54         ///
55         int docbook(Buffer const &, std::ostream &,
56                     OutputParams const &) const;
57         ///
58         std::string const editMessage() const;
59         ///
60         bool insetAllowed(InsetOld::Code) const;
61         ///
62         void addToToc(lyx::toc::TocList &, Buffer const &) const;
63         ///
64         bool showInsetDialog(BufferView *) const;
65         ///
66         InsetWrapParams const & params() const { return params_; }
67 protected:
68         ///
69         virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
70 private:
71         virtual std::auto_ptr<InsetBase> doClone() const;
72
73         ///
74         InsetWrapParams params_;
75 };
76
77
78
79 #include "mailinset.h"
80
81
82 class InsetWrapMailer : public MailInset {
83 public:
84         ///
85         InsetWrapMailer(InsetWrap & inset);
86         ///
87         virtual InsetBase & inset() const { return inset_; }
88         ///
89         virtual std::string const & name() const { return name_; }
90         ///
91         virtual std::string const inset2string(Buffer const &) const;
92         ///
93         static void string2params(std::string const &, InsetWrapParams &);
94         ///
95         static std::string const params2string(InsetWrapParams const &);
96 private:
97         ///
98         static std::string const name_;
99         ///
100         InsetWrap & inset_;
101 };
102
103 #endif