]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTabular.h
Juergen S's tabular patch. Good stuff !
[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         /// return true if actual cell is multicolumn
51         bool isMulticolumnCell() const;
52  
53 private:
54
55         /// we can't do this ...
56         virtual void apply() {};
57         /// disconnect signals and hide View.
58         virtual void hide();
59         /// update the dialog.
60         virtual void update();
61
62         /** Instantiation of ControlConnectBD private virtual method.
63             Slot connected to update signal. */
64         virtual void updateSlot(bool);
65
66         /// show the dialog.
67         void show(InsetTabular *);
68         /// connect signals
69         void connectInset(InsetTabular *);
70
71         /// pointer to the inset passed through connectInset
72         InsetTabular * inset_;
73         /// inset::hide connection.
74         boost::signals::connection ih_;
75  
76         /// is the dialog built ?
77         bool dialog_built_;
78 };
79
80 #endif // CONTROLTABULAR_H