00001 #ifndef __CAutoAnimation__
00002 #define __CAutoAnimation__
00003
00004 #include "CAnimation.hpp"
00005 #include "../Basics/ITimedObject.hpp"
00006
00007
00008
00009 using Exponent::GUI::Controls::CAnimation;
00010 using Exponent::GUI::Basics::ITimedObject;
00011
00012
00013
00014 namespace Exponent
00015 {
00016 namespace GUI
00017 {
00018 namespace Controls
00019 {
00037 class CAutoAnimation : public CAnimation, public ITimedObject
00038 {
00040 EXPONENT_CLASS_DECLARATION;
00043
00044
00045 public:
00046
00047
00048
00053 enum EAnimationStyle
00054 {
00055 e_forward = 0,
00056 e_backward,
00057 e_bounce,
00058 e_forwardLoop,
00059 e_backwardLoop,
00060 };
00061
00062
00063
00070 CAutoAnimation(IControlRoot *root, const long uniqueId, const CRect &area);
00071
00075 virtual ~CAutoAnimation();
00076
00077
00078
00085 virtual void setAnimationImage(IImage *theImage, const long heightOfEachFrame, const long numberOfFrames);
00086
00091 virtual void setAnimationStyle(const EAnimationStyle style);
00092
00093
00094
00098 virtual void timerExpired();
00099
00104 virtual long getTimerId() const { return m_uniqueId; }
00105
00106
00107
00112 virtual void startAnimation(const long updateRateInMillseconds);
00113
00117 virtual void stopAnimation();
00118
00119
00120
00121 protected:
00122
00123
00124
00125 double m_stepIncrement;
00126 EAnimationStyle m_animationStyle;
00127 bool m_forward;
00128 };
00129 }
00130 }
00131 }
00132 #endif // End of CAutoAnimation.hpp