]> git.lyx.org Git - lyx.git/blob - src/insets/insetwrap.h
Enable convertDefault.sh to run even if its executable bit is not set.
[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
16 #include "insetcollapsable.h"
17 #include "toc.h"
18 #include "lyxlength.h"
19
20
21 struct InsetWrapParams {
22         ///
23         void write(std::ostream &) const;
24         ///
25         void read(LyXLex &);
26
27         ///
28         string type;
29         ///
30         string placement;
31         ///
32         LyXLength width;
33 };
34
35
36 /** The wrap inset
37  */
38 class InsetWrap : public InsetCollapsable {
39 public:
40         ///
41         InsetWrap(BufferParams const &, string const &);
42         ///
43         ~InsetWrap();
44         ///
45         virtual dispatch_result localDispatch(FuncRequest const & cmd);
46         ///
47         void write(Buffer const & buf, std::ostream & os) const;
48         ///
49         void read(Buffer const & buf, LyXLex & lex);
50         ///
51         void validate(LaTeXFeatures & features) const;
52         ///
53         virtual std::auto_ptr<InsetBase> clone() const;
54         ///
55         InsetOld::Code lyxCode() const { return InsetOld::WRAP_CODE; }
56         ///
57         int latex(Buffer const &, std::ostream &,
58                   LatexRunParams const &) const;
59         ///
60         int docbook(Buffer const &, std::ostream &, bool mixcont) const;
61         ///
62         string const editMessage() const;
63         ///
64         bool insetAllowed(InsetOld::Code) const;
65         ///
66         void addToToc(lyx::toc::TocList &, Buffer const &) const;
67         ///
68         bool  showInsetDialog(BufferView *) const;
69         ///
70         int latexTextWidth(BufferView *) const;
71         ///
72         InsetWrapParams const & params() const { return params_; }
73 private:
74         ///
75         InsetWrapParams params_;
76 };
77
78
79
80 #include "mailinset.h"
81
82
83 class InsetWrapMailer : public MailInset {
84 public:
85         ///
86         InsetWrapMailer(InsetWrap & inset);
87         ///
88         virtual InsetBase & inset() const { return inset_; }
89         ///
90         virtual string const & name() const { return name_; }
91         ///
92         virtual string const inset2string(Buffer const &) const;
93         ///
94         static void string2params(string const &, InsetWrapParams &);
95         ///
96         static string const params2string(InsetWrapParams const &);
97 private:
98         ///
99         static string const name_;
100         ///
101         InsetWrap & inset_;
102 };
103
104 #endif