]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/dlg/emptytable.h
the rest read the ChangeLog, hope I remembered all
[lyx.git] / src / frontends / kde / dlg / emptytable.h
1 // -*- C++ -*-
2 /*
3  * emptytable.h
4  * (C) 2000 LyX Team
5  * John Levon, moz@compsoc.man.ac.uk
6  */
7
8 /***************************************************************************
9  *                                                                         *
10  *   This program is free software; you can redistribute it and/or modify  *
11  *   it under the terms of the GNU General Public License as published by  *
12  *   the Free Software Foundation; either version 2 of the License, or     *
13  *   (at your option) any later version.                                   *
14  *                                                                         *
15  ***************************************************************************/
16
17 #ifndef EMPTYTABLE_H
18 #define EMPTYTABLE_H
19
20 #include <qpainter.h> 
21 #include <qtableview.h> 
22
23 #include "boost/utility.hpp"
24
25 /**
26  * A simple widget for a quick "preview" in TabularCreateDialog.
27  * The user can drag on the widget to change the table dimensions.
28  */
29 class EmptyTable : public QTableView, boost::noncopyable {
30    Q_OBJECT
31 public:
32         EmptyTable(QWidget * parent = 0, const char * name = 0);
33         
34         ~EmptyTable() {};
35
36 public slots:
37         /// set the number of columns in the table and emit colsChanged() signal 
38         void setNumberColumns(int nr_cols);
39         /// set the number of rows in the table and emit rowsChanged() signal 
40         void setNumberRows(int nr_rows);
41  
42 signals:
43         /// the number of columns changed
44         void colsChanged(unsigned int);
45         /// the number of rows changed
46         void rowsChanged(unsigned int);
47
48 protected:
49         /// fill in a cell
50         virtual void paintCell(class QPainter *, int, int);
51         virtual void mouseMoveEvent(QMouseEvent *);
52         
53 private:
54         /// number of current columns 
55         unsigned int cols;
56         /// number of current rows
57         unsigned int rows;
58 };
59
60 #endif