]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QBrowseBox.h
Minipage is no more (long live the box inset)
[lyx.git] / src / frontends / qt2 / QBrowseBox.h
1 // -*- C++ -*-
2 /**
3  * \file QBrowseBox.h
4  *
5  * Original file taken from klyx 0.10 sources:
6  *
7  * \author Kalle Dalheimer
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef QBROWSEBOX_H
13 #define QBROWSEBOX_H
14
15 #include "qgridview.h"
16
17
18 class QString;
19 class QPainter;
20 class QPixmap;
21
22
23 class QBrowseBox : public QGridView
24 {
25         Q_OBJECT
26 public:
27         QBrowseBox(int rows, int cols, QWidget * parent = 0, const char * name = 0, WFlags f = 0);
28         ~QBrowseBox();
29
30         void insertItem(QPixmap pixmap);
31
32         QPixmap pixmap(int row, int col);
33
34         int exec(const QPoint & pos);
35         int exec(int x, int y);
36         int exec(const QWidget * trigger);
37
38 signals:
39         void selected(int, int);
40
41 protected:
42         virtual void keyPressEvent(QKeyEvent * e);
43         virtual void contentsMouseReleaseEvent(QMouseEvent *);
44         virtual void closeEvent(QCloseEvent * e);
45         virtual void contentsMouseMoveEvent(QMouseEvent * e);
46         virtual void paintCell(QPainter *, int row, int col);
47
48 private:
49         // make sure the automatically generated one is not used
50         QBrowseBox & operator=(QBrowseBox const &);
51
52         void moveLeft();
53         void moveRight();
54         void moveUp();
55         void moveDown();
56
57         void insertItem(QPixmap pixmap, int row, int col);
58
59         int coordsToIndex(int row, int col);
60
61         QPixmap* pixmaps_;
62         QPoint activecell_;
63         bool firstrelease_;
64         bool inloop;
65
66 };
67 #endif