1// qgesture.sip generated by MetaSIP 2// 3// This file is part of the QtWidgets Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QGesture : QObject 24{ 25%TypeHeaderCode 26#include <qgesture.h> 27%End 28 29public: 30 explicit QGesture(QObject *parent /TransferThis/ = 0); 31 virtual ~QGesture(); 32 Qt::GestureType gestureType() const; 33 Qt::GestureState state() const; 34 QPointF hotSpot() const; 35 void setHotSpot(const QPointF &value); 36 bool hasHotSpot() const; 37 void unsetHotSpot(); 38 39 enum GestureCancelPolicy 40 { 41 CancelNone, 42 CancelAllInContext, 43 }; 44 45 void setGestureCancelPolicy(QGesture::GestureCancelPolicy policy); 46 QGesture::GestureCancelPolicy gestureCancelPolicy() const; 47}; 48 49class QPanGesture : QGesture 50{ 51%TypeHeaderCode 52#include <qgesture.h> 53%End 54 55public: 56 explicit QPanGesture(QObject *parent /TransferThis/ = 0); 57 virtual ~QPanGesture(); 58 QPointF lastOffset() const; 59 QPointF offset() const; 60 QPointF delta() const; 61 qreal acceleration() const; 62 void setLastOffset(const QPointF &value); 63 void setOffset(const QPointF &value); 64 void setAcceleration(qreal value); 65}; 66 67class QPinchGesture : QGesture 68{ 69%TypeHeaderCode 70#include <qgesture.h> 71%End 72 73public: 74 enum ChangeFlag 75 { 76 ScaleFactorChanged, 77 RotationAngleChanged, 78 CenterPointChanged, 79 }; 80 81 typedef QFlags<QPinchGesture::ChangeFlag> ChangeFlags; 82 explicit QPinchGesture(QObject *parent /TransferThis/ = 0); 83 virtual ~QPinchGesture(); 84 QPinchGesture::ChangeFlags totalChangeFlags() const; 85 void setTotalChangeFlags(QPinchGesture::ChangeFlags value); 86 QPinchGesture::ChangeFlags changeFlags() const; 87 void setChangeFlags(QPinchGesture::ChangeFlags value); 88 QPointF startCenterPoint() const; 89 QPointF lastCenterPoint() const; 90 QPointF centerPoint() const; 91 void setStartCenterPoint(const QPointF &value); 92 void setLastCenterPoint(const QPointF &value); 93 void setCenterPoint(const QPointF &value); 94 qreal totalScaleFactor() const; 95 qreal lastScaleFactor() const; 96 qreal scaleFactor() const; 97 void setTotalScaleFactor(qreal value); 98 void setLastScaleFactor(qreal value); 99 void setScaleFactor(qreal value); 100 qreal totalRotationAngle() const; 101 qreal lastRotationAngle() const; 102 qreal rotationAngle() const; 103 void setTotalRotationAngle(qreal value); 104 void setLastRotationAngle(qreal value); 105 void setRotationAngle(qreal value); 106}; 107 108class QSwipeGesture : QGesture 109{ 110%TypeHeaderCode 111#include <qgesture.h> 112%End 113 114public: 115 enum SwipeDirection 116 { 117 NoDirection, 118 Left, 119 Right, 120 Up, 121 Down, 122 }; 123 124 explicit QSwipeGesture(QObject *parent /TransferThis/ = 0); 125 virtual ~QSwipeGesture(); 126 QSwipeGesture::SwipeDirection horizontalDirection() const; 127 QSwipeGesture::SwipeDirection verticalDirection() const; 128 qreal swipeAngle() const; 129 void setSwipeAngle(qreal value); 130}; 131 132class QTapGesture : QGesture 133{ 134%TypeHeaderCode 135#include <qgesture.h> 136%End 137 138public: 139 explicit QTapGesture(QObject *parent /TransferThis/ = 0); 140 virtual ~QTapGesture(); 141 QPointF position() const; 142 void setPosition(const QPointF &pos); 143}; 144 145class QTapAndHoldGesture : QGesture 146{ 147%TypeHeaderCode 148#include <qgesture.h> 149%End 150 151public: 152 explicit QTapAndHoldGesture(QObject *parent /TransferThis/ = 0); 153 virtual ~QTapAndHoldGesture(); 154 QPointF position() const; 155 void setPosition(const QPointF &pos); 156 static void setTimeout(int msecs); 157 static int timeout(); 158}; 159 160class QGestureEvent : QEvent 161{ 162%TypeHeaderCode 163#include <qgesture.h> 164%End 165 166%ConvertToSubClassCode 167 sipType = ((sipCpp->type() == QEvent::Gesture) ? sipType_QGestureEvent : 0); 168%End 169 170public: 171 explicit QGestureEvent(const QList<QGesture *> &gestures); 172 virtual ~QGestureEvent(); 173 QList<QGesture *> gestures() const; 174 QGesture *gesture(Qt::GestureType type) const; 175 QList<QGesture *> activeGestures() const; 176 QList<QGesture *> canceledGestures() const; 177 void setAccepted(bool accepted); 178 bool isAccepted() const; 179 void accept(); 180 void ignore(); 181 void setAccepted(QGesture *, bool); 182 void accept(QGesture *); 183 void ignore(QGesture *); 184 bool isAccepted(QGesture *) const; 185 void setAccepted(Qt::GestureType, bool); 186 void accept(Qt::GestureType); 187 void ignore(Qt::GestureType); 188 bool isAccepted(Qt::GestureType) const; 189 QWidget *widget() const; 190 QPointF mapToGraphicsScene(const QPointF &gesturePoint) const; 191}; 192