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