1 /****************************************************************************
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtGui module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this
14 ** file. Please review the following information to ensure the GNU Lesser
15 ** General Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 ** GNU General Public License Usage
23 ** Alternatively, this file may be used under the terms of the GNU General
24 ** Public License version 3.0 as published by the Free Software Foundation
25 ** and appearing in the file LICENSE.GPL included in the packaging of this
26 ** file. Please review the following information to ensure the GNU General
27 ** Public License version 3.0 requirements will be met:
28 ** http://www.gnu.org/copyleft/gpl.html.
31 ** Alternatively, this file may be used in accordance with the terms and
32 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
45 #include <QtGui/qwindowdefs.h>
46 #include <QtCore/qobject.h>
47 #include <QtGui/qregion.h>
48 #include <QtCore/qnamespace.h>
49 #include <QtCore/qstring.h>
50 #include <QtGui/qkeysequence.h>
51 #include <QtCore/qcoreevent.h>
52 #include <QtGui/qmime.h>
53 #include <QtGui/qdrag.h>
54 #include <QtCore/qvariant.h>
55 #include <QtCore/qmap.h>
56 #include <QtCore/qset.h>
57 #include <QtCore/qfile.h>
70 #ifndef QT_NO_GESTURES
74 class Q_GUI_EXPORT QInputEvent : public QEvent
77 QInputEvent(Type type, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
79 inline Qt::KeyboardModifiers modifiers() const { return modState; }
80 inline void setModifiers(Qt::KeyboardModifiers amodifiers) { modState = amodifiers; }
82 Qt::KeyboardModifiers modState;
85 class Q_GUI_EXPORT QMouseEvent : public QInputEvent
88 QMouseEvent(Type type, const QPointF &pos, Qt::MouseButton button,
89 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
90 QMouseEvent(Type type, const QPointF &pos, const QPointF &globalPos,
91 Qt::MouseButton button, Qt::MouseButtons buttons,
92 Qt::KeyboardModifiers modifiers);
95 inline QPoint pos() const { return p.toPoint(); }
96 inline QPoint globalPos() const { return g.toPoint(); }
97 inline int x() const { return qRound(p.x()); }
98 inline int y() const { return qRound(p.y()); }
99 inline int globalX() const { return qRound(g.x()); }
100 inline int globalY() const { return qRound(g.y()); }
101 inline Qt::MouseButton button() const { return b; }
102 inline Qt::MouseButtons buttons() const { return mouseState; }
104 const QPointF &posF() const { return p; }
105 const QPointF &globalPosF() const { return g; }
108 QT3_SUPPORT_CONSTRUCTOR QMouseEvent(Type type, const QPoint &pos, Qt::ButtonState button, int state);
109 QT3_SUPPORT_CONSTRUCTOR QMouseEvent(Type type, const QPoint &pos, const QPoint &globalPos,
110 Qt::ButtonState button, int state);
111 inline QT3_SUPPORT Qt::ButtonState state() const
112 { return Qt::ButtonState((mouseState^b)|int(modifiers())); }
113 inline QT3_SUPPORT Qt::ButtonState stateAfter() const
114 { return Qt::ButtonState(int(mouseState)|int(modifiers())); }
119 Qt::MouseButtons mouseState;
122 class Q_GUI_EXPORT QHoverEvent : public QInputEvent
125 QHoverEvent(Type type, const QPointF &pos, const QPointF &oldPos, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
128 inline QPoint pos() const { return p.toPoint(); }
129 inline QPoint oldPos() const { return op.toPoint(); }
131 inline const QPointF &posF() const { return p; }
132 inline const QPointF &oldPosF() const { return op; }
138 #ifndef QT_NO_WHEELEVENT
139 class Q_GUI_EXPORT QWheelEvent : public QInputEvent
142 QWheelEvent(const QPointF &pos, int delta,
143 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
144 Qt::Orientation orient = Qt::Vertical);
145 QWheelEvent(const QPointF &pos, const QPointF& globalPos, int delta,
146 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
147 Qt::Orientation orient = Qt::Vertical);
150 inline int delta() const { return d; }
151 inline QPoint pos() const { return p.toPoint(); }
152 inline QPoint globalPos() const { return g.toPoint(); }
153 inline int x() const { return p.x(); }
154 inline int y() const { return p.y(); }
155 inline int globalX() const { return g.x(); }
156 inline int globalY() const { return g.y(); }
158 inline Qt::MouseButtons buttons() const { return mouseState; }
159 Qt::Orientation orientation() const { return o; }
161 inline const QPointF &posF() const { return p; }
162 inline const QPointF &globalPosF() const { return g; }
165 QT3_SUPPORT_CONSTRUCTOR QWheelEvent(const QPoint &pos, int delta, int state,
166 Qt::Orientation orient = Qt::Vertical);
167 QT3_SUPPORT_CONSTRUCTOR QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta, int state,
168 Qt::Orientation orient = Qt::Vertical);
169 inline QT3_SUPPORT Qt::ButtonState state() const
170 { return static_cast<Qt::ButtonState>(int(buttons())|int(modifiers())); }
176 Qt::MouseButtons mouseState;
181 #ifndef QT_NO_TABLETEVENT
182 class Q_GUI_EXPORT QTabletEvent : public QInputEvent
185 enum TabletDevice { NoDevice, Puck, Stylus, Airbrush, FourDMouse,
186 XFreeEraser /*internal*/, RotationStylus };
187 enum PointerType { UnknownPointer, Pen, Cursor, Eraser };
188 QTabletEvent(Type t, const QPoint &pos, const QPoint &globalPos, const QPointF &hiResGlobalPos,
189 int device, int pointerType, qreal pressure, int xTilt, int yTilt,
190 qreal tangentialPressure, qreal rotation, int z,
191 Qt::KeyboardModifiers keyState, qint64 uniqueID);
194 inline const QPoint &pos() const { return mPos; }
195 inline const QPoint &globalPos() const { return mGPos; }
196 inline const QPointF &hiResGlobalPos() const { return mHiResGlobalPos; }
197 inline int x() const { return mPos.x(); }
198 inline int y() const { return mPos.y(); }
199 inline int globalX() const { return mGPos.x(); }
200 inline int globalY() const { return mGPos.y(); }
201 inline qreal hiResGlobalX() const { return mHiResGlobalPos.x(); }
202 inline qreal hiResGlobalY() const { return mHiResGlobalPos.y(); }
203 inline TabletDevice device() const { return TabletDevice(mDev); }
204 inline PointerType pointerType() const { return PointerType(mPointerType); }
205 inline qint64 uniqueId() const { return mUnique; }
206 inline qreal pressure() const { return mPress; }
207 inline int z() const { return mZ; }
208 inline qreal tangentialPressure() const { return mTangential; }
209 inline qreal rotation() const { return mRot; }
210 inline int xTilt() const { return mXT; }
211 inline int yTilt() const { return mYT; }
215 QPointF mHiResGlobalPos;
216 int mDev, mPointerType, mXT, mYT, mZ;
217 qreal mPress, mTangential, mRot;
220 // I don't know what the future holds for tablets but there could be some
221 // new devices coming along, and there seem to be "holes" in the
222 // OS-specific events for this.
225 #endif // QT_NO_TABLETEVENT
227 class Q_GUI_EXPORT QKeyEvent : public QInputEvent
230 QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text = QString(),
231 bool autorep = false, ushort count = 1);
234 int key() const { return k; }
235 #ifndef QT_NO_SHORTCUT
236 bool matches(QKeySequence::StandardKey key) const;
238 Qt::KeyboardModifiers modifiers() const;
239 inline QString text() const { return txt; }
240 inline bool isAutoRepeat() const { return autor; }
241 inline int count() const { return int(c); }
243 // Functions for the extended key event information
244 static QKeyEvent *createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
245 quint32 nativeScanCode, quint32 nativeVirtualKey,
246 quint32 nativeModifiers,
247 const QString& text = QString(), bool autorep = false,
249 inline bool hasExtendedInfo() const { return reinterpret_cast<const QKeyEvent*>(d) == this; }
250 quint32 nativeScanCode() const;
251 quint32 nativeVirtualKey() const;
252 quint32 nativeModifiers() const;
255 inline QT3_SUPPORT_CONSTRUCTOR QKeyEvent(Type type, int key, int /*ascii*/,
256 int modifiers, const QString& text = QString(),
257 bool autorep = false, ushort count = 1)
258 : QInputEvent(type, Qt::KeyboardModifiers(modifiers & (int)Qt::KeyButtonMask)), txt(text), k(key),
259 c(count), autor(autorep)
261 if (key >= Qt::Key_Back && key <= Qt::Key_MediaLast)
264 inline QT3_SUPPORT int ascii() const
265 { return (txt.length() ? txt.unicode()->toLatin1() : 0); }
266 inline QT3_SUPPORT Qt::ButtonState state() const { return Qt::ButtonState(QInputEvent::modifiers()); }
267 inline QT3_SUPPORT Qt::ButtonState stateAfter() const { return Qt::ButtonState(modifiers()); }
278 class Q_GUI_EXPORT QFocusEvent : public QEvent
281 QFocusEvent(Type type, Qt::FocusReason reason=Qt::OtherFocusReason);
284 inline bool gotFocus() const { return type() == FocusIn; }
285 inline bool lostFocus() const { return type() == FocusOut; }
288 enum Reason { Mouse=Qt::MouseFocusReason, Tab=Qt::TabFocusReason,
289 Backtab=Qt::BacktabFocusReason, MenuBar=Qt::MenuBarFocusReason,
290 ActiveWindow=Qt::ActiveWindowFocusReason, Other=Qt::OtherFocusReason,
291 Popup=Qt::PopupFocusReason, Shortcut=Qt::ShortcutFocusReason };
293 Qt::FocusReason reason();
294 Qt::FocusReason reason() const;
297 Qt::FocusReason m_reason;
301 class Q_GUI_EXPORT QPaintEvent : public QEvent
304 QPaintEvent(const QRegion& paintRegion);
305 QPaintEvent(const QRect &paintRect);
308 inline const QRect &rect() const { return m_rect; }
309 inline const QRegion ®ion() const { return m_region; }
312 QT3_SUPPORT_CONSTRUCTOR QPaintEvent(const QRegion &paintRegion, const QRect &paintRect);
313 inline QT3_SUPPORT bool erased() const { return m_erased; }
314 inline QT3_SUPPORT void setErased(bool b) { m_erased = b; }
318 friend class QApplication;
319 friend class QCoreApplication;
325 class QUpdateLaterEvent : public QEvent
328 QUpdateLaterEvent(const QRegion& paintRegion);
329 ~QUpdateLaterEvent();
331 inline const QRegion ®ion() const { return m_region; }
337 class Q_GUI_EXPORT QMoveEvent : public QEvent
340 QMoveEvent(const QPoint &pos, const QPoint &oldPos);
343 inline const QPoint &pos() const { return p; }
344 inline const QPoint &oldPos() const { return oldp;}
347 friend class QApplication;
348 friend class QCoreApplication;
352 class Q_GUI_EXPORT QResizeEvent : public QEvent
355 QResizeEvent(const QSize &size, const QSize &oldSize);
358 inline const QSize &size() const { return s; }
359 inline const QSize &oldSize()const { return olds;}
362 friend class QApplication;
363 friend class QCoreApplication;
367 class Q_GUI_EXPORT QCloseEvent : public QEvent
375 class Q_GUI_EXPORT QIconDragEvent : public QEvent
383 class Q_GUI_EXPORT QShowEvent : public QEvent
391 class Q_GUI_EXPORT QHideEvent : public QEvent
398 #ifndef QT_NO_CONTEXTMENU
399 class Q_GUI_EXPORT QContextMenuEvent : public QInputEvent
402 enum Reason { Mouse, Keyboard, Other };
404 QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos,
405 Qt::KeyboardModifiers modifiers);
406 QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos);
407 QContextMenuEvent(Reason reason, const QPoint &pos);
408 ~QContextMenuEvent();
410 inline int x() const { return p.x(); }
411 inline int y() const { return p.y(); }
412 inline int globalX() const { return gp.x(); }
413 inline int globalY() const { return gp.y(); }
415 inline const QPoint& pos() const { return p; }
416 inline const QPoint& globalPos() const { return gp; }
418 inline Reason reason() const { return Reason(reas); }
421 QT3_SUPPORT_CONSTRUCTOR QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos, int);
422 QT3_SUPPORT_CONSTRUCTOR QContextMenuEvent(Reason reason, const QPoint &pos, int);
424 QT3_SUPPORT Qt::ButtonState state() const;
431 #endif // QT_NO_CONTEXTMENU
433 #ifndef QT_NO_INPUTMETHOD
434 class Q_GUI_EXPORT QInputMethodEvent : public QEvent
446 Attribute(AttributeType t, int s, int l, QVariant val) : type(t), start(s), length(l), value(val) {}
454 QInputMethodEvent(const QString &preeditText, const QList<Attribute> &attributes);
455 void setCommitString(const QString &commitString, int replaceFrom = 0, int replaceLength = 0);
457 inline const QList<Attribute> &attributes() const { return attrs; }
458 inline const QString &preeditString() const { return preedit; }
460 inline const QString &commitString() const { return commit; }
461 inline int replacementStart() const { return replace_from; }
462 inline int replacementLength() const { return replace_length; }
464 QInputMethodEvent(const QInputMethodEvent &other);
468 QList<Attribute> attrs;
473 #endif // QT_NO_INPUTMETHOD
475 #ifndef QT_NO_DRAGANDDROP
479 class Q_GUI_EXPORT QDropEvent : public QEvent
485 QDropEvent(const QPoint& pos, Qt::DropActions actions, const QMimeData *data,
486 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = Drop);
489 inline const QPoint &pos() const { return p; }
490 inline Qt::MouseButtons mouseButtons() const { return mouseState; }
491 inline Qt::KeyboardModifiers keyboardModifiers() const { return modState; }
493 inline Qt::DropActions possibleActions() const { return act; }
494 inline Qt::DropAction proposedAction() const { return default_action; }
495 inline void acceptProposedAction() { drop_action = default_action; accept(); }
497 inline Qt::DropAction dropAction() const { return drop_action; }
498 void setDropAction(Qt::DropAction action);
500 QWidget* source() const;
501 inline const QMimeData *mimeData() const { return mdata; }
504 const char* format(int n = 0) const;
505 QByteArray encodedData(const char*) const;
506 bool provides(const char*) const;
509 inline void accept() { QEvent::accept(); }
510 inline QT3_SUPPORT void accept(bool y) { setAccepted(y); }
511 inline QT3_SUPPORT QByteArray data(const char* f) const { return encodedData(f); }
513 enum Action { Copy, Link, Move, Private, UserAction = Private };
514 QT3_SUPPORT Action action() const;
515 inline QT3_SUPPORT void acceptAction(bool y = true) { if (y) { drop_action = default_action; accept(); } }
516 inline QT3_SUPPORT void setPoint(const QPoint& np) { p = np; }
521 friend class QApplication;
523 Qt::MouseButtons mouseState;
524 Qt::KeyboardModifiers modState;
526 Qt::DropAction drop_action;
527 Qt::DropAction default_action;
528 const QMimeData *mdata;
529 mutable QList<QByteArray> fmts; // only used for QT3_SUPPORT
533 class Q_GUI_EXPORT QDragMoveEvent : public QDropEvent
536 QDragMoveEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
537 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove);
540 inline QRect answerRect() const { return rect; }
542 inline void accept() { QDropEvent::accept(); }
543 inline void ignore() { QDropEvent::ignore(); }
545 inline void accept(const QRect & r) { accept(); rect = r; }
546 inline void ignore(const QRect & r) { ignore(); rect = r; }
549 inline QT3_SUPPORT void accept(bool y) { setAccepted(y); }
553 friend class QApplication;
558 class Q_GUI_EXPORT QDragEnterEvent : public QDragMoveEvent
561 QDragEnterEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
562 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
567 /* An internal class */
568 class Q_GUI_EXPORT QDragResponseEvent : public QEvent
571 QDragResponseEvent(bool accepted);
572 ~QDragResponseEvent();
574 inline bool dragAccepted() const { return a; }
580 class Q_GUI_EXPORT QDragLeaveEvent : public QEvent
586 #endif // QT_NO_DRAGANDDROP
589 class Q_GUI_EXPORT QHelpEvent : public QEvent
592 QHelpEvent(Type type, const QPoint &pos, const QPoint &globalPos);
595 inline int x() const { return p.x(); }
596 inline int y() const { return p.y(); }
597 inline int globalX() const { return gp.x(); }
598 inline int globalY() const { return gp.y(); }
600 inline const QPoint& pos() const { return p; }
601 inline const QPoint& globalPos() const { return gp; }
608 #ifndef QT_NO_STATUSTIP
609 class Q_GUI_EXPORT QStatusTipEvent : public QEvent
612 QStatusTipEvent(const QString &tip);
615 inline QString tip() const { return s; }
621 #ifndef QT_NO_WHATSTHIS
622 class Q_GUI_EXPORT QWhatsThisClickedEvent : public QEvent
625 QWhatsThisClickedEvent(const QString &href);
626 ~QWhatsThisClickedEvent();
628 inline QString href() const { return s; }
635 class Q_GUI_EXPORT QActionEvent : public QEvent
639 QActionEvent(int type, QAction *action, QAction *before = 0);
642 inline QAction *action() const { return act; }
643 inline QAction *before() const { return bef; }
647 class Q_GUI_EXPORT QFileOpenEvent : public QEvent
650 QFileOpenEvent(const QString &file);
651 QFileOpenEvent(const QUrl &url);
653 QFileOpenEvent(const RFile &fileHandle);
657 inline QString file() const { return f; }
659 bool openFile(QFile &file, QIODevice::OpenMode flags) const;
664 #ifndef QT_NO_TOOLBAR
665 class Q_GUI_EXPORT QToolBarChangeEvent : public QEvent
668 QToolBarChangeEvent(bool t);
669 ~QToolBarChangeEvent();
671 inline bool toggle() const { return tog; }
677 #ifndef QT_NO_SHORTCUT
678 class Q_GUI_EXPORT QShortcutEvent : public QEvent
681 QShortcutEvent(const QKeySequence &key, int id, bool ambiguous = false);
684 inline const QKeySequence &key() { return sequence; }
685 inline const QKeySequence &key() const { return sequence; }
686 inline int shortcutId() { return sid; }
687 inline int shortcutId() const { return sid; }
688 inline bool isAmbiguous() { return ambig; }
689 inline bool isAmbiguous() const { return ambig; }
691 QKeySequence sequence;
697 #ifndef QT_NO_CLIPBOARD
698 class Q_GUI_EXPORT QClipboardEvent : public QEvent
701 QClipboardEvent(QEventPrivate *data);
704 QEventPrivate *data() { return d; }
708 class Q_GUI_EXPORT QWindowStateChangeEvent: public QEvent
711 QWindowStateChangeEvent(Qt::WindowStates aOldState);
712 QWindowStateChangeEvent(Qt::WindowStates aOldState, bool isOverride);
713 ~QWindowStateChangeEvent();
715 inline Qt::WindowStates oldState() const { return ostate; }
716 bool isOverride() const;
719 Qt::WindowStates ostate;
724 class Q_GUI_EXPORT QMenubarUpdatedEvent: public QEvent
727 QMenubarUpdatedEvent(QMenuBar * const menBar);
728 inline QMenuBar *menuBar() { return m_menuBar; }
734 #ifndef QT_NO_DEBUG_STREAM
735 Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *);
738 #ifndef QT_NO_SHORTCUT
739 inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key){return (e ? e->matches(key) : false);}
740 inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e){return (e ? e->matches(key) : false);}
741 #endif // QT_NO_SHORTCUT
743 class QTouchEventTouchPointPrivate;
744 class Q_GUI_EXPORT QTouchEvent : public QInputEvent
747 class Q_GUI_EXPORT TouchPoint
750 TouchPoint(int id = -1);
751 TouchPoint(const QTouchEvent::TouchPoint &other);
756 Qt::TouchPointState state() const;
757 bool isPrimary() const;
760 QPointF startPos() const;
761 QPointF lastPos() const;
763 QPointF scenePos() const;
764 QPointF startScenePos() const;
765 QPointF lastScenePos() const;
767 QPointF screenPos() const;
768 QPointF startScreenPos() const;
769 QPointF lastScreenPos() const;
771 QPointF normalizedPos() const;
772 QPointF startNormalizedPos() const;
773 QPointF lastNormalizedPos() const;
776 QRectF sceneRect() const;
777 QRectF screenRect() const;
779 qreal pressure() const;
783 void setState(Qt::TouchPointStates state);
784 void setPos(const QPointF &pos);
785 void setScenePos(const QPointF &scenePos);
786 void setScreenPos(const QPointF &screenPos);
787 void setNormalizedPos(const QPointF &normalizedPos);
788 void setStartPos(const QPointF &startPos);
789 void setStartScenePos(const QPointF &startScenePos);
790 void setStartScreenPos(const QPointF &startScreenPos);
791 void setStartNormalizedPos(const QPointF &startNormalizedPos);
792 void setLastPos(const QPointF &lastPos);
793 void setLastScenePos(const QPointF &lastScenePos);
794 void setLastScreenPos(const QPointF &lastScreenPos);
795 void setLastNormalizedPos(const QPointF &lastNormalizedPos);
796 void setRect(const QRectF &rect);
797 void setSceneRect(const QRectF &sceneRect);
798 void setScreenRect(const QRectF &screenRect);
799 void setPressure(qreal pressure);
800 QTouchEvent::TouchPoint &operator=(const QTouchEvent::TouchPoint &other);
803 QTouchEventTouchPointPrivate *d;
804 friend class QApplication;
805 friend class QApplicationPrivate;
813 QTouchEvent(QEvent::Type eventType,
814 QTouchEvent::DeviceType deviceType = TouchScreen,
815 Qt::KeyboardModifiers modifiers = Qt::NoModifier,
816 Qt::TouchPointStates touchPointStates = 0,
817 const QList<QTouchEvent::TouchPoint> &touchPoints = QList<QTouchEvent::TouchPoint>());
820 inline QWidget *widget() const { return _widget; }
821 inline QTouchEvent::DeviceType deviceType() const { return _deviceType; }
822 inline Qt::TouchPointStates touchPointStates() const { return _touchPointStates; }
823 inline const QList<QTouchEvent::TouchPoint> &touchPoints() const { return _touchPoints; }
826 inline void setWidget(QWidget *awidget) { _widget = awidget; }
827 inline void setDeviceType(DeviceType adeviceType) { _deviceType = adeviceType; }
828 inline void setTouchPointStates(Qt::TouchPointStates aTouchPointStates) { _touchPointStates = aTouchPointStates; }
829 inline void setTouchPoints(const QList<QTouchEvent::TouchPoint> &atouchPoints) { _touchPoints = atouchPoints; }
833 QTouchEvent::DeviceType _deviceType;
834 Qt::TouchPointStates _touchPointStates;
835 QList<QTouchEvent::TouchPoint> _touchPoints;
837 friend class QApplication;
838 friend class QApplicationPrivate;
841 #ifndef QT_NO_GESTURES
843 class QGestureEventPrivate;
844 class Q_GUI_EXPORT QGestureEvent : public QEvent
847 QGestureEvent(const QList<QGesture *> &gestures);
850 QList<QGesture *> gestures() const;
851 QGesture *gesture(Qt::GestureType type) const;
853 QList<QGesture *> activeGestures() const;
854 QList<QGesture *> canceledGestures() const;
856 #ifdef Q_NO_USING_KEYWORD
857 inline void setAccepted(bool accepted) { QEvent::setAccepted(accepted); }
858 inline bool isAccepted() const { return QEvent::isAccepted(); }
860 inline void accept() { QEvent::accept(); }
861 inline void ignore() { QEvent::ignore(); }
863 using QEvent::setAccepted;
864 using QEvent::isAccepted;
865 using QEvent::accept;
866 using QEvent::ignore;
869 void setAccepted(QGesture *, bool);
870 void accept(QGesture *);
871 void ignore(QGesture *);
872 bool isAccepted(QGesture *) const;
874 void setAccepted(Qt::GestureType, bool);
875 void accept(Qt::GestureType);
876 void ignore(Qt::GestureType);
877 bool isAccepted(Qt::GestureType) const;
879 void setWidget(QWidget *widget);
880 QWidget *widget() const;
882 #ifndef QT_NO_GRAPHICSVIEW
883 QPointF mapToGraphicsScene(const QPointF &gesturePoint) const;
887 QGestureEventPrivate *d_func();
888 const QGestureEventPrivate *d_func() const;
890 friend class QApplication;
891 friend class QGestureManager;
893 #endif // QT_NO_GESTURES
895 class QScrollPrepareEventPrivate;
896 class Q_GUI_EXPORT QScrollPrepareEvent : public QEvent
899 QScrollPrepareEvent(const QPointF &startPos);
900 ~QScrollPrepareEvent();
902 QPointF startPos() const;
904 QSizeF viewportSize() const;
905 QRectF contentPosRange() const;
906 QPointF contentPos() const;
908 void setViewportSize(const QSizeF &size);
909 void setContentPosRange(const QRectF &rect);
910 void setContentPos(const QPointF &pos);
913 QScrollPrepareEventPrivate *d_func();
914 const QScrollPrepareEventPrivate *d_func() const;
918 class QScrollEventPrivate;
919 class Q_GUI_EXPORT QScrollEvent : public QEvent
929 QScrollEvent(const QPointF &contentPos, const QPointF &overshoot, ScrollState scrollState);
932 QPointF contentPos() const;
933 QPointF overshootDistance() const;
934 ScrollState scrollState() const;
937 QScrollEventPrivate *d_func();
938 const QScrollEventPrivate *d_func() const;