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