|
1 /* |
|
2 * Copyright (c) 2009 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: Taskswitcher physic engine |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TSPHYSICSENGINE_H_ |
|
20 #define TSPHYSICSENGINE_H_ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <akntouchgesturefw.h> |
|
24 // CLASS DECLARATION |
|
25 class CAknPhysics; |
|
26 class CTsPhysics; |
|
27 /** |
|
28 * Taskswitcher physic engine implementation |
|
29 */ |
|
30 class CTsPhysicsEngine: public CBase |
|
31 { |
|
32 public: |
|
33 // Constructors and destructor |
|
34 |
|
35 /** |
|
36 * Destructor. |
|
37 */ |
|
38 ~CTsPhysicsEngine(); |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 */ |
|
43 static CTsPhysicsEngine* NewL(MAknPhysicsObserver& aPhysicObserver, |
|
44 CCoeControl& aViewControl); |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 */ |
|
49 static CTsPhysicsEngine* NewLC(MAknPhysicsObserver& aPhysicObserver, |
|
50 CCoeControl& aViewControl); |
|
51 |
|
52 private: |
|
53 |
|
54 /** |
|
55 * Constructor for performing 1st stage construction |
|
56 */ |
|
57 CTsPhysicsEngine(); |
|
58 |
|
59 /** |
|
60 * EPOC default constructor for performing 2nd stage construction |
|
61 */ |
|
62 void ConstructL(MAknPhysicsObserver& aPhysicObserver, |
|
63 CCoeControl& aViewControl); |
|
64 |
|
65 |
|
66 public: |
|
67 /** |
|
68 * Implements drag gesture handling |
|
69 * @param aEvent - drag event |
|
70 */ |
|
71 void HandleDragEvent(AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent); |
|
72 |
|
73 /** |
|
74 */ |
|
75 TBool IsRunning() const; |
|
76 |
|
77 /** |
|
78 */ |
|
79 void Stop(); |
|
80 |
|
81 /** |
|
82 * Initialize animation between current position and destination point |
|
83 * @param aPoint - destination point |
|
84 */ |
|
85 void AnimateToTarget(const TPoint& aPoint); |
|
86 |
|
87 /** |
|
88 * |
|
89 * @param aWorldSize Physics world size. |
|
90 * @param aViewSize Physics (visible) view size. |
|
91 * @param aLandscape ETrue if physics should work in landscape. |
|
92 **/ |
|
93 void ReInitPhysicsL(const TSize& aWorldSize, |
|
94 const TSize& aViewSize, |
|
95 TBool aLandscape); |
|
96 |
|
97 private: |
|
98 /** |
|
99 * Physics. |
|
100 * Own. |
|
101 */ |
|
102 CAknPhysics* iPhysics; |
|
103 |
|
104 /** |
|
105 * Drag start time |
|
106 */ |
|
107 TTime iStartTime; |
|
108 |
|
109 /** |
|
110 * Taskswitcher physics for item switch animation |
|
111 */ |
|
112 CTsPhysics* iTaskswitcherPhysics; |
|
113 |
|
114 }; |
|
115 |
|
116 #endif /* TSPHYSICSENGINE_H_*/ |