20 #ifndef C_MMDRAWERANIMATOR_H |
20 #ifndef C_MMDRAWERANIMATOR_H |
21 #define C_MMDRAWERANIMATOR_H |
21 #define C_MMDRAWERANIMATOR_H |
22 |
22 |
23 #include <e32base.h> |
23 #include <e32base.h> |
24 #include <e32std.h> |
24 #include <e32std.h> |
|
25 |
25 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
26 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
26 #include <aknlistloadertfx.h> |
27 #include <aknlistloadertfx.h> |
27 #include <aknlistboxtfxinternal.h> |
28 #include <aknlistboxtfxinternal.h> |
28 #include <aknlistboxtfx.h> |
29 #include <aknlistboxtfx.h> |
29 #endif |
30 #endif |
30 class CMmListBoxItemDrawer; |
31 class CMmListBoxItemDrawer; |
31 class TMmFloatingItem; |
32 class TMmFloatingItem; |
32 |
33 |
33 /** |
34 /** |
34 * Zoom ratio when no zooming is performed. |
35 * Zoom ratio when no zooming is performed. |
54 * @see CListBoxItemDrawer |
55 * @see CListBoxItemDrawer |
55 * @ingroup group_mmwidgets |
56 * @ingroup group_mmwidgets |
56 */ |
57 */ |
57 NONSHARABLE_CLASS( CMmDrawerAnimator ) : public CActive |
58 NONSHARABLE_CLASS( CMmDrawerAnimator ) : public CActive |
58 { |
59 { |
59 |
60 |
60 public: |
61 public: |
61 /** |
62 /** |
62 * Two-phased constructor. |
63 * Two-phased constructor. |
63 * |
64 * |
64 * @since S60 v5.0 |
65 * @since S60 v5.0 |
65 * @param aDrawer Item drawer used to draw item. |
66 * @param aDrawer Item drawer used to draw item. |
66 */ |
67 */ |
67 static CMmDrawerAnimator* NewL( CMmListBoxItemDrawer& aDrawer ); |
68 static CMmDrawerAnimator* NewL( CMmListBoxItemDrawer& aDrawer ); |
68 |
69 |
69 /** |
70 /** |
70 * Two-phased constructor. |
71 * Two-phased constructor. |
71 * |
72 * |
72 * @since S60 v5.0 |
73 * @since S60 v5.0 |
73 * @param aDrawer Item drawer used to draw item. |
74 * @param aDrawer Item drawer used to draw item. |
74 */ |
75 */ |
75 static CMmDrawerAnimator* NewLC( CMmListBoxItemDrawer& aDrawer ); |
76 static CMmDrawerAnimator* NewLC( CMmListBoxItemDrawer& aDrawer ); |
76 |
77 |
77 /** |
78 /** |
78 * Destructor. |
79 * Destructor. |
79 * |
80 * |
80 * @since S60 v5.0 |
81 * @since S60 v5.0 |
81 */ |
82 */ |
82 virtual ~CMmDrawerAnimator(); |
83 virtual ~CMmDrawerAnimator(); |
83 |
84 |
84 /** |
85 /** |
88 * or destination place, if reorder occured. |
89 * or destination place, if reorder occured. |
89 * |
90 * |
90 * @since S60 v5.0 |
91 * @since S60 v5.0 |
91 */ |
92 */ |
92 void AnimateDragItemTransitionL( ); |
93 void AnimateDragItemTransitionL( ); |
93 |
94 |
94 /** |
95 /** |
95 * Animates an item with index aItemFrom into position |
96 * Animates an item with index aItemFrom into position |
96 * indexed by aItemTo. |
97 * indexed by aItemTo. |
97 * |
98 * |
98 * @since S60 v5.0 |
99 * @since S60 v5.0 |
99 * @param aItemFrom Which item should be animated. |
100 * @param aItemFrom Which item should be animated. |
100 * @param aItemTo Where to should the item be animated. |
101 * @param aItemTo Where to should the item be animated. |
115 * |
116 * |
116 * @since S60 v5.0 |
117 * @since S60 v5.0 |
117 * @return Is system ready so new animation can proceed. |
118 * @return Is system ready so new animation can proceed. |
118 */ |
119 */ |
119 TBool IsReadyForNewAnimation(); |
120 TBool IsReadyForNewAnimation(); |
120 |
121 |
121 /** |
122 /** |
122 * Cancel currently running or pending animations. |
123 * Cancel currently running or pending animations. |
123 * |
124 * |
124 * @since S60 v5.0 |
125 * @since S60 v5.0 |
125 */ |
126 */ |
126 void CancelAnimationsL(); |
127 void CancelAnimationsL(); |
127 |
128 |
128 /** |
129 /** |
129 * Triggers animation. |
130 * Triggers animation. |
130 * This methods sets the Activeobject into active state |
131 * This methods sets the Activeobject into active state |
131 * if floating items are available |
132 * if floating items are available |
132 * |
133 * |
133 * @since S60 v5.0 |
134 * @since S60 v5.0 |
134 * @return Error code |
135 * @return Error code |
135 */ |
136 */ |
136 TInt Trigger(); |
137 TInt Trigger(); |
137 |
138 |
138 /** |
|
139 * Marks next redraw to be cancelled. |
|
140 * |
|
141 * @return Indicates if redraw occured due to cancel. |
|
142 */ |
|
143 TBool CancelNextRedrawL(); |
|
144 |
|
145 /** |
139 /** |
146 * Make the next animation redraw the whole screen; |
140 * Make the next animation redraw the whole screen; |
147 */ |
141 */ |
148 void SetNextRedrawToWholeScreen(); |
142 void SetNextRedrawToWholeScreen(); |
149 |
143 |
150 /** |
144 /** |
151 * Indicates that draweranimator is in garbage. |
145 * Indicates that draweranimator is in garbage. |
152 * This is used when suite model has been destroyed so there isn't |
146 * This is used when suite model has been destroyed so there isn't |
153 * anything to draw, therefore any animator attempts should be |
147 * anything to draw, therefore any animator attempts should be |
154 * dropped. |
148 * dropped. |
155 */ |
149 */ |
156 void PrepareForGarbage(); |
150 void PrepareForGarbage(); |
157 |
151 |
|
152 /** |
|
153 * Calls move event. |
|
154 */ |
|
155 void TriggerMoveItemL(); |
|
156 |
158 private: |
157 private: |
159 |
158 |
160 /** |
159 /** |
161 * Default constructor. |
160 * Default constructor. |
162 * |
161 * |
163 * @since S60 v3.0 |
162 * @since S60 v3.0 |
164 * @param aDrawer Object used to draw items in widgets. |
163 * @param aDrawer Object used to draw items in widgets. |
165 */ |
164 */ |
166 CMmDrawerAnimator( CMmListBoxItemDrawer& aDrawer ); |
165 CMmDrawerAnimator( CMmListBoxItemDrawer& aDrawer ); |
167 |
166 |
168 /** |
167 /** |
169 * 2nd phase constructor. |
168 * 2nd phase constructor. |
170 * |
169 * |
171 * @since S60 v3.0 |
170 * @since S60 v3.0 |
172 */ |
171 */ |
173 void ConstructL(); |
172 void ConstructL(); |
174 |
173 |
175 private: // From CActive |
174 private: // From CActive |
176 |
175 |
194 * @since S60 v3.0 |
193 * @since S60 v3.0 |
195 * @param aError Error code which occurred. |
194 * @param aError Error code which occurred. |
196 * @return Error code for error handling. |
195 * @return Error code for error handling. |
197 */ |
196 */ |
198 TInt RunError( TInt aError ); |
197 TInt RunError( TInt aError ); |
199 |
198 |
200 /** |
199 /** |
201 * Adjusts rect to non touch. |
200 * Adjusts rect to non touch. |
202 * |
201 * |
203 * @since S60 v3.0 |
202 * @since S60 v3.0 |
204 * @param aRefreshRect Refresh rect. |
203 * @param aRefreshRect Refresh rect. |
205 * @return Adjusted rect. |
204 * @return Adjusted rect. |
206 */ |
205 */ |
207 TRect AdjustRefreshRectToNonTouch( const TRect& aRefreshRect ); |
206 TRect AdjustRefreshRectToNonTouch( const TRect& aRefreshRect ); |
208 |
207 |
209 private: // Data |
208 private: // Data |
210 |
209 |
211 /** |
210 /** |
212 * Timer |
211 * Timer |
213 */ |
212 */ |
214 RTimer iTimer; |
213 RTimer iTimer; |
215 |
214 |
216 /** |
215 /** |
217 * Associated item drawer. |
216 * Associated item drawer. |
218 */ |
217 */ |
219 CMmListBoxItemDrawer& iDrawer; |
218 CMmListBoxItemDrawer& iDrawer; |
220 |
219 |
221 /** |
220 /** |
222 * Number of animation frames |
221 * Number of animation frames |
223 */ |
222 */ |
224 TInt iAnimateFrames; |
223 TInt iAnimateFrames; |
225 |
224 |
226 /** |
225 /** |
227 * Delay between redrawing. |
226 * Delay between redrawing. |
228 */ |
227 */ |
229 TTimeIntervalMicroSeconds iDelay; |
228 TTimeIntervalMicroSeconds iDelay; |
230 |
229 |
231 /** |
230 /** |
232 * Last redraw time |
231 * Last redraw time |
233 */ |
232 */ |
234 TTime iLastRedrawTime; |
233 TTime iLastRedrawTime; |
235 |
234 |
236 /** |
235 /** |
237 * Effects api. |
236 * Effects api. |
238 */ |
237 */ |
239 MAknListBoxTfx *iTransTfx; |
238 MAknListBoxTfx *iTransTfx; |
240 |
239 |
241 /** |
240 /** |
242 * Effects api. |
241 * Effects api. |
243 */ |
242 */ |
244 MAknListBoxTfxInternal *iTransTfxInternal; |
243 MAknListBoxTfxInternal *iTransTfxInternal; |
245 |
244 |
246 /** |
245 /** |
247 * Highlight noted when last redraw occured. |
246 * Highlight noted when last redraw occured. |
248 */ |
247 */ |
249 TInt iLastNotedHighlight; |
248 TInt iLastNotedHighlight; |
250 |
249 |
251 /** |
250 /** |
252 * Top item index noted when last redraw occured. |
251 * Top item index noted when last redraw occured. |
253 */ |
252 */ |
254 TInt iLastNotedTopItem; |
253 TInt iLastNotedTopItem; |
255 |
254 |
256 /** |
255 /** |
257 * Vertical offset noted when last redraw occured. |
256 * Vertical offset noted when last redraw occured. |
258 */ |
257 */ |
259 TInt iLastNotedVerticalOffset; |
258 TInt iLastNotedVerticalOffset; |
260 |
259 |
261 /** |
260 /** |
262 * Holds the previous animation refresh rectangle. |
261 * Holds the previous animation refresh rectangle. |
263 */ |
262 */ |
264 TRect iPreviousRefreshRect; |
263 TRect iPreviousRefreshRect; |
265 |
264 |
266 /** |
265 /** |
267 * Holds the number of frames to animate. |
266 * Holds the number of frames to animate. |
268 */ |
267 */ |
269 const TInt iUsualAnimationFramesCount; |
268 const TInt iUsualAnimationFramesCount; |
270 |
269 |
271 /** |
270 /** |
272 * Holds the previous animation refresh rectangle. |
271 * Holds the previous animation refresh rectangle. |
273 */ |
272 */ |
274 TBool iPreparedForGarbage; |
273 TBool iPreparedForGarbage; |
275 }; |
274 }; |