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