]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlWrap.h
ws fixes, formatting and some other small changes
[lyx.git] / src / frontends / controllers / ControlWrap.h
1 // -*- C++ -*-
2 /**
3  * \file ControlWrap.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Dekel Tsur
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef CONTROLWRAP_H
13 #define CONTROLWRAP_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "ControlInset.h"
20 #include "lyxlength.h"
21
22 // needed to instatiate inset->hideDialog in ControlInset
23 #include "insets/insetwrap.h"
24
25 class InsetWrap;
26
27 ///
28 struct WrapParams {
29         ///
30         WrapParams() {}
31         ///
32         WrapParams(InsetWrap const &);
33         ///
34         LyXLength pageWidth;
35         ///
36         string placement;
37 };
38
39
40 inline
41 bool operator==(WrapParams const & p1, WrapParams const & p2)
42 {
43         return p1.pageWidth == p2.pageWidth && p1.placement == p2.placement;
44 }
45
46
47 inline
48 bool operator!=(WrapParams const & p1, WrapParams const & p2)
49 {
50         return !(p1 == p2);
51 }
52
53
54 /** A controller for Minipage dialogs.
55  */
56 class ControlWrap : public ControlInset<InsetWrap, WrapParams>  {
57 public:
58         ///
59         ControlWrap(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 WrapParams const getParams(string const &)
67                 { return WrapParams(); }
68         /// get the parameters from the inset passed to showInset.
69         virtual WrapParams const getParams(InsetWrap const &);
70 };
71
72 #endif