]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/InsertTableWidget.h
e3fc0f553d2e4e448e17f7c66af63e535a025ef8
[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 class QSize;\r
20 \r
21 namespace lyx {\r
22 namespace frontend {\r
23 \r
24 \r
25 class InsertTableWidget : public QWidget {\r
26         Q_OBJECT\r
27 public:\r
28 \r
29         InsertTableWidget(LyXView &, FuncRequest const &, QWidget *);\r
30 \r
31 signals:\r
32         //! widget is visible\r
33         void visible(bool);\r
34 \r
35 public slots:\r
36         //! show the widget\r
37         void show(bool);\r
38         //! enable/disable parent\r
39         void updateParent();\r
40 \r
41 protected slots:\r
42         bool event(QEvent *);\r
43         void mouseMoveEvent(QMouseEvent *);\r
44         void mouseReleaseEvent(QMouseEvent *);\r
45         void paintEvent(QPaintEvent *);\r
46         \r
47 private:\r
48         //! update the geometry\r
49         void resetGeometry();\r
50         //! initialize parameters to default values\r
51         void init();\r
52         //! draw the grid\r
53         void drawGrid(int rows, int cols, Qt::GlobalColor color);\r
54 \r
55         //! colwidth in pixels\r
56         int colwidth_;\r
57         //! rowheight in pixels\r
58         int rowheight_;\r
59         //! total rows\r
60         int rows_;\r
61         //! total cols\r
62         int cols_;\r
63         //! row of pointer\r
64         int bottom_;\r
65         //! column of pointer\r
66         int right_;     \r
67         //! the tabular_insert funcrequest\r
68         FuncRequest const & func_ ;\r
69         //! the lyxview we need to dispatch the funcrequest\r
70         LyXView & lyxView_;\r
71         //! widget under mouse\r
72         bool underMouse_;\r
73 };\r
74 \r
75 } // namespace frontend\r
76 } // namespace lyx\r
77 \r
78 #endif // INSERTTABLEWIDGET_H\r