]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/qsetborder.h
Juergen S's tabular patch. Good stuff !
[lyx.git] / src / frontends / qt2 / qsetborder.h
1 // -*- C++ -*-
2 /**
3  * \file QSetBorder.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Edwin Leuven
8  *
9  * Full author contact details are available in file CREDITS
10  */
11 #ifndef QSETBORDER_H
12 #define QSETBORDER_H
13
14 #include <qwidget.h>
15 #include <qpixmap.h>
16
17 class QMouseEvent;
18 class QResizeEvent;
19 class QPaintEvent;
20
21 class QSetBorder : public QWidget
22 {
23         Q_OBJECT
24 public:
25         QSetBorder(QWidget * parent = 0, char const * name = 0, WFlags fl = 0);
26
27         bool getLeft();
28         bool getRight();
29         bool getTop();
30         bool getBottom();
31
32 signals:
33         void rightSet(bool);
34         void leftSet(bool);
35         void topSet(bool);
36         void bottomSet(bool);
37         void clicked();
38
39 public slots:
40         void setLeft(bool);
41         void setRight(bool);
42         void setTop(bool);
43         void setBottom(bool);
44         void setAll(bool);
45
46 protected:
47         void mousePressEvent(QMouseEvent * e);
48         void paintEvent(QPaintEvent * e);
49         
50 private:
51         void init();
52
53         void drawLeft(bool);
54         void drawRight(bool);
55         void drawTop(bool);
56         void drawBottom(bool);
57
58         bool left_;
59         bool right_;
60         bool top_;
61         bool bottom_;
62
63         int m;
64         int l;
65         int w;
66         int h;
67         
68         QPixmap buffer;
69 };
70  
71 #endif // QSETBORDER_H