|
1 /* |
|
2 * Copyright (c) 2006 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: Adapter to the GfxTransEffect client. This is the entry point into |
|
15 * the Nokia specific parts of the KML transition sollution, from the |
|
16 * GfxTransEffect client. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef _GFXTRANSENGINESTUB_H_ |
|
23 #define _GFXTRANSENGINESTUB_H_ |
|
24 |
|
25 #include <e32base.h> |
|
26 |
|
27 #include <gfxtranseffect/gfxtransadapter.h> |
|
28 #include <alfdecoderserverclient.h> |
|
29 #include <alf/AlfTransEffectPlugin.h> |
|
30 #include <alftfxserverobserver.h> |
|
31 |
|
32 class CWsTransControlGraphic; |
|
33 class CWsAdapterGraphic; |
|
34 //class CTransControlDrawerInfo; |
|
35 class CSubWOControl; |
|
36 class CAlfTransitionRequest; |
|
37 |
|
38 /** |
|
39 * gfxtranseffect engine adapter |
|
40 * |
|
41 * This class is loaded by the GfxTransEffect client and used by it to request |
|
42 * transition effects. |
|
43 * |
|
44 * @since S60 3.2 |
|
45 */ |
|
46 NONSHARABLE_CLASS(CGfxTransAdapterTfx) : public CBase, |
|
47 public MGfxTransAdapter, |
|
48 public MTfxServerObserver |
|
49 { |
|
50 friend class MGfxTransAdapter; |
|
51 private: |
|
52 |
|
53 /** |
|
54 * constructor |
|
55 * |
|
56 * @since S60 3.2 |
|
57 * |
|
58 * @param aClient the GfxTrans client side. |
|
59 */ |
|
60 CGfxTransAdapterTfx(MGfxTransClient* aClient); |
|
61 |
|
62 /** |
|
63 * default destructor |
|
64 * |
|
65 * @since S60 3.2 |
|
66 * |
|
67 */ |
|
68 ~CGfxTransAdapterTfx(); |
|
69 public: |
|
70 |
|
71 /** |
|
72 * 2nd phase constructor |
|
73 * |
|
74 * @since S60 3.2 |
|
75 * |
|
76 */ |
|
77 void ConstructL(); |
|
78 |
|
79 /** |
|
80 * From MGfxTransEngine |
|
81 * |
|
82 * Notifies the adaptor of the different states its in while collecting data for a transition. |
|
83 * |
|
84 * @since S60 3.2 |
|
85 * |
|
86 * @param aState the state the client is currently in |
|
87 * @param aKey the control that is now processed |
|
88 * @param aHandle the handle for this transition. |
|
89 * @return KErrNone if successful, any other error code if the client should abort. |
|
90 */ |
|
91 TInt HandleClientState(TClientState aState, const CCoeControl* aKey, TInt aHandle); |
|
92 |
|
93 /** |
|
94 * From MGfxTransEngine |
|
95 * |
|
96 * Tests if adapter is active (trying to make it active if needed). |
|
97 * @since S60 3.2 |
|
98 * |
|
99 * @return ETrue if active, otherwise EFalse. |
|
100 */ |
|
101 TBool IsActive(); |
|
102 |
|
103 /** |
|
104 * From MGfxTransEngine |
|
105 * |
|
106 * Called by client to start the specific transition |
|
107 * @since S60 3.2 |
|
108 * |
|
109 * @param aHandle the handle of the transition to start. |
|
110 */ |
|
111 void StartTransition(TInt aHandle); |
|
112 |
|
113 /** |
|
114 * From MGfxTransEngine |
|
115 * |
|
116 * Starts the policy-request system between client and server. |
|
117 * |
|
118 * @since S60 3.2 |
|
119 * |
|
120 * @param aCount. Reference where the number of available policies will be returned. |
|
121 * @return Pointer to a TControlPolicy array or NULL. |
|
122 */ |
|
123 TControlPolicy* GetTransitionPolicies(TInt &aCount); |
|
124 |
|
125 /** |
|
126 * From MGfxTransEngine |
|
127 * |
|
128 * Starts a fullscreen effect |
|
129 * |
|
130 * @since S60 3.2 |
|
131 * |
|
132 * @param aAction the fullscreen transition action number |
|
133 * @param aEffectArea an optional rectangle the fs effect can use |
|
134 */ |
|
135 void BeginFullScreen(TUint aAction, const TRect &aEffectArea); |
|
136 |
|
137 /** |
|
138 * From MGfxTransEngine |
|
139 * |
|
140 * Starts a fullscreen effect, extended version |
|
141 * |
|
142 * @since S60 3.2 |
|
143 * |
|
144 * @param aAction the fullscreen transition action number |
|
145 * @param aEffectArea an optional rectangle the fs effect can use |
|
146 * @param aType an integer identifying the format of aParams |
|
147 * @param aParams a buffer to be interpreted by the TfxServer containing more information |
|
148 */ |
|
149 void BeginFullScreen(TUint aAction, const TRect &aEffectArea, |
|
150 TUint aType, const TDesC8& aParams); |
|
151 |
|
152 /** |
|
153 * From MGfxTransEngine |
|
154 * |
|
155 * Sends an EndFullscreen notification |
|
156 * |
|
157 * @since S60 3.2 |
|
158 * |
|
159 */ |
|
160 void EndFullScreen(); |
|
161 |
|
162 /** |
|
163 * From MGfxTransEngine |
|
164 * |
|
165 * Tells TfxServer to abort the current fullscreen effect, if any is ongoing. |
|
166 * |
|
167 * @since S60 3.2 |
|
168 * |
|
169 */ |
|
170 void AbortFullScreen(); |
|
171 |
|
172 /** |
|
173 * From MGfxTransEngine |
|
174 * |
|
175 * Handles updates of participants, during the transition |
|
176 * |
|
177 * @since S60 3.2 |
|
178 */ |
|
179 void HandleParticpantUpdate(TInt aHandle, |
|
180 const CParticipantData* aParticipant, |
|
181 RWsGraphicMsgBuf* aCommandBuffer, |
|
182 const TRect& aDrawRect, |
|
183 const TRect& aBoundingRect); |
|
184 |
|
185 /** |
|
186 * From MGfxTransEngine |
|
187 * |
|
188 * Not used. |
|
189 * |
|
190 * @since S60 3.2 |
|
191 */ |
|
192 void NotifyExternalState(TInt aState, const TDesC8* aArg); |
|
193 |
|
194 /** |
|
195 * From MTfxServerObserver |
|
196 * |
|
197 * Called when a policy update request has completed. |
|
198 * @param aPolicy a new control policy |
|
199 */ |
|
200 void PolicyUpdate(TControlPolicy* aPolicy); |
|
201 |
|
202 /** |
|
203 * From MTfxServerObserver |
|
204 * |
|
205 * Called when all policies needs to be cleared. |
|
206 */ |
|
207 void ClearAllPolicies(); |
|
208 |
|
209 /** |
|
210 * From MTfxServerObserver |
|
211 * |
|
212 * called when a transitionfinished notification request has completed |
|
213 * @param aHandle the handle of the transition that finished. |
|
214 */ |
|
215 // void TransitionFinished(TInt aHandle ); |
|
216 |
|
217 /* |
|
218 * |
|
219 */ |
|
220 void GetNewPoliciesL( TUint aCount ); |
|
221 |
|
222 /* |
|
223 * |
|
224 */ |
|
225 void CancelPolicyUpdates(); |
|
226 |
|
227 void SendGroupCommand(TInt aGroupId, TBool aGroupFinished); |
|
228 /** |
|
229 * Send the policy update request to effect plugin |
|
230 */ |
|
231 TInt RequestPolicyUpdates(); |
|
232 |
|
233 private: |
|
234 |
|
235 /** |
|
236 * Starts the transition |
|
237 * |
|
238 * @since S60 3.2 |
|
239 * |
|
240 * @param aHandle handle of the transition to start |
|
241 * @param aTransData the transition specification collected by the client |
|
242 */ |
|
243 void DoStartTransitionL(TInt aHandle, const CTransitionData* aTransData); |
|
244 |
|
245 /* |
|
246 * Generate start transition from begin capture in case of contol exit transition |
|
247 */ |
|
248 void GenerateTransitionL( const CCoeControl* aKey, const CTransitionData* aTransData); |
|
249 |
|
250 /* |
|
251 * Connect to server and load plugin |
|
252 */ |
|
253 void ConnectToServer(); |
|
254 |
|
255 /** |
|
256 * Finds a component transition handler crp |
|
257 * |
|
258 * @since S60 3.2 |
|
259 * |
|
260 * @param aHandle the transition handle to find the crp for. |
|
261 * @return a pointer to the crp |
|
262 */ |
|
263 // CWsTransControlGraphic* FindDrawer(TInt aHandle); |
|
264 |
|
265 /** |
|
266 * Finds a component transition |
|
267 * |
|
268 * @since S60 3.2 |
|
269 * |
|
270 * @param aHandle the transition handle to find the control for. |
|
271 * @return a pointer to the CTransControlDrawerInfo |
|
272 */ |
|
273 // CTransControlDrawerInfo* FindControl(TInt aHandle); |
|
274 void SubConEnd(const CCoeControl* aControl); |
|
275 void SubConBegin(const CCoeControl* aControl); |
|
276 void SubConAbort( const CCoeControl* aControl ); |
|
277 |
|
278 |
|
279 private: // data |
|
280 /** |
|
281 * pointer to the client side |
|
282 * Not owned. |
|
283 */ |
|
284 MGfxTransClient* iClient; |
|
285 |
|
286 /** |
|
287 * A connection to the tfx server |
|
288 */ |
|
289 //RTfxServer iTfxServer; |
|
290 |
|
291 RAlfTfxClient iTfxServer; |
|
292 |
|
293 // We need plugin implementation id to send to RAlfTfxClient, |
|
294 // we need to do the resolution from interface uid to implementation uid ourselves, |
|
295 // alf does not do any resolution |
|
296 TUid iPluginImplementation; |
|
297 TBool iConnected; |
|
298 TBool iHasPlugin; |
|
299 |
|
300 // The value in central repository to keep track if effects are allowed |
|
301 TInt iEffectValue; |
|
302 |
|
303 /** |
|
304 * Each currently active transition has an entry in this array. |
|
305 * It owns the pointers in it. |
|
306 */ |
|
307 // RPointerArray<CTransControlDrawerInfo> iControlInfo; |
|
308 |
|
309 TInt iCurrHandle; |
|
310 |
|
311 // TBool iIsWO; |
|
312 |
|
313 TThreadId iClientId; |
|
314 |
|
315 HBufC8* iTransferBuffer; |
|
316 HBufC8* iReturnBuffer; |
|
317 HBufC8* iAsyncTransferBuffer; |
|
318 HBufC8* iAsyncReturnBuffer; |
|
319 |
|
320 CAlfTransitionRequest* iPolicyReq; |
|
321 |
|
322 // CCoeEnv* iCoeEnv; |
|
323 /// |
|
324 // TUint iActiveAction; |
|
325 // TUid iActiveUid; |
|
326 // TInt iSubCons; |
|
327 // TInt iCurrZ; |
|
328 const CCoeControl* iMainControl; |
|
329 // RPointerArray<CSubWOControl> iSubWOControls; |
|
330 // RPointerArray<const CCoeControl> iIgnoredWOChildControls; |
|
331 |
|
332 // TInt iSequence; |
|
333 }; |
|
334 |
|
335 #endif |