]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlFloat.h
This file is part of LyX, the document processor.
[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 #include <vector>
16
17 #ifdef __GNUG__
18 #pragma interface
19 #endif
20
21 #include "ControlInset.h"
22
23 // needed to instatiate inset->hideDialog in ControlInset
24 #include "insets/insetfloat.h"
25
26 class InsetFloat;
27
28 ///
29 struct FloatParams {
30         ///
31         FloatParams();
32         ///
33         FloatParams(InsetFloat const &);
34         ///
35         string placement;
36         ///
37         bool wide;
38 };
39
40
41 inline
42 bool operator==(FloatParams const & p1, FloatParams const & p2)
43 {
44         return p1.placement == p2.placement && p1.wide == p2.wide;
45 }
46
47
48 inline
49 bool operator!=(FloatParams const & p1, FloatParams const & p2)
50 {
51         return !(p1 == p2);
52 }
53
54
55 /** A controller for Minipage dialogs.
56  */
57 class ControlFloat : public ControlInset<InsetFloat, FloatParams>  {
58 public:
59         ///
60         ControlFloat(LyXView &, Dialogs &);
61 private:
62         /// Dispatch the changed parameters to the kernel.
63         virtual void applyParamsToInset();
64         ///
65         virtual void applyParamsNoInset();
66         /// get the parameters from the string passed to createInset.
67         virtual FloatParams const getParams(string const &)
68                 { return FloatParams(); }
69         /// get the parameters from the inset passed to showInset.
70         virtual FloatParams const getParams(InsetFloat const &);
71 };
72
73 #endif