]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlFloat.h
Really dull and boring header shit
[lyx.git] / src / frontends / controllers / ControlFloat.h
1 // -*- C++ -*-
2 /**
3  * \file ControlFloat.h
4  * Read the file COPYING
5  *
6  * \author unknown
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #ifndef CONTROLFLOAT_H
12 #define CONTROLFLOAT_H
13
14 #include <vector>
15
16 #ifdef __GNUG__
17 #pragma interface
18 #endif
19
20 #include "ControlInset.h"
21
22 // needed to instatiate inset->hideDialog in ControlInset
23 #include "insets/insetfloat.h"
24
25 class InsetFloat;
26
27 ///
28 struct FloatParams {
29         ///
30         FloatParams();
31         ///
32         FloatParams(InsetFloat const &);
33         ///
34         string placement;
35         ///
36         bool wide;
37 };
38
39
40 inline
41 bool operator==(FloatParams const & p1, FloatParams const & p2)
42 {
43         return p1.placement == p2.placement && p1.wide == p2.wide;
44 }
45
46
47 inline
48 bool operator!=(FloatParams const & p1, FloatParams const & p2)
49 {
50         return !(p1 == p2);
51 }
52
53
54 /** A controller for Minipage dialogs.
55  */
56 class ControlFloat : public ControlInset<InsetFloat, FloatParams>  {
57 public:
58         ///
59         ControlFloat(LyXView &, Dialogs &);
60 private:
61         /// Dispatch the changed parameters to the kernel.
62         virtual void applyParamsToInset();
63         ///
64         virtual void applyParamsNoInset();
65         /// get the parameters from the string passed to createInset.
66         virtual FloatParams const getParams(string const &)
67                 { return FloatParams(); }
68         /// get the parameters from the inset passed to showInset.
69         virtual FloatParams const getParams(InsetFloat const &);
70 };
71
72 #endif