|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Active Object header for CoverFlow |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __MULCOVERFLOWAO_H__ |
|
19 #define __MULCOVERFLOWAO_H__ |
|
20 |
|
21 #include <e32base.h> // For CTimer |
|
22 |
|
23 namespace Alf |
|
24 { |
|
25 //Forward declarations |
|
26 class MulCoverFlowControl; |
|
27 |
|
28 class MulCoverFlowAo:public CTimer |
|
29 { |
|
30 |
|
31 public : // Constructor and Destructor |
|
32 /// @bug critical:avanhata:7/7/2008 this is a symbian-dependent class, |
|
33 /// need to have two-phase construction |
|
34 /// - otherwise mixing leaves and throws |
|
35 MulCoverFlowAo( MulCoverFlowControl& aControl ); |
|
36 |
|
37 ~MulCoverFlowAo(); |
|
38 |
|
39 public: //new method |
|
40 |
|
41 /** |
|
42 * Keeps moving layout asynchronously until it stopmoving() is called . |
|
43 * The layout will move on to show more items . |
|
44 * |
|
45 * @param aSpeedPoint Gesture speed point. |
|
46 * @param, aCurrGestureDirection, Current direction of gesture |
|
47 * @param, aFastScrollForKey , if fast scroll due to key event |
|
48 * @param, aAnimationTime , animation time for fast scroll in key event. |
|
49 */ |
|
50 void StartMoving(TReal32 aSpeedPoint, int aCurrGestureDirection,bool aFastScrollForKey = false,int aAnimationTime = 0); |
|
51 |
|
52 /** |
|
53 * Stop moving the layout. |
|
54 * |
|
55 */ |
|
56 void StopMoving(); |
|
57 |
|
58 /** |
|
59 * Transition time for highlight change in fast scroll |
|
60 * |
|
61 * @return, transition time to be used |
|
62 */ |
|
63 int FastScrollTransitionTime(); |
|
64 |
|
65 private: |
|
66 |
|
67 /** |
|
68 * Timer call back funtion . Performs animations and moves the layout |
|
69 * for a particular distance depending on the length of the swipe |
|
70 * in a particular time period depending on the speed . |
|
71 */ |
|
72 void RunL(); |
|
73 |
|
74 private : //new methods |
|
75 |
|
76 /** |
|
77 * Cancel all pending requests. |
|
78 */ |
|
79 void StopTimer(); |
|
80 |
|
81 /** |
|
82 * Increment the highlight with +-1 depending on the swipe direction and informs the |
|
83 * control class to cahnge teh highlight. |
|
84 */ |
|
85 void ChangeHighLight(); |
|
86 |
|
87 private: //data |
|
88 |
|
89 MulCoverFlowControl& mControl; //doesnt own |
|
90 int mTransitionTime; |
|
91 int mWaitingTime; |
|
92 int mCurrGestureDirection; |
|
93 bool mStarted; |
|
94 }; //end of class. |
|
95 |
|
96 } // End of namespace . |
|
97 |
|
98 #endif //__MULCOVERFLOWAO_H__ |
|
99 |
|
100 // End of file |