]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/emptytable.h
rename LFUN enum values according to their command (as used in th minibuffer/bind...
[lyx.git] / src / frontends / qt4 / emptytable.h
1 // -*- C++ -*-
2 /**
3  * \file emptytable.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
12 #ifndef EMPTYTABLE_H
13 #define EMPTYTABLE_H
14
15 //#include <QMouseEvent>
16 #include <QTableWidget>
17
18 class QMouseEvent;
19
20 /**
21  * A simple widget for a quick "preview" in TabularCreateDialog.
22  * The user can drag on the widget to change the table dimensions.
23  */
24 class EmptyTable : public QTableWidget {
25         Q_OBJECT
26 public:
27         EmptyTable(QWidget * parent = 0, int rows = 5, int columns = 5);
28
29         ~EmptyTable() {}
30
31         virtual QSize sizeHint() const;
32 public slots:
33         /// set the number of columns in the table and emit colsChanged() signal
34         void setNumberColumns(int nr_cols);
35         /// set the number of rows in the table and emit rowsChanged() signal
36         void setNumberRows(int nr_rows);
37 signals:
38         /// the number of columns changed
39         void colsChanged(int);
40         /// the number of rows changed
41         void rowsChanged(int);
42 protected:
43         /// fill in a cell
44         virtual void paintCell(class QPainter *, int, int);
45 //      virtual void mouseMoveEvent(QMouseEvent *);
46
47         /// Reset all the cell size to default
48         virtual void resetCellSize();
49
50 private:
51         /// number of current columns
52         unsigned int cols;
53         /// number of current rows
54         unsigned int rows;
55
56 };
57
58 #endif