src/declarative/util/qdeclarativespringanimation_p.h
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
    52 QT_BEGIN_NAMESPACE
    52 QT_BEGIN_NAMESPACE
    53 
    53 
    54 QT_MODULE(Declarative)
    54 QT_MODULE(Declarative)
    55 
    55 
    56 class QDeclarativeSpringAnimationPrivate;
    56 class QDeclarativeSpringAnimationPrivate;
    57 class Q_AUTOTEST_EXPORT QDeclarativeSpringAnimation : public QDeclarativeAbstractAnimation
    57 class Q_AUTOTEST_EXPORT QDeclarativeSpringAnimation : public QDeclarativeNumberAnimation
    58 {
    58 {
    59     Q_OBJECT
    59     Q_OBJECT
    60     Q_DECLARE_PRIVATE(QDeclarativeSpringAnimation)
    60     Q_DECLARE_PRIVATE(QDeclarativeSpringAnimation)
    61     Q_INTERFACES(QDeclarativePropertyValueSource)
    61     Q_INTERFACES(QDeclarativePropertyValueSource)
    62 
    62 
    63     Q_PROPERTY(qreal to READ to WRITE setTo NOTIFY toChanged)
       
    64     Q_PROPERTY(qreal from READ from WRITE setFrom NOTIFY fromChanged)
       
    65     Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity)
    63     Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity)
    66     Q_PROPERTY(qreal spring READ spring WRITE setSpring)
    64     Q_PROPERTY(qreal spring READ spring WRITE setSpring)
    67     Q_PROPERTY(qreal damping READ damping WRITE setDamping)
    65     Q_PROPERTY(qreal damping READ damping WRITE setDamping)
    68     Q_PROPERTY(qreal epsilon READ epsilon WRITE setEpsilon)
    66     Q_PROPERTY(qreal epsilon READ epsilon WRITE setEpsilon)
    69     Q_PROPERTY(qreal modulus READ modulus WRITE setModulus NOTIFY modulusChanged)
    67     Q_PROPERTY(qreal modulus READ modulus WRITE setModulus NOTIFY modulusChanged)
    70     Q_PROPERTY(qreal mass READ mass WRITE setMass NOTIFY massChanged)
    68     Q_PROPERTY(qreal mass READ mass WRITE setMass NOTIFY massChanged)
    71 
    69 
    72 public:
    70 public:
    73     QDeclarativeSpringAnimation(QObject *parent=0);
    71     QDeclarativeSpringAnimation(QObject *parent=0);
    74     ~QDeclarativeSpringAnimation();
    72     ~QDeclarativeSpringAnimation();
    75 
       
    76     virtual void setTarget(const QDeclarativeProperty &);
       
    77 
       
    78     qreal to() const;
       
    79     void setTo(qreal value);
       
    80 
       
    81     qreal from() const;
       
    82     void setFrom(qreal value);
       
    83 
    73 
    84     qreal velocity() const;
    74     qreal velocity() const;
    85     void setVelocity(qreal velocity);
    75     void setVelocity(qreal velocity);
    86 
    76 
    87     qreal spring() const;
    77     qreal spring() const;
    97     void setMass(qreal modulus);
    87     void setMass(qreal modulus);
    98 
    88 
    99     qreal modulus() const;
    89     qreal modulus() const;
   100     void setModulus(qreal modulus);
    90     void setModulus(qreal modulus);
   101 
    91 
   102     bool enabled() const;
       
   103     void setEnabled(bool enabled);
       
   104 
       
   105     virtual void transition(QDeclarativeStateActions &actions,
    92     virtual void transition(QDeclarativeStateActions &actions,
   106                             QDeclarativeProperties &modified,
    93                             QDeclarativeProperties &modified,
   107                             TransitionDirection direction);
    94                             TransitionDirection direction);
   108 
    95 
   109 protected:
    96 protected:
   110     virtual QAbstractAnimation *qtAnimation();
    97     virtual QAbstractAnimation *qtAnimation();
   111 
    98 
   112 Q_SIGNALS:
    99 Q_SIGNALS:
   113     void toChanged(qreal);
       
   114     void fromChanged(qreal);
       
   115     void modulusChanged();
   100     void modulusChanged();
   116     void massChanged();
   101     void massChanged();
   117     void syncChanged();
   102     void syncChanged();
   118 };
   103 };
   119 
   104