]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlFloat.h
table selection fix from John; Here & wide figures fix from Michael K.
[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 class InsetFloat;
26
27 ///
28 struct FloatParams {
29         ///
30         FloatParams();
31         ///
32         FloatParams(InsetFloat const &);
33         ///
34         string placement;
35         ///
36         bool allow_here_definitely;
37 };
38
39
40 inline
41 bool operator==(FloatParams const & p1, FloatParams const & p2) 
42 {
43         return p1.placement == p2.placement && p1.allow_here_definitely == p2.allow_here_definitely;
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