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