| 1 | /**************************************************************************** | 
|---|
| 2 | ** | 
|---|
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. | 
|---|
| 4 | ** Contact: https://www.qt.io/licensing/ | 
|---|
| 5 | ** | 
|---|
| 6 | ** This file is part of the QtWidgets module of the Qt Toolkit. | 
|---|
| 7 | ** | 
|---|
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | 
|---|
| 9 | ** Commercial License Usage | 
|---|
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | 
|---|
| 11 | ** accordance with the commercial license agreement provided with the | 
|---|
| 12 | ** Software or, alternatively, in accordance with the terms contained in | 
|---|
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | 
|---|
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | 
|---|
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | 
|---|
| 16 | ** | 
|---|
| 17 | ** GNU Lesser General Public License Usage | 
|---|
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
|---|
| 19 | ** General Public License version 3 as published by the Free Software | 
|---|
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | 
|---|
| 21 | ** packaging of this file. Please review the following information to | 
|---|
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | 
|---|
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | 
|---|
| 24 | ** | 
|---|
| 25 | ** GNU General Public License Usage | 
|---|
| 26 | ** Alternatively, this file may be used under the terms of the GNU | 
|---|
| 27 | ** General Public License version 2.0 or (at your option) the GNU General | 
|---|
| 28 | ** Public license version 3 or any later version approved by the KDE Free | 
|---|
| 29 | ** Qt Foundation. The licenses are as published by the Free Software | 
|---|
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | 
|---|
| 31 | ** included in the packaging of this file. Please review the following | 
|---|
| 32 | ** information to ensure the GNU General Public License requirements will | 
|---|
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | 
|---|
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | 
|---|
| 35 | ** | 
|---|
| 36 | ** $QT_END_LICENSE$ | 
|---|
| 37 | ** | 
|---|
| 38 | ****************************************************************************/ | 
|---|
| 39 |  | 
|---|
| 40 | #ifndef QGRAPHICSSCENEEVENT_H | 
|---|
| 41 | #define QGRAPHICSSCENEEVENT_H | 
|---|
| 42 |  | 
|---|
| 43 | #include <QtWidgets/qtwidgetsglobal.h> | 
|---|
| 44 | #include <QtCore/qcoreevent.h> | 
|---|
| 45 | #include <QtCore/qpoint.h> | 
|---|
| 46 | #include <QtCore/qscopedpointer.h> | 
|---|
| 47 | #include <QtCore/qrect.h> | 
|---|
| 48 | #include <QtGui/qpolygon.h> | 
|---|
| 49 | #include <QtCore/qset.h> | 
|---|
| 50 |  | 
|---|
| 51 | QT_REQUIRE_CONFIG(graphicsview); | 
|---|
| 52 |  | 
|---|
| 53 | QT_BEGIN_NAMESPACE | 
|---|
| 54 |  | 
|---|
| 55 | class QMimeData; | 
|---|
| 56 | class QPointF; | 
|---|
| 57 | class QSizeF; | 
|---|
| 58 | class QWidget; | 
|---|
| 59 |  | 
|---|
| 60 | class QGraphicsSceneEventPrivate; | 
|---|
| 61 | class Q_WIDGETS_EXPORT QGraphicsSceneEvent : public QEvent | 
|---|
| 62 | { | 
|---|
| 63 | public: | 
|---|
| 64 | explicit QGraphicsSceneEvent(Type type); | 
|---|
| 65 | ~QGraphicsSceneEvent(); | 
|---|
| 66 |  | 
|---|
| 67 | QWidget *widget() const; | 
|---|
| 68 | void setWidget(QWidget *widget); | 
|---|
| 69 |  | 
|---|
| 70 | protected: | 
|---|
| 71 | QGraphicsSceneEvent(QGraphicsSceneEventPrivate &dd, Type type = None); | 
|---|
| 72 | QScopedPointer<QGraphicsSceneEventPrivate> d_ptr; | 
|---|
| 73 | Q_DECLARE_PRIVATE(QGraphicsSceneEvent) | 
|---|
| 74 | private: | 
|---|
| 75 | Q_DISABLE_COPY(QGraphicsSceneEvent) | 
|---|
| 76 | }; | 
|---|
| 77 |  | 
|---|
| 78 | class QGraphicsSceneMouseEventPrivate; | 
|---|
| 79 | class Q_WIDGETS_EXPORT QGraphicsSceneMouseEvent : public QGraphicsSceneEvent | 
|---|
| 80 | { | 
|---|
| 81 | public: | 
|---|
| 82 | explicit QGraphicsSceneMouseEvent(Type type = None); | 
|---|
| 83 | ~QGraphicsSceneMouseEvent(); | 
|---|
| 84 |  | 
|---|
| 85 | QPointF pos() const; | 
|---|
| 86 | void setPos(const QPointF &pos); | 
|---|
| 87 |  | 
|---|
| 88 | QPointF scenePos() const; | 
|---|
| 89 | void setScenePos(const QPointF &pos); | 
|---|
| 90 |  | 
|---|
| 91 | QPoint screenPos() const; | 
|---|
| 92 | void setScreenPos(const QPoint &pos); | 
|---|
| 93 |  | 
|---|
| 94 | QPointF buttonDownPos(Qt::MouseButton button) const; | 
|---|
| 95 | void setButtonDownPos(Qt::MouseButton button, const QPointF &pos); | 
|---|
| 96 |  | 
|---|
| 97 | QPointF buttonDownScenePos(Qt::MouseButton button) const; | 
|---|
| 98 | void setButtonDownScenePos(Qt::MouseButton button, const QPointF &pos); | 
|---|
| 99 |  | 
|---|
| 100 | QPoint buttonDownScreenPos(Qt::MouseButton button) const; | 
|---|
| 101 | void setButtonDownScreenPos(Qt::MouseButton button, const QPoint &pos); | 
|---|
| 102 |  | 
|---|
| 103 | QPointF lastPos() const; | 
|---|
| 104 | void setLastPos(const QPointF &pos); | 
|---|
| 105 |  | 
|---|
| 106 | QPointF lastScenePos() const; | 
|---|
| 107 | void setLastScenePos(const QPointF &pos); | 
|---|
| 108 |  | 
|---|
| 109 | QPoint lastScreenPos() const; | 
|---|
| 110 | void setLastScreenPos(const QPoint &pos); | 
|---|
| 111 |  | 
|---|
| 112 | Qt::MouseButtons buttons() const; | 
|---|
| 113 | void setButtons(Qt::MouseButtons buttons); | 
|---|
| 114 |  | 
|---|
| 115 | Qt::MouseButton button() const; | 
|---|
| 116 | void setButton(Qt::MouseButton button); | 
|---|
| 117 |  | 
|---|
| 118 | Qt::KeyboardModifiers modifiers() const; | 
|---|
| 119 | void setModifiers(Qt::KeyboardModifiers modifiers); | 
|---|
| 120 |  | 
|---|
| 121 | Qt::MouseEventSource source() const; | 
|---|
| 122 | void setSource(Qt::MouseEventSource source); | 
|---|
| 123 |  | 
|---|
| 124 | Qt::MouseEventFlags flags() const; | 
|---|
| 125 | void setFlags(Qt::MouseEventFlags); | 
|---|
| 126 |  | 
|---|
| 127 | private: | 
|---|
| 128 | Q_DECLARE_PRIVATE(QGraphicsSceneMouseEvent) | 
|---|
| 129 | Q_DISABLE_COPY(QGraphicsSceneMouseEvent) | 
|---|
| 130 | }; | 
|---|
| 131 |  | 
|---|
| 132 | class QGraphicsSceneWheelEventPrivate; | 
|---|
| 133 | class Q_WIDGETS_EXPORT QGraphicsSceneWheelEvent : public QGraphicsSceneEvent | 
|---|
| 134 | { | 
|---|
| 135 | public: | 
|---|
| 136 | explicit 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 ; | 
|---|
| 166 | class Q_WIDGETS_EXPORT  : public QGraphicsSceneEvent | 
|---|
| 167 | { | 
|---|
| 168 | public: | 
|---|
| 169 | enum  { , ,  }; | 
|---|
| 170 |  | 
|---|
| 171 | explicit (Type type = None); | 
|---|
| 172 | (); | 
|---|
| 173 |  | 
|---|
| 174 | QPointF () const; | 
|---|
| 175 | void (const QPointF &pos); | 
|---|
| 176 |  | 
|---|
| 177 | QPointF () const; | 
|---|
| 178 | void (const QPointF &pos); | 
|---|
| 179 |  | 
|---|
| 180 | QPoint () const; | 
|---|
| 181 | void (const QPoint &pos); | 
|---|
| 182 |  | 
|---|
| 183 | Qt::KeyboardModifiers () const; | 
|---|
| 184 | void (Qt::KeyboardModifiers modifiers); | 
|---|
| 185 |  | 
|---|
| 186 | Reason () const; | 
|---|
| 187 | void (Reason reason); | 
|---|
| 188 |  | 
|---|
| 189 | private: | 
|---|
| 190 | Q_DECLARE_PRIVATE(QGraphicsSceneContextMenuEvent) | 
|---|
| 191 | Q_DISABLE_COPY() | 
|---|
| 192 | }; | 
|---|
| 193 |  | 
|---|
| 194 | class QGraphicsSceneHoverEventPrivate; | 
|---|
| 195 | class Q_WIDGETS_EXPORT QGraphicsSceneHoverEvent : public QGraphicsSceneEvent | 
|---|
| 196 | { | 
|---|
| 197 | public: | 
|---|
| 198 | explicit 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_WIDGETS_EXPORT QGraphicsSceneHelpEvent : public QGraphicsSceneEvent | 
|---|
| 229 | { | 
|---|
| 230 | public: | 
|---|
| 231 | explicit 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_WIDGETS_EXPORT QGraphicsSceneDragDropEvent : public QGraphicsSceneEvent | 
|---|
| 247 | { | 
|---|
| 248 | public: | 
|---|
| 249 | explicit 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_WIDGETS_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_WIDGETS_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 | #ifndef QT_NO_DEBUG_STREAM | 
|---|
| 321 | Q_WIDGETS_EXPORT QDebug operator<<(QDebug, const QGraphicsSceneEvent *); | 
|---|
| 322 | #endif | 
|---|
| 323 |  | 
|---|
| 324 | QT_END_NAMESPACE | 
|---|
| 325 |  | 
|---|
| 326 | #endif | 
|---|
| 327 |  | 
|---|