]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTabular.h
fix crash due to invalidated iterator
[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         virtual kb_action getLfun() const { return LFUN_TABULAR_FEATURE; }
39
40         ///
41         LyXTabular::idx_type getActiveCell() const;
42         /// get the contained tabular
43         LyXTabular const & tabular() const;
44         /// return true if units should default to metric
45         bool useMetricUnits() const;
46         /// set a parameter
47         void set(LyXTabular::Feature, std::string const & arg = std::string());
48
49         /// borders
50         void toggleTopLine();
51         void toggleBottomLine();
52         void toggleLeftLine();
53         void toggleRightLine();
54
55         void setSpecial(std::string const & special);
56
57         void setWidth(std::string const & width);
58
59         void toggleMultiColumn();
60
61         void rotateTabular(bool yes);
62         void rotateCell(bool yes);
63
64         enum HALIGN { LEFT, RIGHT, CENTER, BLOCK };
65
66         void halign(HALIGN h);
67
68         enum VALIGN { TOP, MIDDLE, BOTTOM };
69
70         void valign(VALIGN h);
71
72         void longTabular(bool yes);
73
74 private:
75         ///
76         LyXTabular::idx_type active_cell_;
77         ///
78         boost::scoped_ptr<LyXTabular> params_;
79 };
80
81 } // namespace frontend
82 } // namespace lyx
83
84 #endif // CONTROLTABULAR_H