Remove this line
[kdeaccessibility.git] / kmag / kmagselrect.h
blob549784bac471fa96980f61e6cb0a474df82cf4fe
1 /***************************************************************************
2 kmagselrect.h - description
3 -------------------
4 begin : Mon Feb 12 23:45:41 EST 2001
5 copyright : (C) 2001-2003 by Sarang Lakare
6 email : sarang#users.sf.net
7 copyright : (C) 2003-2004 by Olaf Schmidt
8 email : ojschmidt@kde.org
9 ***************************************************************************/
11 /***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 ***************************************************************************/
20 #ifndef KMAGSELRECT_H
21 #define KMAGSELRECT_H
23 #include <stdlib.h>
25 // Qt includes
26 #include <QtCore/QRect>
27 #include <QtGui/QWidget>
28 #include <QtGui/QLabel>
29 #include <QtGui/QMouseEvent>
31 class KMagSelWinCorner : public QLabel
33 Q_OBJECT
35 public:
37 explicit KMagSelWinCorner ( QWidget * parent = 0, Qt::WFlags f = 0 );
39 virtual ~KMagSelWinCorner();
41 signals:
43 void startResizing ();
44 void resized ( QPoint offset );
46 protected:
48 QPoint oldPos;
50 virtual void mousePressEvent ( QMouseEvent * e );
51 virtual void mouseReleaseEvent ( QMouseEvent * e );
52 virtual void mouseMoveEvent ( QMouseEvent * e );
55 class KMagSelWin : public QWidget
57 Q_OBJECT
59 public:
61 explicit KMagSelWin ( QWidget * parent = 0, Qt::WFlags f = 0 );
63 virtual ~KMagSelWin();
65 void setSelRect ( const QRect & selRect );
66 QRect getSelRect ();
68 public slots:
70 void startResizing ();
71 void titleMoved ( const QPoint & offset );
72 void topLeftResized ( const QPoint & offset );
73 void topRightResized ( const QPoint & offset );
74 void bottomLeftResized ( const QPoint & offset );
75 void bottomRightResized ( const QPoint & offset );
77 signals:
79 void resized();
81 protected:
83 QRect oldSelRect;
85 KMagSelWinCorner *titleBar;
86 KMagSelWinCorner *topLeftCorner;
87 KMagSelWinCorner *topRightCorner;
88 KMagSelWinCorner *bottomLeftCorner;
89 KMagSelWinCorner *bottomRightCorner;
92 /**
93 * This class stores the selected rectangular area for grabbing. It also displays the
94 * rectangular area on demand.
96 * @author Original : Michael Forster
97 * @author Current : Sarang Lakare
99 class KMagSelRect : public QObject, public QRect
101 Q_OBJECT
103 public:
104 KMagSelRect(QWidget *parent=0);
105 KMagSelRect(const QPoint &topLeft, const QPoint &bottomRight,
106 QWidget *parent=0);
107 KMagSelRect(const QPoint &topLeft, const QSize &size,
108 QWidget *parent=0);
109 KMagSelRect(int left, int top, int width, int height,
110 QWidget *selWindowParent=0);
112 virtual ~KMagSelRect();
114 bool visible();
116 /// Makes the rectangle always visible
117 void alwaysVisible(bool visible=true);
119 /// Returns true if always visible is set
120 bool getAlwaysVisible() const {
121 return (m_alwaysVisible);
124 public slots:
126 void show();
127 void hide();
128 void update();
130 void selWinResized();
132 protected:
134 void init(QWidget *);
136 QWidget *selWindowParent;
137 KMagSelWin *selectionwindow;
138 bool m_alwaysVisible;
142 void setTitleColors (const QColor & title, const QColor & text, const QColor & titleBtn);
143 void setFrameSize (int size);
145 #endif // KMAGSELRECT_H