]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/InsertTableWidget.h
GUI API Cleanup step 2: merge of the "younes" branch. What's missing
[lyx.git] / src / frontends / qt4 / InsertTableWidget.h
1 // -*- C++ -*-\r
2 /**\r
3  * \file InsertTableWidget.h\r
4  * This file is part of LyX, the document processor.\r
5  * Licence details can be found in the file COPYING.\r
6  *\r
7  * \author Edwin Leuven\r
8  *\r
9  * Full author contact details are available in file CREDITS.\r
10  */\r
11 \r
12 \r
13 #ifndef INSERTTABLEWIDGET_H\r
14 #define INSERTTABLEWIDGET_H\r
15 \r
16 #include "frontends/LyXView.h"\r
17 #include <QWidget>\r
18 \r
19 namespace lyx {\r
20 namespace frontend {\r
21 \r
22 \r
23 class InsertTableWidget : public QWidget {\r
24         Q_OBJECT\r
25 public:\r
26 \r
27         InsertTableWidget(LyXView &, QWidget *);\r
28 \r
29 signals:\r
30         //! widget is visible\r
31         void visible(bool);\r
32 \r
33 public slots:\r
34         //! show the widget\r
35         void show(bool);\r
36         //! enable/disable parent\r
37         void updateParent();\r
38 \r
39 protected slots:\r
40         void mouseMoveEvent(QMouseEvent *);\r
41         void mouseReleaseEvent(QMouseEvent *);\r
42         void mousePressEvent(QMouseEvent *);\r
43         void paintEvent(QPaintEvent *);\r
44         \r
45 private:\r
46         //! update the geometry\r
47         void resetGeometry();\r
48         //! initialize parameters to default values\r
49         void init();\r
50         //! draw the grid\r
51         void drawGrid(int rows, int cols, Qt::GlobalColor color);\r
52 \r
53         //! colwidth in pixels\r
54         int colwidth_;\r
55         //! rowheight in pixels\r
56         int rowheight_;\r
57         //! total rows\r
58         int rows_;\r
59         //! total cols\r
60         int cols_;\r
61         //! row of pointer\r
62         int bottom_;\r
63         //! column of pointer\r
64         int right_;     \r
65         //! the lyxview we need to dispatch the funcrequest\r
66         LyXView & lyxView_;\r
67         //! widget under mouse\r
68         bool underMouse_;\r
69 };\r
70 \r
71 } // namespace frontend\r
72 } // namespace lyx\r
73 \r
74 #endif // INSERTTABLEWIDGET_H\r