Update contrib.
1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "W32STDGRAPHIC.H"
18 // TWsGraphicAnimation \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
20 EXPORT_C TWsGraphicAnimation::TWsGraphicAnimation():
21 TWsGraphicMsgFixedBase(TUid::Uid(ETypeId),sizeof(*this)),
26 EXPORT_C TBool TWsGraphicAnimation::IsPlaying() const
28 return (State() == EPlaying);
31 EXPORT_C TBool TWsGraphicAnimation::IsStopped() const
33 return (State() == EStopped);
36 EXPORT_C TBool TWsGraphicAnimation::IsStopping() const
38 return (State() == EStopping);
41 EXPORT_C TBool TWsGraphicAnimation::IsPaused() const
43 return (State() == EPaused);
46 EXPORT_C TBool TWsGraphicAnimation::Loops() const
52 return ((iFlags & ELoop) == ELoop);
58 TUint TWsGraphicAnimation::State() const
60 return (iFlags & EStateMask);
63 void TWsGraphicAnimation::SetState(TUint aState)
65 iFlags &= ~EStateMask;
66 iFlags |= (aState & EStateMask);
69 EXPORT_C void TWsGraphicAnimation::Play(TBool aLoop)
78 iPlay.UniversalTime(); //Start over again
82 if(aLoop != Loops()) // can't resume a mismatch of looping attribute
84 iPlay.UniversalTime();
88 TTimeIntervalMicroSeconds delta = iPauseOrStopping.MicroSecondsFrom(iPlay);
89 iPlay.UniversalTime();
90 iPlay = iPlay.Int64() - delta.Int64();
104 EXPORT_C void TWsGraphicAnimation::Pause()
111 iPauseOrStopping.UniversalTime();
119 EXPORT_C void TWsGraphicAnimation::Stop(TBool aImmediately)
131 iPauseOrStopping.UniversalTime();
136 iPauseOrStopping.UniversalTime();
140 TTimeIntervalMicroSeconds delta = iPauseOrStopping.MicroSecondsFrom(iPlay);
141 iPlay.UniversalTime();
142 iPlay = iPlay.Int64() - delta.Int64();
143 iPauseOrStopping.UniversalTime();