]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTabular.h
rename getExtFromContents() to getFormatFromContents()
[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 "Dialog.h"
20 #include "tabular.h"
21
22 namespace lyx {
23 namespace frontend {
24
25 class ControlTabular : public Dialog::Controller {
26 public:
27
28         ControlTabular(Dialog &);
29         ///
30         virtual bool initialiseParams(std::string const & data);
31         /// clean-up on hide.
32         virtual void clearParams();
33         /// We use set() instead.
34         virtual void dispatchParams() {};
35         ///
36         virtual bool isBufferDependent() const { return true; }
37
38         ///
39         int getActiveCell() const;
40         /// get the contained tabular
41         LyXTabular const & tabular() const;
42         /// return true if units should default to metric
43         bool useMetricUnits() const;
44         /// set a parameter
45         void set(LyXTabular::Feature, std::string const & arg = std::string());
46
47         /// borders
48         void toggleTopLine();
49         void toggleBottomLine();
50         void toggleLeftLine();
51         void toggleRightLine();
52
53         void setSpecial(std::string const & special);
54
55         void setWidth(std::string const & width);
56
57         void toggleMultiColumn();
58
59         void rotateTabular(bool yes);
60         void rotateCell(bool yes);
61
62         enum HALIGN { LEFT, RIGHT, CENTER, BLOCK };
63
64         void halign(HALIGN h);
65
66         enum VALIGN { TOP, MIDDLE, BOTTOM };
67
68         void valign(VALIGN h);
69
70         void longTabular(bool yes);
71
72 private:
73         ///
74         int active_cell_;
75         ///
76         boost::scoped_ptr<LyXTabular> params_;
77 };
78
79 } // namespace frontend
80 } // namespace lyx
81
82 #endif // CONTROLTABULAR_H