]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlFloat.h
* John's maths patch,
[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
37
38 inline
39 bool operator==(FloatParams const & p1, FloatParams const & p2) 
40 {
41         return p1.placement == p2.placement;
42 }
43
44
45 inline
46 bool operator!=(FloatParams const & p1, FloatParams const & p2) 
47 {
48         return !(p1 == p2);
49 }
50
51
52 /** A controller for Minipage dialogs.
53  */
54 class ControlFloat : public ControlInset<InsetFloat, FloatParams>  {
55 public:
56         ///
57         ControlFloat(LyXView &, Dialogs &);
58 private:
59         /// Dispatch the changed parameters to the kernel.
60         virtual void applyParamsToInset();
61         /// 
62         virtual void applyParamsNoInset();
63         /// get the parameters from the string passed to createInset.
64         virtual FloatParams const getParams(string const &)
65                 { return FloatParams(); }
66         /// get the parameters from the inset passed to showInset.
67         virtual FloatParams const getParams(InsetFloat const &);
68 };
69
70 #endif