]> git.lyx.org Git - lyx.git/blob - src/insets/insetfloat.h
Enable convertDefault.sh to run even if its executable bit is not set.
[lyx.git] / src / insets / insetfloat.h
1 // -*- C++ -*-
2 /**
3  * \file insetfloat.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jürgen Vigna
8  * \author Lars Gullik Bjønnes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef INSETFLOAT_H
14 #define INSETFLOAT_H
15
16 #include "insetcollapsable.h"
17 #include "toc.h"
18
19
20 struct InsetFloatParams {
21         ///
22         InsetFloatParams() : wide(false) {}
23         ///
24         void write(std::ostream & os) const;
25         ///
26         void read(LyXLex & lex);
27         ///
28         string type;
29         ///
30         string placement;
31         ///
32         bool wide;
33 };
34
35
36 /** The float inset
37
38 */
39 class InsetFloat : public InsetCollapsable {
40 public:
41         ///
42         InsetFloat(BufferParams const &, string const &);
43         ///
44         InsetFloat(InsetFloat const &);
45         ///
46         ~InsetFloat();
47         ///
48         virtual dispatch_result localDispatch(FuncRequest const & cmd);
49         ///
50         void write(Buffer const & buf, std::ostream & os) const;
51         ///
52         void read(Buffer const & buf, LyXLex & lex);
53         ///
54         void validate(LaTeXFeatures & features) const;
55         ///
56         virtual std::auto_ptr<InsetBase> clone() const;
57         ///
58         InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; }
59         ///
60         int latex(Buffer const &, std::ostream &,
61                   LatexRunParams const &) const;
62         ///
63         int linuxdoc(Buffer const &, std::ostream &) const;
64         ///
65         int docbook(Buffer const &, std::ostream &, bool mixcont) const;
66         ///
67         string const editMessage() const;
68         ///
69         bool insetAllowed(InsetOld::Code) const;
70         /** returns true if, when outputing LaTeX, font changes should
71             be closed before generating this inset. This is needed for
72             insets that may contain several paragraphs */
73         bool noFontChange() const { return true; }
74         ///
75         void wide(bool w, BufferParams const &);
76         ///
77         void addToToc(lyx::toc::TocList &, Buffer const &) const;
78         ///
79         bool  showInsetDialog(BufferView *) const;
80         ///
81         InsetFloatParams const & params() const { return params_; }
82
83 private:
84         ///
85         InsetFloatParams params_;
86 };
87
88
89 #include "mailinset.h"
90
91
92 class InsetFloatMailer : public MailInset {
93 public:
94         ///
95         InsetFloatMailer(InsetFloat & inset);
96         ///
97         virtual InsetBase & inset() const { return inset_; }
98         ///
99         virtual string const & name() const { return name_; }
100         ///
101         virtual string const inset2string(Buffer const &) const;
102         ///
103         static void string2params(string const &, InsetFloatParams &);
104         ///
105         static string const params2string(InsetFloatParams const &);
106 private:
107         ///
108         static string const name_;
109         ///
110         InsetFloat & inset_;
111 };
112
113 #endif