GuiPrintNomencl.{cpp,h}:
[lyx.git] / src / frontends / qt4 / GuiSetBorder.h
blobd67358b6d35279e45eae25038be106a7bc2e7684
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.
7 * \author Edwin Leuven
8 * \author John Levon
10 * Full author contact details are available in file CREDITS.
13 #ifndef GUISETBORDER_H
14 #define GUISETBORDER_H
16 #include <QWidget>
17 #include <QPixmap>
19 class QColor;
20 class QMouseEvent;
21 class QPaintEvent;
23 //namespace lyx {
25 class GuiSetBorder : public QWidget
27 Q_OBJECT
28 public:
29 GuiSetBorder(QWidget * parent = 0, Qt::WFlags fl = 0);
31 bool getLeft();
32 bool getRight();
33 bool getTop();
34 bool getBottom();
36 Q_SIGNALS:
37 void rightSet(bool);
38 void leftSet(bool);
39 void topSet(bool);
40 void bottomSet(bool);
41 void clicked();
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);
54 protected:
55 void mousePressEvent(QMouseEvent * e);
56 void paintEvent(QPaintEvent * e);
58 private:
59 void init();
61 void drawLine(QColor const & col, int x, int y, int x2, int y2);
63 void drawLeft(bool);
64 void drawRight(bool);
65 void drawTop(bool);
66 void drawBottom(bool);
68 class Border {
69 public:
70 Border() : set(true), enabled(true) {}
71 bool set;
72 bool enabled;
75 Border left_;
76 Border right_;
77 Border top_;
78 Border bottom_;
80 int m;
81 int l;
82 int w;
83 int h;
85 QPixmap buffer;
89 //} // namespace lyx
91 #endif // GUISETBORDER_H