]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/qsetborder.h
some fixes
[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 drawLine(bool set, int x, int y, int x2, int y2);
54  
55         void drawLeft(bool);
56         void drawRight(bool);
57         void drawTop(bool);
58         void drawBottom(bool);
59
60         bool left_;
61         bool right_;
62         bool top_;
63         bool bottom_;
64
65         int m;
66         int l;
67         int w;
68         int h;
69
70         QPixmap buffer;
71 };
72  
73 #endif // QSETBORDER_H