]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlFloat.C
1a594d63eae617f726ac084bdc5463053349d61c
[lyx.git] / src / frontends / controllers / ControlFloat.C
1 /* This file is part of
2  * ======================================================
3  *
4  *           LyX, The Document Processor
5  *
6  *           Copyright 2001 The LyX Team.
7  *
8  * ======================================================
9  *
10  */
11
12 #include <config.h>
13
14 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "ControlFloat.h"
19 #include "ViewBase.h"
20 #include "ButtonControllerBase.h"
21 #include "Dialogs.h"
22 #include "buffer.h"
23 #include "BufferView.h"
24
25 #include "insets/insetfloat.h"
26 #include "frontends/LyXView.h"
27
28 #include "ControlInset.tmpl"
29
30 #include <boost/bind.hpp>
31
32 using std::vector;
33
34
35 ControlFloat::ControlFloat(LyXView & lv, Dialogs & d)
36         : ControlInset<InsetFloat, FloatParams>(lv, d)
37 {
38         d_.showFloat = boost::bind(&ControlFloat::showInset, this, _1);
39
40         // We could have an extra method updateInset that calls
41         // view().update() rather than view().show(), but I don't see why
42         // it is really needed.
43         //d_.updateFloat.connect(slot(this, &ControlFloat::showInset));
44 }
45
46
47 void ControlFloat::applyParamsToInset()
48 {
49         inset()->placement(params().placement);
50 }
51
52
53 void ControlFloat::applyParamsNoInset()
54 {}
55
56
57 FloatParams const ControlFloat::getParams(InsetFloat const & inset)
58 {
59         return FloatParams(inset);
60 }
61
62
63 FloatParams::FloatParams()
64         : placement("htbp"),
65           allow_here_definitely(true)
66 {}
67
68
69 FloatParams::FloatParams(InsetFloat const & inset)
70         : placement(inset.placement()),
71           allow_here_definitely(!inset.wide())
72 {}