0
|
1 |
/****************************************************************************
|
|
2 |
**
|
|
3 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
4 |
** All rights reserved.
|
|
5 |
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
6 |
**
|
|
7 |
** This file is part of the QtGui module of the Qt Toolkit.
|
|
8 |
**
|
|
9 |
** $QT_BEGIN_LICENSE:LGPL$
|
|
10 |
** No Commercial Usage
|
|
11 |
** This file contains pre-release code and may not be distributed.
|
|
12 |
** You may use this file in accordance with the terms and conditions
|
|
13 |
** contained in the Technology Preview License Agreement accompanying
|
|
14 |
** this package.
|
|
15 |
**
|
|
16 |
** GNU Lesser General Public License Usage
|
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
18 |
** General Public License version 2.1 as published by the Free Software
|
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
20 |
** packaging of this file. Please review the following information to
|
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
23 |
**
|
|
24 |
** In addition, as a special exception, Nokia gives you certain additional
|
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
27 |
**
|
|
28 |
** If you have questions regarding the use of this file, please contact
|
|
29 |
** Nokia at qt-info@nokia.com.
|
|
30 |
**
|
|
31 |
**
|
|
32 |
**
|
|
33 |
**
|
|
34 |
**
|
|
35 |
**
|
|
36 |
**
|
|
37 |
**
|
|
38 |
** $QT_END_LICENSE$
|
|
39 |
**
|
|
40 |
****************************************************************************/
|
|
41 |
|
|
42 |
#ifndef QGRAPHICSSCENEEVENT_H
|
|
43 |
#define QGRAPHICSSCENEEVENT_H
|
|
44 |
|
|
45 |
#include <QtCore/qcoreevent.h>
|
|
46 |
#include <QtCore/qpoint.h>
|
|
47 |
#include <QtCore/qscopedpointer.h>
|
|
48 |
#include <QtCore/qrect.h>
|
|
49 |
#include <QtGui/qpolygon.h>
|
|
50 |
#include <QtCore/qset.h>
|
|
51 |
#include <QtCore/qhash.h>
|
|
52 |
|
|
53 |
QT_BEGIN_HEADER
|
|
54 |
|
|
55 |
QT_BEGIN_NAMESPACE
|
|
56 |
|
|
57 |
QT_MODULE(Gui)
|
|
58 |
|
|
59 |
#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
|
|
60 |
|
|
61 |
class QMimeData;
|
|
62 |
class QPointF;
|
|
63 |
class QSizeF;
|
|
64 |
class QWidget;
|
|
65 |
|
|
66 |
class QGraphicsSceneEventPrivate;
|
|
67 |
class Q_GUI_EXPORT QGraphicsSceneEvent : public QEvent
|
|
68 |
{
|
|
69 |
public:
|
|
70 |
QGraphicsSceneEvent(Type type);
|
|
71 |
~QGraphicsSceneEvent();
|
|
72 |
|
|
73 |
QWidget *widget() const;
|
|
74 |
void setWidget(QWidget *widget);
|
|
75 |
|
|
76 |
protected:
|
|
77 |
QGraphicsSceneEvent(QGraphicsSceneEventPrivate &dd, Type type = None);
|
|
78 |
QScopedPointer<QGraphicsSceneEventPrivate> d_ptr;
|
|
79 |
Q_DECLARE_PRIVATE(QGraphicsSceneEvent)
|
|
80 |
};
|
|
81 |
|
|
82 |
class QGraphicsSceneMouseEventPrivate;
|
|
83 |
class Q_GUI_EXPORT QGraphicsSceneMouseEvent : public QGraphicsSceneEvent
|
|
84 |
{
|
|
85 |
public:
|
|
86 |
QGraphicsSceneMouseEvent(Type type = None);
|
|
87 |
~QGraphicsSceneMouseEvent();
|
|
88 |
|
|
89 |
QPointF pos() const;
|
|
90 |
void setPos(const QPointF &pos);
|
|
91 |
|
|
92 |
QPointF scenePos() const;
|
|
93 |
void setScenePos(const QPointF &pos);
|
|
94 |
|
|
95 |
QPoint screenPos() const;
|
|
96 |
void setScreenPos(const QPoint &pos);
|
|
97 |
|
|
98 |
QPointF buttonDownPos(Qt::MouseButton button) const;
|
|
99 |
void setButtonDownPos(Qt::MouseButton button, const QPointF &pos);
|
|
100 |
|
|
101 |
QPointF buttonDownScenePos(Qt::MouseButton button) const;
|
|
102 |
void setButtonDownScenePos(Qt::MouseButton button, const QPointF &pos);
|
|
103 |
|
|
104 |
QPoint buttonDownScreenPos(Qt::MouseButton button) const;
|
|
105 |
void setButtonDownScreenPos(Qt::MouseButton button, const QPoint &pos);
|
|
106 |
|
|
107 |
QPointF lastPos() const;
|
|
108 |
void setLastPos(const QPointF &pos);
|
|
109 |
|
|
110 |
QPointF lastScenePos() const;
|
|
111 |
void setLastScenePos(const QPointF &pos);
|
|
112 |
|
|
113 |
QPoint lastScreenPos() const;
|
|
114 |
void setLastScreenPos(const QPoint &pos);
|
|
115 |
|
|
116 |
Qt::MouseButtons buttons() const;
|
|
117 |
void setButtons(Qt::MouseButtons buttons);
|
|
118 |
|
|
119 |
Qt::MouseButton button() const;
|
|
120 |
void setButton(Qt::MouseButton button);
|
|
121 |
|
|
122 |
Qt::KeyboardModifiers modifiers() const;
|
|
123 |
void setModifiers(Qt::KeyboardModifiers modifiers);
|
|
124 |
|
|
125 |
private:
|
|
126 |
Q_DECLARE_PRIVATE(QGraphicsSceneMouseEvent)
|
|
127 |
};
|
|
128 |
|
|
129 |
class QGraphicsSceneWheelEventPrivate;
|
|
130 |
class Q_GUI_EXPORT QGraphicsSceneWheelEvent : public QGraphicsSceneEvent
|
|
131 |
{
|
|
132 |
public:
|
|
133 |
QGraphicsSceneWheelEvent(Type type = None);
|
|
134 |
~QGraphicsSceneWheelEvent();
|
|
135 |
|
|
136 |
QPointF pos() const;
|
|
137 |
void setPos(const QPointF &pos);
|
|
138 |
|
|
139 |
QPointF scenePos() const;
|
|
140 |
void setScenePos(const QPointF &pos);
|
|
141 |
|
|
142 |
QPoint screenPos() const;
|
|
143 |
void setScreenPos(const QPoint &pos);
|
|
144 |
|
|
145 |
Qt::MouseButtons buttons() const;
|
|
146 |
void setButtons(Qt::MouseButtons buttons);
|
|
147 |
|
|
148 |
Qt::KeyboardModifiers modifiers() const;
|
|
149 |
void setModifiers(Qt::KeyboardModifiers modifiers);
|
|
150 |
|
|
151 |
int delta() const;
|
|
152 |
void setDelta(int delta);
|
|
153 |
|
|
154 |
Qt::Orientation orientation() const;
|
|
155 |
void setOrientation(Qt::Orientation orientation);
|
|
156 |
|
|
157 |
private:
|
|
158 |
Q_DECLARE_PRIVATE(QGraphicsSceneWheelEvent)
|
|
159 |
};
|
|
160 |
|
|
161 |
class QGraphicsSceneContextMenuEventPrivate;
|
|
162 |
class Q_GUI_EXPORT QGraphicsSceneContextMenuEvent : public QGraphicsSceneEvent
|
|
163 |
{
|
|
164 |
public:
|
|
165 |
enum Reason { Mouse, Keyboard, Other };
|
|
166 |
|
|
167 |
QGraphicsSceneContextMenuEvent(Type type = None);
|
|
168 |
~QGraphicsSceneContextMenuEvent();
|
|
169 |
|
|
170 |
QPointF pos() const;
|
|
171 |
void setPos(const QPointF &pos);
|
|
172 |
|
|
173 |
QPointF scenePos() const;
|
|
174 |
void setScenePos(const QPointF &pos);
|
|
175 |
|
|
176 |
QPoint screenPos() const;
|
|
177 |
void setScreenPos(const QPoint &pos);
|
|
178 |
|
|
179 |
Qt::KeyboardModifiers modifiers() const;
|
|
180 |
void setModifiers(Qt::KeyboardModifiers modifiers);
|
|
181 |
|
|
182 |
Reason reason() const;
|
|
183 |
void setReason(Reason reason);
|
|
184 |
|
|
185 |
private:
|
|
186 |
Q_DECLARE_PRIVATE(QGraphicsSceneContextMenuEvent)
|
|
187 |
};
|
|
188 |
|
|
189 |
class QGraphicsSceneHoverEventPrivate;
|
|
190 |
class Q_GUI_EXPORT QGraphicsSceneHoverEvent : public QGraphicsSceneEvent
|
|
191 |
{
|
|
192 |
public:
|
|
193 |
QGraphicsSceneHoverEvent(Type type = None);
|
|
194 |
~QGraphicsSceneHoverEvent();
|
|
195 |
|
|
196 |
QPointF pos() const;
|
|
197 |
void setPos(const QPointF &pos);
|
|
198 |
|
|
199 |
QPointF scenePos() const;
|
|
200 |
void setScenePos(const QPointF &pos);
|
|
201 |
|
|
202 |
QPoint screenPos() const;
|
|
203 |
void setScreenPos(const QPoint &pos);
|
|
204 |
|
|
205 |
QPointF lastPos() const;
|
|
206 |
void setLastPos(const QPointF &pos);
|
|
207 |
|
|
208 |
QPointF lastScenePos() const;
|
|
209 |
void setLastScenePos(const QPointF &pos);
|
|
210 |
|
|
211 |
QPoint lastScreenPos() const;
|
|
212 |
void setLastScreenPos(const QPoint &pos);
|
|
213 |
|
|
214 |
Qt::KeyboardModifiers modifiers() const;
|
|
215 |
void setModifiers(Qt::KeyboardModifiers modifiers);
|
|
216 |
|
|
217 |
private:
|
|
218 |
Q_DECLARE_PRIVATE(QGraphicsSceneHoverEvent)
|
|
219 |
};
|
|
220 |
|
|
221 |
class QGraphicsSceneHelpEventPrivate;
|
|
222 |
class Q_GUI_EXPORT QGraphicsSceneHelpEvent : public QGraphicsSceneEvent
|
|
223 |
{
|
|
224 |
public:
|
|
225 |
QGraphicsSceneHelpEvent(Type type = None);
|
|
226 |
~QGraphicsSceneHelpEvent();
|
|
227 |
|
|
228 |
QPointF scenePos() const;
|
|
229 |
void setScenePos(const QPointF &pos);
|
|
230 |
|
|
231 |
QPoint screenPos() const;
|
|
232 |
void setScreenPos(const QPoint &pos);
|
|
233 |
|
|
234 |
private:
|
|
235 |
Q_DECLARE_PRIVATE(QGraphicsSceneHelpEvent)
|
|
236 |
};
|
|
237 |
|
|
238 |
class QGraphicsSceneDragDropEventPrivate;
|
|
239 |
class Q_GUI_EXPORT QGraphicsSceneDragDropEvent : public QGraphicsSceneEvent
|
|
240 |
{
|
|
241 |
public:
|
|
242 |
QGraphicsSceneDragDropEvent(Type type = None);
|
|
243 |
~QGraphicsSceneDragDropEvent();
|
|
244 |
|
|
245 |
QPointF pos() const;
|
|
246 |
void setPos(const QPointF &pos);
|
|
247 |
|
|
248 |
QPointF scenePos() const;
|
|
249 |
void setScenePos(const QPointF &pos);
|
|
250 |
|
|
251 |
QPoint screenPos() const;
|
|
252 |
void setScreenPos(const QPoint &pos);
|
|
253 |
|
|
254 |
Qt::MouseButtons buttons() const;
|
|
255 |
void setButtons(Qt::MouseButtons buttons);
|
|
256 |
|
|
257 |
Qt::KeyboardModifiers modifiers() const;
|
|
258 |
void setModifiers(Qt::KeyboardModifiers modifiers);
|
|
259 |
|
|
260 |
Qt::DropActions possibleActions() const;
|
|
261 |
void setPossibleActions(Qt::DropActions actions);
|
|
262 |
|
|
263 |
Qt::DropAction proposedAction() const;
|
|
264 |
void setProposedAction(Qt::DropAction action);
|
|
265 |
void acceptProposedAction();
|
|
266 |
|
|
267 |
Qt::DropAction dropAction() const;
|
|
268 |
void setDropAction(Qt::DropAction action);
|
|
269 |
|
|
270 |
QWidget *source() const;
|
|
271 |
void setSource(QWidget *source);
|
|
272 |
|
|
273 |
const QMimeData *mimeData() const;
|
|
274 |
void setMimeData(const QMimeData *data);
|
|
275 |
|
|
276 |
private:
|
|
277 |
Q_DECLARE_PRIVATE(QGraphicsSceneDragDropEvent)
|
|
278 |
};
|
|
279 |
|
|
280 |
class QGraphicsSceneResizeEventPrivate;
|
|
281 |
class Q_GUI_EXPORT QGraphicsSceneResizeEvent : public QGraphicsSceneEvent
|
|
282 |
{
|
|
283 |
Q_DECLARE_PRIVATE(QGraphicsSceneResizeEvent)
|
|
284 |
public:
|
|
285 |
QGraphicsSceneResizeEvent();
|
|
286 |
~QGraphicsSceneResizeEvent();
|
|
287 |
|
|
288 |
QSizeF oldSize() const;
|
|
289 |
void setOldSize(const QSizeF &size);
|
|
290 |
|
|
291 |
QSizeF newSize() const;
|
|
292 |
void setNewSize(const QSizeF &size);
|
|
293 |
};
|
|
294 |
|
|
295 |
class QGraphicsSceneMoveEventPrivate;
|
|
296 |
class Q_GUI_EXPORT QGraphicsSceneMoveEvent : public QGraphicsSceneEvent
|
|
297 |
{
|
|
298 |
Q_DECLARE_PRIVATE(QGraphicsSceneMoveEvent)
|
|
299 |
public:
|
|
300 |
QGraphicsSceneMoveEvent();
|
|
301 |
~QGraphicsSceneMoveEvent();
|
|
302 |
|
|
303 |
QPointF oldPos() const;
|
|
304 |
void setOldPos(const QPointF &pos);
|
|
305 |
|
|
306 |
QPointF newPos() const;
|
|
307 |
void setNewPos(const QPointF &pos);
|
|
308 |
};
|
|
309 |
|
|
310 |
#endif // QT_NO_GRAPHICSVIEW
|
|
311 |
|
|
312 |
QT_END_NAMESPACE
|
|
313 |
|
|
314 |
QT_END_HEADER
|
|
315 |
|
|
316 |
#endif
|