]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTabular.h
prefs/tabular MVC work
[lyx.git] / src / frontends / controllers / ControlTabular.h
1 // -*- C++ -*-
2 /**
3  * \file ControlTabular.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS
10  *
11  * This is pretty icky, we should really be able to use
12  * ControlInset. We can't because there are no params for
13  * tabular inset.
14  */
15
16 #ifndef CONTROLTABULAR_H
17 #define CONTROLTABULAR_H
18
19 #include "ControlConnections.h"
20 #include "LString.h"
21 #include "tabular.h"
22
23 #include <boost/signals/connection.hpp>
24
25 class InsetTabular;
26
27 class ControlTabular : public ControlConnectBD {
28 public:
29
30         ControlTabular(LyXView &, Dialogs &);
31
32         /// get the inset
33         InsetTabular * inset() const;
34  
35         /// get the contained tabular
36         LyXTabular * tabular() const;
37
38         /// set a parameter
39         void set(LyXTabular::Feature, string const & arg = string());
40
41         /// slot launching dialog to an existing inset.
42         void showInset(InsetTabular *);
43  
44         /// update inset
45         void updateInset(InsetTabular *);
46  
47         /// return true if units should default to metric
48         bool metric() const;
49  
50 private:
51
52         /// we can't do this ...
53         virtual void apply() {};
54         /// disconnect signals and hide View.
55         virtual void hide();
56         /// update the dialog.
57         virtual void update();
58
59         /** Instantiation of ControlConnectBD private virtual method.
60             Slot connected to update signal. */
61         virtual void updateSlot(bool);
62
63         /// show the dialog.
64         void show(InsetTabular *);
65         /// connect signals
66         void connectInset(InsetTabular *);
67
68         /// pointer to the inset passed through connectInset
69         InsetTabular * inset_;
70         /// inset::hide connection.
71         boost::signals::connection ih_;
72  
73         /// is the dialog built ?
74         bool dialog_built_;
75 };
76
77 #endif // CONTROLTABULAR_H