src/declarative/graphicsitems/qdeclarativeflickable_p.h
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
    50 
    50 
    51 QT_MODULE(Declarative)
    51 QT_MODULE(Declarative)
    52 
    52 
    53 class QDeclarativeFlickablePrivate;
    53 class QDeclarativeFlickablePrivate;
    54 class QDeclarativeFlickableVisibleArea;
    54 class QDeclarativeFlickableVisibleArea;
    55 class Q_DECLARATIVE_EXPORT QDeclarativeFlickable : public QDeclarativeItem
    55 class Q_AUTOTEST_EXPORT QDeclarativeFlickable : public QDeclarativeItem
    56 {
    56 {
    57     Q_OBJECT
    57     Q_OBJECT
    58 
    58 
    59     Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged)
    59     Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged)
    60     Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged)
    60     Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged)
    61     Q_PROPERTY(qreal contentX READ contentX WRITE setContentX NOTIFY contentXChanged)
    61     Q_PROPERTY(qreal contentX READ contentX WRITE setContentX NOTIFY contentXChanged)
    62     Q_PROPERTY(qreal contentY READ contentY WRITE setContentY NOTIFY contentYChanged)
    62     Q_PROPERTY(qreal contentY READ contentY WRITE setContentY NOTIFY contentYChanged)
       
    63     Q_PROPERTY(QDeclarativeItem *contentItem READ contentItem CONSTANT)
    63 
    64 
    64     Q_PROPERTY(qreal horizontalVelocity READ horizontalVelocity NOTIFY horizontalVelocityChanged)
    65     Q_PROPERTY(qreal horizontalVelocity READ horizontalVelocity NOTIFY horizontalVelocityChanged)
    65     Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged)
    66     Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged)
    66 
    67 
    67     Q_PROPERTY(bool overShoot READ overShoot WRITE setOverShoot NOTIFY overShootChanged) // deprecated
       
    68     Q_PROPERTY(BoundsBehavior boundsBehavior READ boundsBehavior WRITE setBoundsBehavior NOTIFY boundsBehaviorChanged)
    68     Q_PROPERTY(BoundsBehavior boundsBehavior READ boundsBehavior WRITE setBoundsBehavior NOTIFY boundsBehaviorChanged)
    69     Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity NOTIFY maximumFlickVelocityChanged)
    69     Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity NOTIFY maximumFlickVelocityChanged)
    70     Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged)
    70     Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged)
    71     Q_PROPERTY(bool moving READ isMoving NOTIFY movingChanged)
    71     Q_PROPERTY(bool moving READ isMoving NOTIFY movingChanged)
    72     Q_PROPERTY(bool movingHorizontally READ isMovingHorizontally NOTIFY movingHorizontallyChanged)
    72     Q_PROPERTY(bool movingHorizontally READ isMovingHorizontally NOTIFY movingHorizontallyChanged)
    73     Q_PROPERTY(bool movingVertically READ isMovingVertically NOTIFY movingVerticallyChanged)
    73     Q_PROPERTY(bool movingVertically READ isMovingVertically NOTIFY movingVerticallyChanged)
    74     Q_PROPERTY(bool flicking READ isFlicking NOTIFY flickingChanged)
    74     Q_PROPERTY(bool flicking READ isFlicking NOTIFY flickingChanged)
    75     Q_PROPERTY(bool flickingHorizontally READ isFlickingHorizontally NOTIFY flickingHorizontallyChanged)
    75     Q_PROPERTY(bool flickingHorizontally READ isFlickingHorizontally NOTIFY flickingHorizontallyChanged)
    76     Q_PROPERTY(bool flickingVertically READ isFlickingVertically NOTIFY flickingVerticallyChanged)
    76     Q_PROPERTY(bool flickingVertically READ isFlickingVertically NOTIFY flickingVerticallyChanged)
    77     Q_PROPERTY(FlickableDirection flickDirection READ flickDirection WRITE setFlickDirection NOTIFY flickableDirectionChanged) // deprecated
       
    78     Q_PROPERTY(FlickableDirection flickableDirection READ flickableDirection WRITE setFlickableDirection NOTIFY flickableDirectionChanged)
    77     Q_PROPERTY(FlickableDirection flickableDirection READ flickableDirection WRITE setFlickableDirection NOTIFY flickableDirectionChanged)
    79 
    78 
    80     Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged)
    79     Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged)
    81     Q_PROPERTY(int pressDelay READ pressDelay WRITE setPressDelay NOTIFY pressDelayChanged)
    80     Q_PROPERTY(int pressDelay READ pressDelay WRITE setPressDelay NOTIFY pressDelayChanged)
    82 
    81 
    99     ~QDeclarativeFlickable();
    98     ~QDeclarativeFlickable();
   100 
    99 
   101     QDeclarativeListProperty<QObject> flickableData();
   100     QDeclarativeListProperty<QObject> flickableData();
   102     QDeclarativeListProperty<QGraphicsObject> flickableChildren();
   101     QDeclarativeListProperty<QGraphicsObject> flickableChildren();
   103 
   102 
   104     bool overShoot() const;
       
   105     void setOverShoot(bool);
       
   106 
       
   107     enum BoundsBehavior { StopAtBounds, DragOverBounds, DragAndOvershootBounds };
   103     enum BoundsBehavior { StopAtBounds, DragOverBounds, DragAndOvershootBounds };
   108     BoundsBehavior boundsBehavior() const;
   104     BoundsBehavior boundsBehavior() const;
   109     void setBoundsBehavior(BoundsBehavior);
   105     void setBoundsBehavior(BoundsBehavior);
   110 
   106 
   111     qreal contentWidth() const;
   107     qreal contentWidth() const;
   113 
   109 
   114     qreal contentHeight() const;
   110     qreal contentHeight() const;
   115     void setContentHeight(qreal);
   111     void setContentHeight(qreal);
   116 
   112 
   117     qreal contentX() const;
   113     qreal contentX() const;
   118     void setContentX(qreal pos);
   114     virtual void setContentX(qreal pos);
   119 
   115 
   120     qreal contentY() const;
   116     qreal contentY() const;
   121     void setContentY(qreal pos);
   117     virtual void setContentY(qreal pos);
   122 
   118 
   123     bool isMoving() const;
   119     bool isMoving() const;
   124     bool isMovingHorizontally() const;
   120     bool isMovingHorizontally() const;
   125     bool isMovingVertically() const;
   121     bool isMovingVertically() const;
   126     bool isFlicking() const;
   122     bool isFlicking() const;
   145     bool isAtXEnd() const;
   141     bool isAtXEnd() const;
   146     bool isAtXBeginning() const;
   142     bool isAtXBeginning() const;
   147     bool isAtYEnd() const;
   143     bool isAtYEnd() const;
   148     bool isAtYBeginning() const;
   144     bool isAtYBeginning() const;
   149 
   145 
   150     QDeclarativeItem *viewport();
   146     QDeclarativeItem *contentItem();
   151 
   147 
   152     enum FlickableDirection { AutoFlickDirection=0x00, HorizontalFlick=0x01, VerticalFlick=0x02, HorizontalAndVerticalFlick=0x03 };
   148     enum FlickableDirection { AutoFlickDirection=0x00, HorizontalFlick=0x01, VerticalFlick=0x02, HorizontalAndVerticalFlick=0x03 };
   153     FlickableDirection flickDirection() const; // deprecated
       
   154     void setFlickDirection(FlickableDirection); // deprecated
       
   155     FlickableDirection flickableDirection() const;
   149     FlickableDirection flickableDirection() const;
   156     void setFlickableDirection(FlickableDirection);
   150     void setFlickableDirection(FlickableDirection);
   157 
   151 
   158 Q_SIGNALS:
   152 Q_SIGNALS:
   159     void contentWidthChanged();
   153     void contentWidthChanged();
   170     void verticalVelocityChanged();
   164     void verticalVelocityChanged();
   171     void isAtBoundaryChanged();
   165     void isAtBoundaryChanged();
   172     void pageChanged();
   166     void pageChanged();
   173     void flickableDirectionChanged();
   167     void flickableDirectionChanged();
   174     void interactiveChanged();
   168     void interactiveChanged();
   175     void overShootChanged();
       
   176     void boundsBehaviorChanged();
   169     void boundsBehaviorChanged();
   177     void maximumFlickVelocityChanged();
   170     void maximumFlickVelocityChanged();
   178     void flickDecelerationChanged();
   171     void flickDecelerationChanged();
   179     void pressDelayChanged();
   172     void pressDelayChanged();
   180     void movementStarted();
   173     void movementStarted();