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