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