]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/emptytable.h
dont use pragma impementation and interface anymore
[lyx.git] / src / frontends / qt2 / 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
16 #include <qpainter.h>
17 #include "qttableview.h"
18
19 /**
20  * A simple widget for a quick "preview" in TabularCreateDialog.
21  * The user can drag on the widget to change the table dimensions.
22  */
23 class EmptyTable : public QtTableView {
24         Q_OBJECT
25 public:
26         EmptyTable(QWidget * parent = 0, const char * name = 0);
27
28         ~EmptyTable() {}
29
30         virtual QSize sizeHint() const;
31 public slots:
32         /// set the number of columns in the table and emit colsChanged() signal
33         void setNumberColumns(int nr_cols);
34         /// set the number of rows in the table and emit rowsChanged() signal
35         void setNumberRows(int nr_rows);
36 signals:
37         /// the number of columns changed
38         void colsChanged(int);
39         /// the number of rows changed
40         void rowsChanged(int);
41 protected:
42         /// fill in a cell
43         virtual void paintCell(class QPainter *, int, int);
44         virtual void mouseMoveEvent(QMouseEvent *);
45 private:
46         /// number of current columns
47         unsigned int cols;
48         /// number of current rows
49         unsigned int rows;
50 };
51
52 #endif