homescreenapp/hsutils/src/hspropertyanimationwrapper.cpp
changeset 77 4b195f3bea29
equal deleted inserted replaced
61:2b1b11a301d2 77:4b195f3bea29
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #include <QPropertyAnimation>
       
    19 #include <QEasingCurve>
       
    20 #include "hspropertyanimationwrapper.h"
       
    21 
       
    22 /*!
       
    23     \class HsMessageBoxWrapper
       
    24     \ingroup group_hsutils
       
    25     \brief 
       
    26 */
       
    27 
       
    28 struct HsPropertyAnimationWrapperImpl
       
    29 {
       
    30 public:
       
    31     QPropertyAnimation *mPropertyAnimation;
       
    32 };
       
    33 
       
    34 /*!
       
    35 
       
    36 */
       
    37 HsPropertyAnimationWrapper::HsPropertyAnimationWrapper(QObject *parent)
       
    38   : QObject(parent),mImpl(new HsPropertyAnimationWrapperImpl)
       
    39 {
       
    40     mImpl->mPropertyAnimation = new QPropertyAnimation(parent);
       
    41     connect(mImpl->mPropertyAnimation,SIGNAL(finished()),SIGNAL(finished()));
       
    42 }
       
    43 
       
    44 /*!
       
    45 
       
    46 */
       
    47 HsPropertyAnimationWrapper::~HsPropertyAnimationWrapper()
       
    48 {
       
    49 
       
    50 }
       
    51 
       
    52 /*!
       
    53 
       
    54 */
       
    55 void HsPropertyAnimationWrapper::setTargetObject(QObject *target)
       
    56 {
       
    57    mImpl->mPropertyAnimation->setTargetObject(target);
       
    58 }
       
    59 /*!
       
    60 
       
    61 */
       
    62 void HsPropertyAnimationWrapper::setPropertyName(const QByteArray &propertyName)
       
    63 {
       
    64    mImpl->mPropertyAnimation->setPropertyName(propertyName);
       
    65 }
       
    66 
       
    67 bool HsPropertyAnimationWrapper::isRunning()
       
    68 {
       
    69     return (mImpl->mPropertyAnimation->state() == QAbstractAnimation::Running);
       
    70 }
       
    71 
       
    72 void HsPropertyAnimationWrapper::setEndValue(const QVariant &value)
       
    73 {
       
    74     mImpl->mPropertyAnimation->setEndValue(value);
       
    75 }
       
    76 
       
    77 void HsPropertyAnimationWrapper::setDuration(int msecs)
       
    78 {
       
    79     mImpl->mPropertyAnimation->setDuration(msecs);
       
    80 }
       
    81 
       
    82 void HsPropertyAnimationWrapper::setForward()
       
    83 {
       
    84     mImpl->mPropertyAnimation->setDirection(QAbstractAnimation::Forward);
       
    85 }
       
    86 
       
    87 void HsPropertyAnimationWrapper::setBackward()
       
    88 {
       
    89     mImpl->mPropertyAnimation->setDirection(QAbstractAnimation::Backward);
       
    90 }
       
    91 
       
    92 bool HsPropertyAnimationWrapper::isForward() const
       
    93 {
       
    94     return (mImpl->mPropertyAnimation->direction() == QAbstractAnimation::Forward);
       
    95 }
       
    96 /*!
       
    97 
       
    98 */
       
    99 void HsPropertyAnimationWrapper::start()
       
   100 {
       
   101     mImpl->mPropertyAnimation->start();
       
   102 }
       
   103 /*!
       
   104 
       
   105 */
       
   106 void HsPropertyAnimationWrapper::stop()
       
   107 {
       
   108     mImpl->mPropertyAnimation->stop();
       
   109 }
       
   110 
       
   111 /*!
       
   112 
       
   113 */
       
   114 void HsPropertyAnimationWrapper::setEasingCurve(const QEasingCurve &curve)
       
   115 {
       
   116     mImpl->mPropertyAnimation->setEasingCurve(curve);
       
   117 }
       
   118