]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/qsetborder.h
Remove quite a few compiler warnings:
[lyx.git] / src / frontends / qt4 / 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  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12 #ifndef QSETBORDER_H
13 #define QSETBORDER_H
14
15 #include <qwidget.h>
16 #include <qpixmap.h>
17 //Added by qt3to4:
18 #include <QMouseEvent>
19 #include <QResizeEvent>
20 #include <QPaintEvent>
21
22 class QColor;
23 class QMouseEvent;
24 class QPaintEvent;
25 class QResizeEvent;
26
27 class QSetBorder : public QWidget
28 {
29         Q_OBJECT
30 public:
31         QSetBorder(QWidget * parent = 0, char const * name = 0, Qt::WFlags fl = 0);
32
33         bool getLeft();
34         bool getRight();
35         bool getTop();
36         bool getBottom();
37
38 Q_SIGNALS:
39         void rightSet(bool);
40         void leftSet(bool);
41         void topSet(bool);
42         void bottomSet(bool);
43         void clicked();
44
45 public Q_SLOTS:
46         void setLeftEnabled(bool);
47         void setRightEnabled(bool);
48         void setTopEnabled(bool);
49         void setBottomEnabled(bool);
50         void setLeft(bool);
51         void setRight(bool);
52         void setTop(bool);
53         void setBottom(bool);
54         void setAll(bool);
55
56 protected:
57         void mousePressEvent(QMouseEvent * e);
58         void paintEvent(QPaintEvent * e);
59
60 private:
61         void init();
62
63         void drawLine(QColor const & col, int x, int y, int x2, int y2);
64
65         void drawLeft(bool);
66         void drawRight(bool);
67         void drawTop(bool);
68         void drawBottom(bool);
69
70         class Border {
71         public:
72                 Border() : set(true), enabled(true) {}
73                 bool set;
74                 bool enabled;
75         };
76
77         Border left_;
78         Border right_;
79         Border top_;
80         Border bottom_;
81
82         int m;
83         int l;
84         int w;
85         int h;
86
87         QPixmap buffer;
88 };
89
90 #endif // QSETBORDER_H