]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiTabular.h
math stuff
[lyx.git] / src / frontends / qt4 / GuiTabular.h
1 // -*- C++ -*-
2 /**
3  * \file GuiTabular.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  * \author Kalle Dalheimer
9  * \author Jürgen Spitzmüller
10  * \author Herbert Voß
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef GUITABULAR_H
16 #define GUITABULAR_H
17
18 #include "GuiDialog.h"
19 #include "ui_TabularUi.h"
20 #include "insets/InsetTabular.h"
21
22 namespace lyx {
23 namespace frontend {
24
25 class GuiTabular : public GuiDialog, public Ui::TabularUi, public Controller
26 {
27         Q_OBJECT
28
29 public:
30         GuiTabular(LyXView & lv);
31         ~GuiTabular();
32
33 private Q_SLOTS:
34         void change_adaptor();
35
36         void topspace_changed();
37         void bottomspace_changed();
38         void interlinespace_changed();
39         void booktabsChanged(bool);
40         void close_clicked();
41         void borderSet_clicked();
42         void borderUnset_clicked();
43         void leftBorder_changed();
44         void rightBorder_changed();
45         void topBorder_changed();
46         void bottomBorder_changed();
47         void multicolumn_clicked();
48         void rotateTabular();
49         void rotateCell();
50         void hAlign_changed(int align);
51         void vAlign_changed(int align);
52         void specialAlignment_changed();
53         void width_changed();
54         void longTabular();
55         void ltNewpage_clicked();
56         void ltHeaderStatus_clicked();
57         void ltHeaderBorderAbove_clicked();
58         void ltHeaderBorderBelow_clicked();
59         void ltFirstHeaderStatus_clicked();
60         void ltFirstHeaderBorderAbove_clicked();
61         void ltFirstHeaderBorderBelow_clicked();
62         void ltFirstHeaderEmpty_clicked();
63         void ltFooterStatus_clicked();
64         void ltFooterBorderAbove_clicked();
65         void ltFooterBorderBelow_clicked();
66         void ltLastFooterStatus_clicked();
67         void ltLastFooterBorderAbove_clicked();
68         void ltLastFooterBorderBelow_clicked();
69         void ltLastFooterEmpty_clicked();
70
71 private:
72         ///
73         void closeEvent(QCloseEvent * e);
74         /// parent controller
75         Controller & controller() { return *this; }
76         ///
77         bool isValid() { return true; }
78         /// update borders
79         void update_borders();
80         /// update
81         void updateContents();
82         /// save some values before closing the gui
83         void closeGUI();
84         ///
85         bool initialiseParams(std::string const & data);
86         /// clean-up on hide.
87         void clearParams();
88         /// We use set() instead.
89         void dispatchParams() {};
90         ///
91         bool isBufferDependent() const { return true; }
92         ///
93         kb_action getLfun() const { return LFUN_TABULAR_FEATURE; }
94
95         ///
96         Tabular::idx_type getActiveCell() const;
97         /// return true if units should default to metric
98         bool useMetricUnits() const;
99         /// set a parameter
100         void set(Tabular::Feature, std::string const & arg = std::string());
101
102         /// borders
103         void toggleTopLine();
104         void toggleBottomLine();
105         void toggleLeftLine();
106         void toggleRightLine();
107
108         void setSpecial(std::string const & special);
109
110         void setWidth(std::string const & width);
111
112         void toggleMultiColumn();
113
114         void rotateTabular(bool yes);
115         void rotateCell(bool yes);
116
117         enum HALIGN { LEFT, RIGHT, CENTER, BLOCK };
118
119         void halign(HALIGN h);
120
121         enum VALIGN { TOP, MIDDLE, BOTTOM };
122
123         void valign(VALIGN h);
124
125         void booktabs(bool yes);
126
127         void longTabular(bool yes);
128
129         ///
130         Tabular::idx_type active_cell_;
131         ///
132         Tabular tabular_;
133 };
134
135 } // namespace frontend
136 } // namespace lyx
137
138 #endif // GUITABULAR_H