48 virtual void BitmapChanged(CSmileyImage* aSmileyImage, CFbsBitmap* aBitmap)=0; |
48 virtual void BitmapChanged(CSmileyImage* aSmileyImage, CFbsBitmap* aBitmap)=0; |
49 }; |
49 }; |
50 |
50 |
51 //////////////////////////////////////////////////////////////////// |
51 //////////////////////////////////////////////////////////////////// |
52 |
52 |
|
53 // CSmileyImage can be a still or animated svg image |
|
54 |
53 class CSmileyImage : public CBase, public MAknIconObserver |
55 class CSmileyImage : public CBase, public MAknIconObserver |
54 { |
56 { |
55 public: |
57 public: |
56 static CSmileyImage* NewL(const TAknsItemID& aSkinImage, TInt aPkgImage, TBool aIsAnimation, MSmileyImageObserver* aObserver); |
58 static CSmileyImage* NewL(const TAknsItemID& aSkinImage, TInt aPkgImage, TBool aIsAnimation, MSmileyImageObserver* aObserver); |
57 virtual ~CSmileyImage(); |
59 virtual ~CSmileyImage(); |
69 public: |
71 public: |
70 TBool ReadyToDraw() const; |
72 TBool ReadyToDraw() const; |
71 const CFbsBitmap* Image() const; |
73 const CFbsBitmap* Image() const; |
72 const CFbsBitmap* Mask() const; |
74 const CFbsBitmap* Mask() const; |
73 |
75 |
74 private: // from MAknIconObserver |
76 private: |
75 void BitmapChanged(CFbsBitmap* aBitmap); |
77 void BitmapChanged(CFbsBitmap* aBitmap); // from MAknIconObserver |
|
78 void MonitorAnimationEndedL(); |
76 |
79 |
77 private: |
80 private: |
78 void DoLoadL(); |
81 void DoLoadL(); |
79 void DoRelease(); |
82 void DoRelease(); |
80 void StopAnyAsynchronousTask(); |
83 void DoHandleEndedL(); |
81 |
|
82 void MonitorAnimationEndedL(); |
|
83 void HandleAnimationEndedL(); |
|
84 |
84 |
85 private: |
85 private: |
86 void StartLoadAsynchronousL(TInt aRepeat, TInt aDelayMicroSeconds=0); |
86 inline void StopAsynchronousTaskTimer(); |
|
87 |
|
88 void StartLoadAsynchronousL(TInt aDelayMicroSeconds=0); |
87 static TInt StartLoadAsynchronousCallBackL(TAny* aPtr); |
89 static TInt StartLoadAsynchronousCallBackL(TAny* aPtr); |
88 |
90 |
89 private: |
|
90 void StopAnimationAsynchronousL(TInt aDelayMicroSeconds=0); |
91 void StopAnimationAsynchronousL(TInt aDelayMicroSeconds=0); |
91 static TInt StopAnimationAsynchronousCallBackL(TAny* aPtr); |
92 static TInt StopAnimationAsynchronousCallBackL(TAny* aPtr); |
92 |
93 |
93 private: |
94 private: |
94 TAknsItemID iImageSkinItem; |
95 TAknsItemID iImageSkinItemId; |
95 TInt iImagePkgItem; |
96 const TInt iImageMifPkgItemId; |
96 const TBool iIsAnimation; |
97 const TBool iIsAnimation; |
97 TSize iSize; |
98 |
|
99 private: |
98 MSmileyImageObserver* iImageObserver; |
100 MSmileyImageObserver* iImageObserver; |
99 CPeriodic* iAsynchronousTaskTimer; |
101 CPeriodic* iAsynchronousTaskTimer; |
100 |
102 |
101 private: |
103 private: |
|
104 TSize iSize; |
102 CFbsBitmap* iFrame; |
105 CFbsBitmap* iFrame; |
103 CFbsBitmap* iFrameMask; |
106 CFbsBitmap* iFrameMask; |
104 |
107 TBool iReadyToDraw; |
105 private: |
108 |
|
109 private: // for animation |
|
110 TInt iRepeatCount; |
106 CFbsBitmap* iFrameSnap; |
111 CFbsBitmap* iFrameSnap; |
107 TInt iFrameCounter; |
112 TInt iFrameCounter; |
108 TInt iSameFrameCounter; |
113 TInt iSameFrameCounter; |
109 |
|
110 private: |
|
111 TBool iReadyToDraw; |
|
112 TInt iRepeatCount; |
|
113 |
114 |
114 }; |
115 }; |
115 |
116 |
116 |
117 |
117 #endif // AKNSMILEYSVGRES_H |
118 #endif // AKNSMILEYSVGRES_H |