homescreenapp/hsutils/src/hspropertyanimationwrapper.cpp
changeset 63 52b0f64eeb51
child 69 87476091b3f5
equal deleted inserted replaced
62:341166945d65 63:52b0f64eeb51
       
     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 "hspropertyanimationwrapper.h"
       
    20 
       
    21 /*!
       
    22     \class HsMessageBoxWrapper
       
    23     \ingroup group_hsutils
       
    24     \brief 
       
    25 */
       
    26 
       
    27 struct HsPropertyAnimationWrapperImpl
       
    28 {
       
    29 public:
       
    30     QPropertyAnimation *mPropertyAnimation;
       
    31 };
       
    32 
       
    33 /*!
       
    34 
       
    35 */
       
    36 HsPropertyAnimationWrapper::HsPropertyAnimationWrapper(QObject *parent)
       
    37   : QObject(parent),mImpl(new HsPropertyAnimationWrapperImpl)
       
    38 {
       
    39     mImpl->mPropertyAnimation = new QPropertyAnimation(parent);
       
    40     connect(mImpl->mPropertyAnimation,SIGNAL(finished()),SIGNAL(finished()));
       
    41 }
       
    42 
       
    43 /*!
       
    44 
       
    45 */
       
    46 HsPropertyAnimationWrapper::~HsPropertyAnimationWrapper()
       
    47 {
       
    48 
       
    49 }
       
    50 
       
    51 /*!
       
    52 
       
    53 */
       
    54 void HsPropertyAnimationWrapper::setTargetObject(QObject *target)
       
    55 {
       
    56    mImpl->mPropertyAnimation->setTargetObject(target);
       
    57 }
       
    58 /*!
       
    59 
       
    60 */
       
    61 void HsPropertyAnimationWrapper::setPropertyName(const QByteArray &propertyName)
       
    62 {
       
    63    mImpl->mPropertyAnimation->setPropertyName(propertyName);
       
    64 }
       
    65 
       
    66 bool HsPropertyAnimationWrapper::isRunning()
       
    67 {
       
    68     return (mImpl->mPropertyAnimation->state() == QAbstractAnimation::Running);
       
    69 }
       
    70 void HsPropertyAnimationWrapper::setEndValue(const QVariant &value)
       
    71 {
       
    72     mImpl->mPropertyAnimation->setEndValue(value);
       
    73 }
       
    74 void HsPropertyAnimationWrapper::setDuration(int msecs)
       
    75 {
       
    76     mImpl->mPropertyAnimation->setDuration(msecs);
       
    77 }
       
    78 /*!
       
    79 
       
    80 */
       
    81 void HsPropertyAnimationWrapper::start()
       
    82 {
       
    83     mImpl->mPropertyAnimation->start();
       
    84 }
       
    85 /*!
       
    86 
       
    87 */
       
    88 void HsPropertyAnimationWrapper::stop()
       
    89 {
       
    90     mImpl->mPropertyAnimation->stop();
       
    91 }