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