]> git.lyx.org Git - lyx.git/blob - src/insets/insetfloat.h
Move InsetFloat's params into a separate struct to simplify the move to the new dialo...
[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
17 #include "insetcollapsable.h"
18 #include "toc.h"
19
20 #include <boost/signals/signal0.hpp>
21
22 class Painter;
23
24 struct InsetFloatParams {
25         ///
26         InsetFloatParams() : placement("htbp"), wide(false) {}
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 &, bool same_id = false);
45         ///
46         ~InsetFloat();
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         Inset * clone(Buffer const &, bool same_id = false) const;
55         ///
56         Inset::Code lyxCode() const { return Inset::FLOAT_CODE; }
57         ///
58         int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
59         ///
60         int docbook(Buffer const *, std::ostream &, bool mixcont) const;
61         ///
62         string const editMessage() const;
63         ///
64         bool insetAllowed(Inset::Code) const;
65         /** returns true if, when outputing LaTeX, font changes should
66             be closed before generating this inset. This is needed for
67             insets that may contain several paragraphs */
68         bool noFontChange() const { return true; }
69         ///
70         string const & type() const;
71         ///
72         void placement(string const & p);
73         ///
74         string const & placement() const;
75         ///
76         void wide(bool w, BufferParams const &);
77         ///
78         bool wide() const;
79         ///
80         void addToToc(toc::TocList &, Buffer const *) const;
81         ///
82         bool  showInsetDialog(BufferView *) const;
83         ///
84         boost::signal0<void> hideDialog;
85         ///
86         InsetFloatParams const & params() const { return params_; }
87         ///
88         void writeParams(std::ostream & os) const;
89         ///
90         void readParams(Buffer const * buf, LyXLex & lex);
91         
92 private:
93         ///
94         InsetFloatParams params_;
95 };
96
97 #endif