1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation ([email protected])
|
---|
6 | **
|
---|
7 | ** This file is part of the QtGui module of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
14 | ** a written agreement between you and Nokia.
|
---|
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 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you have questions regarding the use of this file, please contact
|
---|
37 | ** Nokia at [email protected].
|
---|
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 | private:
|
---|
81 | Q_DISABLE_COPY(QGraphicsSceneEvent)
|
---|
82 | };
|
---|
83 |
|
---|
84 | class QGraphicsSceneMouseEventPrivate;
|
---|
85 | class Q_GUI_EXPORT QGraphicsSceneMouseEvent : public QGraphicsSceneEvent
|
---|
86 | {
|
---|
87 | public:
|
---|
88 | QGraphicsSceneMouseEvent(Type type = None);
|
---|
89 | ~QGraphicsSceneMouseEvent();
|
---|
90 |
|
---|
91 | QPointF pos() const;
|
---|
92 | void setPos(const QPointF &pos);
|
---|
93 |
|
---|
94 | QPointF scenePos() const;
|
---|
95 | void setScenePos(const QPointF &pos);
|
---|
96 |
|
---|
97 | QPoint screenPos() const;
|
---|
98 | void setScreenPos(const QPoint &pos);
|
---|
99 |
|
---|
100 | QPointF buttonDownPos(Qt::MouseButton button) const;
|
---|
101 | void setButtonDownPos(Qt::MouseButton button, const QPointF &pos);
|
---|
102 |
|
---|
103 | QPointF buttonDownScenePos(Qt::MouseButton button) const;
|
---|
104 | void setButtonDownScenePos(Qt::MouseButton button, const QPointF &pos);
|
---|
105 |
|
---|
106 | QPoint buttonDownScreenPos(Qt::MouseButton button) const;
|
---|
107 | void setButtonDownScreenPos(Qt::MouseButton button, const QPoint &pos);
|
---|
108 |
|
---|
109 | QPointF lastPos() const;
|
---|
110 | void setLastPos(const QPointF &pos);
|
---|
111 |
|
---|
112 | QPointF lastScenePos() const;
|
---|
113 | void setLastScenePos(const QPointF &pos);
|
---|
114 |
|
---|
115 | QPoint lastScreenPos() const;
|
---|
116 | void setLastScreenPos(const QPoint &pos);
|
---|
117 |
|
---|
118 | Qt::MouseButtons buttons() const;
|
---|
119 | void setButtons(Qt::MouseButtons buttons);
|
---|
120 |
|
---|
121 | Qt::MouseButton button() const;
|
---|
122 | void setButton(Qt::MouseButton button);
|
---|
123 |
|
---|
124 | Qt::KeyboardModifiers modifiers() const;
|
---|
125 | void setModifiers(Qt::KeyboardModifiers modifiers);
|
---|
126 |
|
---|
127 | private:
|
---|
128 | Q_DECLARE_PRIVATE(QGraphicsSceneMouseEvent)
|
---|
129 | Q_DISABLE_COPY(QGraphicsSceneMouseEvent)
|
---|
130 | };
|
---|
131 |
|
---|
132 | class QGraphicsSceneWheelEventPrivate;
|
---|
133 | class Q_GUI_EXPORT QGraphicsSceneWheelEvent : public QGraphicsSceneEvent
|
---|
134 | {
|
---|
135 | public:
|
---|
136 | QGraphicsSceneWheelEvent(Type type = None);
|
---|
137 | ~QGraphicsSceneWheelEvent();
|
---|
138 |
|
---|
139 | QPointF pos() const;
|
---|
140 | void setPos(const QPointF &pos);
|
---|
141 |
|
---|
142 | QPointF scenePos() const;
|
---|
143 | void setScenePos(const QPointF &pos);
|
---|
144 |
|
---|
145 | QPoint screenPos() const;
|
---|
146 | void setScreenPos(const QPoint &pos);
|
---|
147 |
|
---|
148 | Qt::MouseButtons buttons() const;
|
---|
149 | void setButtons(Qt::MouseButtons buttons);
|
---|
150 |
|
---|
151 | Qt::KeyboardModifiers modifiers() const;
|
---|
152 | void setModifiers(Qt::KeyboardModifiers modifiers);
|
---|
153 |
|
---|
154 | int delta() const;
|
---|
155 | void setDelta(int delta);
|
---|
156 |
|
---|
157 | Qt::Orientation orientation() const;
|
---|
158 | void setOrientation(Qt::Orientation orientation);
|
---|
159 |
|
---|
160 | private:
|
---|
161 | Q_DECLARE_PRIVATE(QGraphicsSceneWheelEvent)
|
---|
162 | Q_DISABLE_COPY(QGraphicsSceneWheelEvent)
|
---|
163 | };
|
---|
164 |
|
---|
165 | class QGraphicsSceneContextMenuEventPrivate;
|
---|
166 | class Q_GUI_EXPORT QGraphicsSceneContextMenuEvent : public QGraphicsSceneEvent
|
---|
167 | {
|
---|
168 | public:
|
---|
169 | enum Reason { Mouse, Keyboard, Other };
|
---|
170 |
|
---|
171 | QGraphicsSceneContextMenuEvent(Type type = None);
|
---|
172 | ~QGraphicsSceneContextMenuEvent();
|
---|
173 |
|
---|
174 | QPointF pos() const;
|
---|
175 | void setPos(const QPointF &pos);
|
---|
176 |
|
---|
177 | QPointF scenePos() const;
|
---|
178 | void setScenePos(const QPointF &pos);
|
---|
179 |
|
---|
180 | QPoint screenPos() const;
|
---|
181 | void setScreenPos(const QPoint &pos);
|
---|
182 |
|
---|
183 | Qt::KeyboardModifiers modifiers() const;
|
---|
184 | void setModifiers(Qt::KeyboardModifiers modifiers);
|
---|
185 |
|
---|
186 | Reason reason() const;
|
---|
187 | void setReason(Reason reason);
|
---|
188 |
|
---|
189 | private:
|
---|
190 | Q_DECLARE_PRIVATE(QGraphicsSceneContextMenuEvent)
|
---|
191 | Q_DISABLE_COPY(QGraphicsSceneContextMenuEvent)
|
---|
192 | };
|
---|
193 |
|
---|
194 | class QGraphicsSceneHoverEventPrivate;
|
---|
195 | class Q_GUI_EXPORT QGraphicsSceneHoverEvent : public QGraphicsSceneEvent
|
---|
196 | {
|
---|
197 | public:
|
---|
198 | QGraphicsSceneHoverEvent(Type type = None);
|
---|
199 | ~QGraphicsSceneHoverEvent();
|
---|
200 |
|
---|
201 | QPointF pos() const;
|
---|
202 | void setPos(const QPointF &pos);
|
---|
203 |
|
---|
204 | QPointF scenePos() const;
|
---|
205 | void setScenePos(const QPointF &pos);
|
---|
206 |
|
---|
207 | QPoint screenPos() const;
|
---|
208 | void setScreenPos(const QPoint &pos);
|
---|
209 |
|
---|
210 | QPointF lastPos() const;
|
---|
211 | void setLastPos(const QPointF &pos);
|
---|
212 |
|
---|
213 | QPointF lastScenePos() const;
|
---|
214 | void setLastScenePos(const QPointF &pos);
|
---|
215 |
|
---|
216 | QPoint lastScreenPos() const;
|
---|
217 | void setLastScreenPos(const QPoint &pos);
|
---|
218 |
|
---|
219 | Qt::KeyboardModifiers modifiers() const;
|
---|
220 | void setModifiers(Qt::KeyboardModifiers modifiers);
|
---|
221 |
|
---|
222 | private:
|
---|
223 | Q_DECLARE_PRIVATE(QGraphicsSceneHoverEvent)
|
---|
224 | Q_DISABLE_COPY(QGraphicsSceneHoverEvent)
|
---|
225 | };
|
---|
226 |
|
---|
227 | class QGraphicsSceneHelpEventPrivate;
|
---|
228 | class Q_GUI_EXPORT QGraphicsSceneHelpEvent : public QGraphicsSceneEvent
|
---|
229 | {
|
---|
230 | public:
|
---|
231 | QGraphicsSceneHelpEvent(Type type = None);
|
---|
232 | ~QGraphicsSceneHelpEvent();
|
---|
233 |
|
---|
234 | QPointF scenePos() const;
|
---|
235 | void setScenePos(const QPointF &pos);
|
---|
236 |
|
---|
237 | QPoint screenPos() const;
|
---|
238 | void setScreenPos(const QPoint &pos);
|
---|
239 |
|
---|
240 | private:
|
---|
241 | Q_DECLARE_PRIVATE(QGraphicsSceneHelpEvent)
|
---|
242 | Q_DISABLE_COPY(QGraphicsSceneHelpEvent)
|
---|
243 | };
|
---|
244 |
|
---|
245 | class QGraphicsSceneDragDropEventPrivate;
|
---|
246 | class Q_GUI_EXPORT QGraphicsSceneDragDropEvent : public QGraphicsSceneEvent
|
---|
247 | {
|
---|
248 | public:
|
---|
249 | QGraphicsSceneDragDropEvent(Type type = None);
|
---|
250 | ~QGraphicsSceneDragDropEvent();
|
---|
251 |
|
---|
252 | QPointF pos() const;
|
---|
253 | void setPos(const QPointF &pos);
|
---|
254 |
|
---|
255 | QPointF scenePos() const;
|
---|
256 | void setScenePos(const QPointF &pos);
|
---|
257 |
|
---|
258 | QPoint screenPos() const;
|
---|
259 | void setScreenPos(const QPoint &pos);
|
---|
260 |
|
---|
261 | Qt::MouseButtons buttons() const;
|
---|
262 | void setButtons(Qt::MouseButtons buttons);
|
---|
263 |
|
---|
264 | Qt::KeyboardModifiers modifiers() const;
|
---|
265 | void setModifiers(Qt::KeyboardModifiers modifiers);
|
---|
266 |
|
---|
267 | Qt::DropActions possibleActions() const;
|
---|
268 | void setPossibleActions(Qt::DropActions actions);
|
---|
269 |
|
---|
270 | Qt::DropAction proposedAction() const;
|
---|
271 | void setProposedAction(Qt::DropAction action);
|
---|
272 | void acceptProposedAction();
|
---|
273 |
|
---|
274 | Qt::DropAction dropAction() const;
|
---|
275 | void setDropAction(Qt::DropAction action);
|
---|
276 |
|
---|
277 | QWidget *source() const;
|
---|
278 | void setSource(QWidget *source);
|
---|
279 |
|
---|
280 | const QMimeData *mimeData() const;
|
---|
281 | void setMimeData(const QMimeData *data);
|
---|
282 |
|
---|
283 | private:
|
---|
284 | Q_DECLARE_PRIVATE(QGraphicsSceneDragDropEvent)
|
---|
285 | Q_DISABLE_COPY(QGraphicsSceneDragDropEvent)
|
---|
286 | };
|
---|
287 |
|
---|
288 | class QGraphicsSceneResizeEventPrivate;
|
---|
289 | class Q_GUI_EXPORT QGraphicsSceneResizeEvent : public QGraphicsSceneEvent
|
---|
290 | {
|
---|
291 | Q_DECLARE_PRIVATE(QGraphicsSceneResizeEvent)
|
---|
292 | Q_DISABLE_COPY(QGraphicsSceneResizeEvent)
|
---|
293 | public:
|
---|
294 | QGraphicsSceneResizeEvent();
|
---|
295 | ~QGraphicsSceneResizeEvent();
|
---|
296 |
|
---|
297 | QSizeF oldSize() const;
|
---|
298 | void setOldSize(const QSizeF &size);
|
---|
299 |
|
---|
300 | QSizeF newSize() const;
|
---|
301 | void setNewSize(const QSizeF &size);
|
---|
302 | };
|
---|
303 |
|
---|
304 | class QGraphicsSceneMoveEventPrivate;
|
---|
305 | class Q_GUI_EXPORT QGraphicsSceneMoveEvent : public QGraphicsSceneEvent
|
---|
306 | {
|
---|
307 | Q_DECLARE_PRIVATE(QGraphicsSceneMoveEvent)
|
---|
308 | Q_DISABLE_COPY(QGraphicsSceneMoveEvent)
|
---|
309 | public:
|
---|
310 | QGraphicsSceneMoveEvent();
|
---|
311 | ~QGraphicsSceneMoveEvent();
|
---|
312 |
|
---|
313 | QPointF oldPos() const;
|
---|
314 | void setOldPos(const QPointF &pos);
|
---|
315 |
|
---|
316 | QPointF newPos() const;
|
---|
317 | void setNewPos(const QPointF &pos);
|
---|
318 | };
|
---|
319 |
|
---|
320 | #endif // QT_NO_GRAPHICSVIEW
|
---|
321 |
|
---|
322 | QT_END_NAMESPACE
|
---|
323 |
|
---|
324 | QT_END_HEADER
|
---|
325 |
|
---|
326 | #endif
|
---|