]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiSetBorder.h
'using namespace std' instead of 'using std::xxx'
[lyx.git] / src / frontends / qt4 / GuiSetBorder.h
1 // -*- C++ -*-
2 /**
3  * \file GuiSetBorder.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
13 #ifndef GUISETBORDER_H
14 #define GUISETBORDER_H
15
16 #include <QWidget>
17 #include <QPixmap>
18
19 class QColor;
20 class QMouseEvent;
21 class QPaintEvent;
22
23 //namespace lyx {
24
25 class GuiSetBorder : public QWidget
26 {
27         Q_OBJECT
28 public:
29         GuiSetBorder(QWidget * parent = 0, Qt::WFlags fl = 0);
30
31         bool getLeft();
32         bool getRight();
33         bool getTop();
34         bool getBottom();
35
36 Q_SIGNALS:
37         void rightSet(bool);
38         void leftSet(bool);
39         void topSet(bool);
40         void bottomSet(bool);
41         void clicked();
42
43 public Q_SLOTS:
44         void setLeftEnabled(bool);
45         void setRightEnabled(bool);
46         void setTopEnabled(bool);
47         void setBottomEnabled(bool);
48         void setLeft(bool);
49         void setRight(bool);
50         void setTop(bool);
51         void setBottom(bool);
52         void setAll(bool);
53
54 protected:
55         void mousePressEvent(QMouseEvent * e);
56         void paintEvent(QPaintEvent * e);
57
58 private:
59         void init();
60
61         void drawLine(QColor const & col, int x, int y, int x2, int y2);
62
63         void drawLeft(bool);
64         void drawRight(bool);
65         void drawTop(bool);
66         void drawBottom(bool);
67
68         class Border {
69         public:
70                 Border() : set(true), enabled(true) {}
71                 bool set;
72                 bool enabled;
73         };
74
75         Border left_;
76         Border right_;
77         Border top_;
78         Border bottom_;
79
80         int m;
81         int l;
82         int w;
83         int h;
84
85         QPixmap buffer;
86 };
87
88
89 //} // namespace lyx
90
91 #endif // GUISETBORDER_H