src/gui/kernel/qgesture_p.h
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    65 {
    65 {
    66     Q_DECLARE_PUBLIC(QGesture)
    66     Q_DECLARE_PUBLIC(QGesture)
    67 
    67 
    68 public:
    68 public:
    69     QGesturePrivate()
    69     QGesturePrivate()
    70         : gestureType(Qt::CustomGesture), state(Qt::NoGesture), isHotSpotSet(false),
    70         : gestureType(Qt::CustomGesture), state(Qt::NoGesture),
    71           targetObject(0)
    71           isHotSpotSet(false), gestureCancelPolicy(0)
       
    72 
    72     {
    73     {
    73     }
    74     }
    74 
    75 
    75     Qt::GestureType gestureType;
    76     Qt::GestureType gestureType;
    76     Qt::GestureState state;
    77     Qt::GestureState state;
    77     QPointF hotSpot;
    78     QPointF hotSpot;
    78     bool isHotSpotSet;
    79     uint isHotSpotSet : 1;
    79     QObject *targetObject;
    80     uint gestureCancelPolicy : 2;
    80 };
    81 };
    81 
    82 
    82 class QPanGesturePrivate : public QGesturePrivate
    83 class QPanGesturePrivate : public QGesturePrivate
    83 {
    84 {
    84     Q_DECLARE_PUBLIC(QPanGesture)
    85     Q_DECLARE_PUBLIC(QPanGesture)
    87     QPanGesturePrivate()
    88     QPanGesturePrivate()
    88         : acceleration(0)
    89         : acceleration(0)
    89     {
    90     {
    90     }
    91     }
    91 
    92 
    92     QPointF totalOffset;
       
    93     QPointF lastOffset;
    93     QPointF lastOffset;
    94     QPointF offset;
    94     QPointF offset;
    95     QPoint lastPosition;
    95     QPoint startPosition;
    96     qreal acceleration;
    96     qreal acceleration;
    97 };
    97 };
    98 
    98 
    99 class QPinchGesturePrivate : public QGesturePrivate
    99 class QPinchGesturePrivate : public QGesturePrivate
   100 {
   100 {
   101     Q_DECLARE_PUBLIC(QPinchGesture)
   101     Q_DECLARE_PUBLIC(QPinchGesture)
   102 
   102 
   103 public:
   103 public:
   104     QPinchGesturePrivate()
   104     QPinchGesturePrivate()
   105         : whatChanged(0), totalScaleFactor(0), lastScaleFactor(0), scaleFactor(0),
   105         : totalChangeFlags(0), changeFlags(0),
   106           totalRotationAngle(0), lastRotationAngle(0), rotationAngle(0)
   106           totalScaleFactor(0), lastScaleFactor(0), scaleFactor(0),
       
   107           totalRotationAngle(0), lastRotationAngle(0), rotationAngle(0),
       
   108           isNewSequence(true)
   107     {
   109     {
   108     }
   110     }
   109 
   111 
   110     QPinchGesture::WhatChanged whatChanged;
   112     QPinchGesture::ChangeFlags totalChangeFlags;
       
   113     QPinchGesture::ChangeFlags changeFlags;
   111 
   114 
   112     QPointF startCenterPoint;
   115     QPointF startCenterPoint;
   113     QPointF lastCenterPoint;
   116     QPointF lastCenterPoint;
   114     QPointF centerPoint;
   117     QPointF centerPoint;
   115 
   118 
   118     qreal scaleFactor;
   121     qreal scaleFactor;
   119 
   122 
   120     qreal totalRotationAngle;
   123     qreal totalRotationAngle;
   121     qreal lastRotationAngle;
   124     qreal lastRotationAngle;
   122     qreal rotationAngle;
   125     qreal rotationAngle;
       
   126 
       
   127     bool isNewSequence;
       
   128     QPointF startPosition[2];
   123 };
   129 };
   124 
   130 
   125 class QSwipeGesturePrivate : public QGesturePrivate
   131 class QSwipeGesturePrivate : public QGesturePrivate
   126 {
   132 {
   127     Q_DECLARE_PUBLIC(QSwipeGesture)
   133     Q_DECLARE_PUBLIC(QSwipeGesture)
   128 
   134 
   129 public:
   135 public:
   130     QSwipeGesturePrivate()
   136     QSwipeGesturePrivate()
   131         : horizontalDirection(QSwipeGesture::NoDirection),
   137         : horizontalDirection(QSwipeGesture::NoDirection),
   132           verticalDirection(QSwipeGesture::NoDirection),
   138           verticalDirection(QSwipeGesture::NoDirection),
   133           swipeAngle(0)
   139           swipeAngle(0),
       
   140           started(false), speed(0)
   134     {
   141     {
   135     }
   142     }
   136 
   143 
   137     QSwipeGesture::SwipeDirection horizontalDirection;
   144     QSwipeGesture::SwipeDirection horizontalDirection;
   138     QSwipeGesture::SwipeDirection verticalDirection;
   145     QSwipeGesture::SwipeDirection verticalDirection;
   139     qreal swipeAngle;
   146     qreal swipeAngle;
       
   147 
       
   148     QPoint lastPositions[3];
       
   149     bool started;
       
   150     qreal speed;
       
   151     QTime time;
       
   152 };
       
   153 
       
   154 class QTapGesturePrivate : public QGesturePrivate
       
   155 {
       
   156     Q_DECLARE_PUBLIC(QTapGesture)
       
   157 
       
   158 public:
       
   159     QTapGesturePrivate()
       
   160     {
       
   161     }
       
   162 
       
   163     QPointF position;
       
   164 };
       
   165 
       
   166 class QTapAndHoldGesturePrivate : public QGesturePrivate
       
   167 {
       
   168     Q_DECLARE_PUBLIC(QTapAndHoldGesture)
       
   169 
       
   170 public:
       
   171     QTapAndHoldGesturePrivate()
       
   172         : timerId(0)
       
   173     {
       
   174     }
       
   175 
       
   176     QPointF position;
       
   177     int timerId;
   140 };
   178 };
   141 
   179 
   142 QT_END_NAMESPACE
   180 QT_END_NAMESPACE
   143 
   181 
   144 #endif // QGESTURE_P_H
   182 #endif // QGESTURE_P_H