]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlMinipage.h
Controller-view split of Graphics and Index popups.
[lyx.git] / src / frontends / controllers / ControlMinipage.h
1 /* This file is part of
2  * ======================================================
3  * 
4  *           LyX, The Document Processor
5  *       
6  *          Copyright 2001 The LyX Team.
7  *
8  *======================================================
9  *
10  * \file ControlMinipage.h
11  * \author Juergen Vigna, jug@sad.it
12  * \author Angus Leeming, a.leeming@ic.ac.uk
13  */
14
15 #ifndef CONTROLMINIPAGE_H
16 #define CONTROLMINIPAGE_H
17
18 #include <vector>
19
20 #ifdef __GNUG__
21 #pragma interface
22 #endif
23
24 #include "ControlInset.h"
25 #include "insets/insetminipage.h" // InsetMinipage::Position
26
27 /** This should be moved back into insetminipage.h and InsetMinipage should
28     contain an instance of it. */
29
30 struct MinipageParams {
31         ///
32         MinipageParams();
33         ///
34         MinipageParams(InsetMinipage const &);
35         ///
36         bool operator==(MinipageParams const &) const;
37         ///
38         bool operator!=(MinipageParams const &) const;
39         
40         ///
41         string width;
42         ///
43         int widthp;
44         ///
45         InsetMinipage::Position pos;
46 };
47
48
49 class InsetMinipage;
50 class MinipageParams;
51
52 /** A controller for Minipage dialogs.
53  */
54 class ControlMinipage : public ControlInset<InsetMinipage, MinipageParams>  {
55 public:
56         ///
57         ControlMinipage(LyXView &, Dialogs &);
58
59 private:
60         /// Dispatch the changed parameters to the kernel.
61         virtual void applyParamsToInset();
62         /// 
63         virtual void applyParamsNoInset();
64         /// get the parameters from the string passed to createInset.
65         virtual MinipageParams const getParams(string const &)
66                 { return MinipageParams(); }
67         /// get the parameters from the inset passed to showInset.
68         virtual MinipageParams const getParams(InsetMinipage const &);
69 };
70
71 /// Helper functions
72 namespace minipage {
73
74         std::vector<string> const getUnits();
75
76 } //  namespace minipage
77
78 #endif