24 #include <e32base.h> |
24 #include <e32base.h> |
25 |
25 |
26 // User includes |
26 // User includes |
27 |
27 |
28 // Forward declarations |
28 // Forward declarations |
|
29 class CAlfEffectObserver; |
|
30 class CXnAppUiAdapter; |
29 class CXnPluginData; |
31 class CXnPluginData; |
30 class CXnViewData; |
32 class CXnViewData; |
31 class CXnNode; |
33 class CXnNode; |
32 |
34 |
33 // Constants |
35 // Constants |
34 |
36 |
35 // Control effect context ids |
37 // Control effect context ids |
36 #define KGfxContextAddWidget TUid::Uid( 0x102750F4 ) |
38 #define KGfxContextAddWidget TUid::Uid( 0x102750F4 ) |
37 #define KGfxContextRemoveWidget TUid::Uid( 0x102750F4 ) |
39 #define KGfxContextRemoveWidget TUid::Uid( 0x102750F4 ) |
38 #define KGfxContextActivateNextView TUid::Uid( 0x102750F1 ) |
40 #define KGfxContextActivateNextView TUid::Uid( 0x102750F1 ) |
39 #define KGfxContextActivatePrevView TUid::Uid( 0x102750F2 ) |
41 #define KGfxContextActivatePrevView TUid::Uid( 0x102750F2 ) |
40 #define KGfxContextBgAppear TUid::Uid( 0x102750F3 ) |
42 #define KGfxContextBgAppear TUid::Uid( 0x102750F3 ) |
41 |
43 |
42 // Control effect action ids |
44 // Control effect action ids |
43 #define KGfxControlActionAppear 3 |
45 #define KGfxControlActionAppear 3 |
44 #define KGfxControlActionDisappear 4 |
46 #define KGfxControlActionDisappear 4 |
45 |
47 |
46 #define KGfxControlActionAppearPrt 3 |
48 #define KGfxControlActionAppearPrt 3 |
47 #define KGfxControlActionDisappearPrt 5 |
49 #define KGfxControlActionDisappearPrt 5 |
48 #define KGfxControlActionAppearLsc 6 |
50 #define KGfxControlActionAppearLsc 6 |
49 #define KGfxControlActionDisappearLsc 7 |
51 #define KGfxControlActionDisappearLsc 7 |
50 |
52 |
51 #define KGfxControlActionBgImgToImgAppear 3 |
53 #define KGfxControlActionBgImgToImgAppear 3 |
52 #define KGfxControlActionBgAnimToImgAppear 5 |
54 #define KGfxControlActionBgAnimToImgAppear 5 |
53 |
55 |
54 // Full screen effect ids |
56 // Full screen effect ids |
55 #define KGfxContextOpenWallpaperView 1007 |
57 #define KGfxContextOpenWallpaperView 1007 |
56 #define KGfxContextCloseWallpaperView 1008 |
58 #define KGfxContextCloseWallpaperView 1008 |
57 |
59 |
58 // Class declaration |
60 // Class declaration |
59 /** |
61 /** |
60 * Struct which holds needed info of effect. |
62 * Struct which holds needed info of effect. |
61 */ |
63 */ |
62 NONSHARABLE_STRUCT( TXnEffect ) |
64 NONSHARABLE_STRUCT( TXnEffect ) |
63 { |
65 { |
|
66 TXnEffect() |
|
67 : iNode( NULL ), iState( 0 ), iId( 0 ), iExplicitEnd( EFalse ) |
|
68 { |
|
69 } |
|
70 |
64 CXnNode* iNode; |
71 CXnNode* iNode; |
|
72 TBool iExplicitEnd; |
65 TInt iState; |
73 TInt iState; |
66 TInt iId; |
74 TInt iId; |
67 }; |
75 }; |
68 |
76 |
69 /** |
77 /** |
70 * Effect manager. |
78 * Effect manager. |
71 * Handles starting and ending effects. |
79 * Handles starting and ending effects. |
72 * |
80 * |
73 * @since S60 v5.0 |
81 * @since S60 v5.0 |
74 */ |
82 */ |
75 NONSHARABLE_CLASS( CXnEffectManager ) : public CBase |
83 NONSHARABLE_CLASS( CXnEffectManager ) : public CTimer |
76 { |
84 { |
77 public: |
85 public: |
78 // constructor and destructor |
86 // constructor and destructor |
79 |
87 |
80 /** |
88 /** |
81 * Two-phased constructor. |
89 * Two-phased constructor. |
82 * @return new instance of CXnEffectManager. |
90 * @return new instance of CXnEffectManager. |
83 */ |
91 */ |
84 static CXnEffectManager* NewL(); |
92 static CXnEffectManager* NewL( CXnAppUiAdapter& aAppUiAdapter ); |
85 |
93 |
86 /** |
94 /** |
87 * Destructor. |
95 * Destructor. |
88 */ |
96 */ |
89 ~CXnEffectManager(); |
97 ~CXnEffectManager(); |
90 |
98 |
|
99 private: |
|
100 // from CTimer |
|
101 |
|
102 /** |
|
103 * @see CTimer |
|
104 */ |
|
105 void RunL(); |
|
106 |
91 public: |
107 public: |
92 // new functions |
108 // new functions |
93 |
109 |
94 /** |
110 /** |
95 * Begin handling of fullscreen effect. |
111 * Begin handling of fullscreen effect. |
97 * @since S60 5.2 |
113 * @since S60 5.2 |
98 * @param aId effect id |
114 * @param aId effect id |
99 * @aView view data |
115 * @aView view data |
100 */ |
116 */ |
101 void BeginFullscreenEffectL( TInt aId, CXnViewData& aView ); |
117 void BeginFullscreenEffectL( TInt aId, CXnViewData& aView ); |
|
118 |
|
119 /** |
|
120 * Begin handling of fullscreen effect. |
|
121 * |
|
122 * @since S60 5.2 |
|
123 * @param aId effect id |
|
124 */ |
|
125 void BeginFullscreenEffectL( TInt aId ); |
|
126 |
|
127 /** |
|
128 * Ends fullscreen effect. |
|
129 * |
|
130 * @since S60 5.2 |
|
131 * @param aId effect id |
|
132 */ |
|
133 void EndFullscreenEffect( TInt aId ); |
|
134 |
|
135 /** |
|
136 * Begin view change effect |
|
137 * |
|
138 * @since S60 5.2 |
|
139 * @param aThis Active view |
|
140 * @param aOther View to activate |
|
141 * @param aEffect Effect uid |
|
142 * @return ETrue of effect is started, EFalse otherwise |
|
143 */ |
|
144 TBool BeginActivateViewEffect( const CXnViewData& aThis, |
|
145 const CXnViewData& aOther, TUid aEffect ); |
|
146 |
|
147 /** |
|
148 * End view change effect |
|
149 * |
|
150 * @since S60 5.2 |
|
151 * @param aThis Active view |
|
152 * @param aOther View to activate |
|
153 * @param aEffect Effect uid |
|
154 */ |
|
155 void EndActivateViewEffect( const CXnViewData& aThis, |
|
156 const CXnViewData& aOther, TUid aEffect ); |
|
157 |
|
158 /** |
|
159 * Begins background appear effect |
|
160 * |
|
161 * @since S60 5.2 |
|
162 * @param aBg Background control |
|
163 * @param aWaitActiveEffect ETrue if active effect is checked, EFalse otherwise |
|
164 */ |
|
165 void BgAppearEffect( CCoeControl* aBg, TBool aWaitActiveEffect = EFalse ); |
102 |
166 |
103 /** |
167 /** |
104 * When UiRendered is called effect is ended and will be drawn |
168 * When UiRendered is called effect is ended and will be drawn |
105 * |
169 * |
106 * @since S60 5.2 |
170 * @since S60 5.2 |
125 * @return ETrue if effect started, otherwise EFalse |
212 * @return ETrue if effect started, otherwise EFalse |
126 */ |
213 */ |
127 TBool DoBeginFullscreenEffect( TXnEffect& aEffect ); |
214 TBool DoBeginFullscreenEffect( TXnEffect& aEffect ); |
128 |
215 |
129 /** |
216 /** |
130 * Removes and destroys effect from effect list. |
217 * Waits active effects to complete |
131 * |
218 * |
132 * @since S60 5.2 |
219 * @since S60 5.2 |
133 * @param aEffect effect data |
220 * @param aInterval Interval in micro seconds to wait active effects to complete |
134 */ |
221 * @return ETrue if no active effects ongoing when function returns, EFalse otherwise |
135 void RemoveEffect( TXnEffect* aEffect ); |
222 */ |
|
223 TBool WaitActiveEffect( TInt aInterval ); |
136 |
224 |
137 private: |
225 private: |
138 // constructors |
226 // constructors |
139 |
227 |
140 /** |
228 /** |
141 * C++ default constructor |
229 * C++ default constructor |
142 */ |
230 */ |
143 CXnEffectManager(); |
231 CXnEffectManager( CXnAppUiAdapter& aAppUiAdapter ); |
144 |
232 |
145 /** |
233 /** |
146 * 2nd phase constructor |
234 * 2nd phase constructor |
147 */ |
235 */ |
148 void ConstructL(); |
236 void ConstructL(); |
149 |
237 |
150 private: |
238 private: |
151 // data |
239 // data |
152 |
240 |
|
241 /** Effect observer, owned */ |
|
242 CAlfEffectObserver* iObserver; |
|
243 /** AppUi, not owned */ |
|
244 CXnAppUiAdapter& iAppUiAdapter; |
153 /** List of started effects, owned */ |
245 /** List of started effects, owned */ |
154 RPointerArray<TXnEffect> iEffects; |
246 RArray< TXnEffect > iEffects; |
|
247 /** List of controls in current effect, not owned */ |
|
248 RPointerArray< CCoeControl > iControls; |
|
249 /** Effect group id */ |
|
250 TInt iGroupId; |
|
251 /** Flag to indicate whether background effect is started */ |
|
252 TBool iBgEffect; |
|
253 /** Orientation */ |
|
254 TBool iLandscape; |
155 }; |
255 }; |
156 |
256 |
157 #endif // CXNEFFECTMANAGER_H |
257 #endif // CXNEFFECTMANAGER_H |
158 |
258 |
159 // End of File |
259 // End of File |