|
1 <?xml version="1.0" encoding="UTF-8"?> |
|
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 the License "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 <componentDefinition xmlns="http://www.nokia.com/sdt/emf/component" |
|
10 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
|
11 |
|
12 <component friendlyName="%friendlyName" |
|
13 qualifiedName="com.nokia.sdt.WebClient" |
|
14 baseComponent="com.nokia.sdt.series60.NonLayoutBase" |
|
15 category="Other" version="1.1" |
|
16 instanceNameRoot="webClient"> |
|
17 <documentation> |
|
18 <information>%information</information> |
|
19 </documentation> |
|
20 <symbian sdkName="com.nokia.series60" minSDKVersion="3.0" |
|
21 /> |
|
22 <designerImages smallIconFile="WebClient_sm.png" |
|
23 largeIconFile="WebClient.png"/> |
|
24 |
|
25 <properties> |
|
26 <property name="defaultURL" type="string" default="http://www.s60.com" category="Behavior" descriptionKey="defaultURLDescription"/> |
|
27 <componentReferenceProperty name="waitDialog" scope="model" constraint="com.nokia.sdt.series60.WaitDialog" |
|
28 creationKeys="newWaitDialog" category="Behavior" descriptionKey="waitDialogDescription"/> |
|
29 <componentReferenceProperty name="credentialsQuery" scope="model" constraint="com.nokia.sdt.series60.MultiLineDataQuery" |
|
30 creationKeys="newCredentialsQuery" category="Behavior" descriptionKey="credentialsQueryDescription"/> |
|
31 </properties> |
|
32 |
|
33 <events> |
|
34 <event name="openSessionFailed" category="Data" |
|
35 handlerNameTemplate="Handle{title(name)}OpenSessionFailedL" |
|
36 descriptionKey="openSessionFailedDescription" |
|
37 /> |
|
38 <event name="connecting" category="Data" |
|
39 handlerNameTemplate="Handle{title(name)}ConnectingL" |
|
40 descriptionKey="connectingDescription" |
|
41 /> |
|
42 <event name="headerReceived" category="Data" |
|
43 handlerNameTemplate="Handle{title(name)}HeaderReceivedL" |
|
44 descriptionKey="headerReceivedDescription" |
|
45 /> |
|
46 <event name="bodyReceived" category="Data" |
|
47 handlerNameTemplate="Handle{title(name)}BodyReceivedL" |
|
48 descriptionKey="bodyReceivedDescription" |
|
49 /> |
|
50 <event name="connectionCanceled" category="Data" |
|
51 handlerNameTemplate="Handle{title(name)}ConnectionCanceledL" |
|
52 descriptionKey="connectionCanceledDescription" |
|
53 /> |
|
54 <event name="responseComplete" category="Data" |
|
55 handlerNameTemplate="Handle{title(name)}ResponseCompleteL" |
|
56 descriptionKey="responseCompleteDescription" |
|
57 /> |
|
58 <event name="transactionSucceeded" category="Data" |
|
59 handlerNameTemplate="Handle{title(name)}TransactionSucceededL" |
|
60 descriptionKey="transactionSucceededDescription" |
|
61 /> |
|
62 <event name="transactionFailed" category="Data" |
|
63 handlerNameTemplate="Handle{title(name)}TransactionFailedL" |
|
64 descriptionKey="transactionFailedDescription" |
|
65 /> |
|
66 <event name="unknownEvent" category="Data" |
|
67 handlerNameTemplate="Handle{title(name)}UnknownEventL" |
|
68 descriptionKey="unknownEventDescription" |
|
69 /> |
|
70 <event name="runError" category="Data" |
|
71 handlerNameTemplate="Handle{title(name)}RunErrorL" |
|
72 descriptionKey="runErrorDescription" |
|
73 /> |
|
74 </events> |
|
75 |
|
76 <implementations> |
|
77 <implementation> |
|
78 <interface id="com.nokia.sdt.datamodel.adapter.ISetValueCommandExtender"/> |
|
79 <code class="com.nokia.sdt.series60.component.WebClientImplFactory"/> |
|
80 </implementation> |
|
81 </implementations> |
|
82 |
|
83 <sourceGen forms="AppUi AknView Container Dialog Form SettingsList"> |
|
84 |
|
85 <inline> |
|
86 if (Engine.formMatches(form, [""])) { |
|
87 // create files if missing, without adding user's new file template |
|
88 Engine.createFromStockFile("inc", "WebClientEngine.h", "WebClientEngine.h"); |
|
89 Engine.createFromStockFile("inc", "WebClientEngine.pan", "WebClientEngine.pan"); |
|
90 Engine.createFromStockFile("src", "WebClientEngine.cpp", "WebClientEngine.cpp"); |
|
91 } |
|
92 </inline> |
|
93 |
|
94 <template phase="EventIncludes"><![CDATA[ |
|
95 #include "WebClientEngine.h" |
|
96 ]]> </template> |
|
97 |
|
98 <template id="BaseClass" phase="BaseClassList">,MWebClientObserver</template> |
|
99 |
|
100 <template phase="InstanceVariables"> |
|
101 CWebClientEngine* ${instanceMemberName}; |
|
102 </template> |
|
103 |
|
104 <template phase="Construct"> |
|
105 ${instanceMemberName} = NULL; |
|
106 </template> |
|
107 |
|
108 <template phase="Destroy"> |
|
109 delete ${instanceMemberName}; |
|
110 ${instanceMemberName} = NULL; |
|
111 </template> |
|
112 |
|
113 <template phase="ClassMethods"><![CDATA[ |
|
114 void IssueHTTPGetL( const TDesC8* aUrl = NULL ); |
|
115 ]]> </template> |
|
116 |
|
117 <template phase="ClassProtected"><![CDATA[ |
|
118 // Implementations of MWebClientObserver methods |
|
119 void ClientOpenSessionFailedL( |
|
120 CWebClientEngine& anEngine, |
|
121 TInt anError ); |
|
122 ]]> </template> |
|
123 <template phase="ClassProtected"><![CDATA[ |
|
124 void ClientConnectingL( |
|
125 CWebClientEngine& anEngine ); |
|
126 ]]> </template> |
|
127 <template phase="ClassProtected"><![CDATA[ |
|
128 void ClientHeaderReceivedL( |
|
129 CWebClientEngine& anEngine, |
|
130 const TDesC& aHeaderData ); |
|
131 ]]> </template> |
|
132 <template phase="ClassProtected"><![CDATA[ |
|
133 void ClientBodyReceivedL( |
|
134 CWebClientEngine& anEngine, |
|
135 const TDesC8& aBodyData ); |
|
136 ]]> </template> |
|
137 <template phase="ClassProtected"><![CDATA[ |
|
138 void ClientConnectionCanceledL( |
|
139 CWebClientEngine& anEngine ); |
|
140 ]]> </template> |
|
141 <template phase="ClassProtected"><![CDATA[ |
|
142 void ClientResponseCompleteL( |
|
143 CWebClientEngine& anEngine ); |
|
144 ]]> </template> |
|
145 <template phase="ClassProtected"><![CDATA[ |
|
146 void ClientTransactionSucceededL( |
|
147 CWebClientEngine& anEngine ); |
|
148 ]]> </template> |
|
149 <template phase="ClassProtected"><![CDATA[ |
|
150 void ClientTransactionFailedL( |
|
151 CWebClientEngine& anEngine ); |
|
152 ]]> </template> |
|
153 <template phase="ClassProtected"><![CDATA[ |
|
154 void ClientUnknownEventL( |
|
155 CWebClientEngine& anEngine, |
|
156 TInt aStatus ); |
|
157 ]]> </template> |
|
158 <template phase="ClassProtected"><![CDATA[ |
|
159 void ClientRunErrorL( |
|
160 CWebClientEngine& anEngine, |
|
161 TInt anError ); |
|
162 ]]> </template> |
|
163 <template phase="ClassProtected"><![CDATA[ |
|
164 TBool ClientGetCredentialsL( |
|
165 CWebClientEngine& anEngine, |
|
166 const TUriC8& aUri, |
|
167 const TDesC8& aRealm, |
|
168 TDes& aUsername, |
|
169 TDes& aPassword ); |
|
170 ]]> </template> |
|
171 |
|
172 <template id="INIT_FROM_CONTAINER" phase="Initialize"><![CDATA[ |
|
173 ${instanceMemberName} = CWebClientEngine::NewL( *this ); |
|
174 ]]> </template> |
|
175 |
|
176 |
|
177 <!-- begin ClientOpenSessionFailed --> |
|
178 <defineLocation id="ClientOpenSessionFailedL" baseLocation="MAIN_FILE" |
|
179 owned="false" |
|
180 location="function(${handlerClassName}::ClientOpenSessionFailedL(CWebClientEngine&, TInt))"> |
|
181 <template><![CDATA[ |
|
182 /** |
|
183 * ClientOpenFailedL( CWebClientEngine& anEngine ) |
|
184 * An error occurred opening the HTTP session. The calling code |
|
185 * will leave after this method returns. |
|
186 * @param anError: the error code |
|
187 * Most common error; no access point configured, and session creation |
|
188 * leaves with KErrNotFound. |
|
189 */ |
|
190 void ${className}::ClientOpenSessionFailedL( |
|
191 CWebClientEngine& anEngine, |
|
192 TInt anError ) |
|
193 { |
|
194 } |
|
195 ]]> </template> |
|
196 </defineLocation> |
|
197 <template location="ClientOpenSessionFailedL"/> |
|
198 |
|
199 <defineLocation id="ClientOpenSessionFailedBody" baseLocation="ClientOpenSessionFailedL" |
|
200 owned="true" location="region(Generated Code)"/> |
|
201 <template id="RealizeClientOpenSessionFailedBody" location="ClientOpenSessionFailedBody"/> |
|
202 |
|
203 <templateGroup id="ClientOpenSessionFailedEvent" ifEvents="openSessionFailed"> |
|
204 |
|
205 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
206 void ${event.handlerName}( |
|
207 CWebClientEngine& anEngine, |
|
208 TInt anError ); |
|
209 ]]> </template> |
|
210 |
|
211 <template id="InvokeHandler" location="ClientOpenSessionFailedBody"> |
|
212 ${event.handlerName}( anEngine, anError ); |
|
213 </template> |
|
214 |
|
215 <defineLocation id="OpenSessionFailedHandler" baseLocation="MAIN_FILE" |
|
216 owned="false" |
|
217 isEventHandler="true" |
|
218 location="function(${handlerClassName}::${event.handlerName}(CWebClientEngine&, TInt))"> |
|
219 <template><![CDATA[ |
|
220 /** |
|
221 * Handle the openSessionFailed event. |
|
222 */ |
|
223 void ${handlerClassName}::${event.handlerName}( |
|
224 CWebClientEngine& /*anEngine*/, |
|
225 TInt /*anError*/ ) |
|
226 { |
|
227 // TODO: implement ${event.eventName} event handler |
|
228 } |
|
229 ]]> |
|
230 </template> |
|
231 </defineLocation> |
|
232 <template id="RealizeHandler" location="OpenSessionFailedHandler"/> |
|
233 </templateGroup> |
|
234 <!-- end ClientOpenSessionFailed --> |
|
235 |
|
236 <!-- begin ClientConnecting --> |
|
237 <defineLocation id="ClientConnecting" baseLocation="MAIN_FILE" |
|
238 owned="false" |
|
239 location="function(${handlerClassName}::ClientConnectingL(CWebClientEngine&))"> |
|
240 <template><![CDATA[ |
|
241 /** |
|
242 * ClientConnectingL() |
|
243 * Called to notify that a connection was initiated |
|
244 */ |
|
245 void ${className}::ClientConnectingL( |
|
246 CWebClientEngine& anEngine ) |
|
247 { |
|
248 } |
|
249 ]]> </template> |
|
250 </defineLocation> |
|
251 <template location="ClientConnecting"/> |
|
252 |
|
253 <defineLocation id="ClientConnectingBody" baseLocation="ClientConnecting" |
|
254 owned="true" location="region(Generated Code)"/> |
|
255 <template id="RealizeClientConnectingBody" location="ClientConnectingBody"/> |
|
256 |
|
257 <templateGroup id="ClientConnectingEvent" ifEvents="connecting"> |
|
258 |
|
259 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
260 void ${event.handlerName}( CWebClientEngine& anEngine ); |
|
261 ]]> </template> |
|
262 |
|
263 <template id="InvokeHandler" location="ClientConnectingBody"> |
|
264 ${event.handlerName}( anEngine ); |
|
265 </template> |
|
266 |
|
267 <defineLocation id="ConnectingHandler" baseLocation="MAIN_FILE" |
|
268 owned="false" |
|
269 isEventHandler="true" |
|
270 location="function(${handlerClassName}::${event.handlerName}(CWebClientEngine&))"> |
|
271 <template><![CDATA[ |
|
272 /** |
|
273 * Handle the connecting event. |
|
274 */ |
|
275 void ${handlerClassName}::${event.handlerName}( |
|
276 CWebClientEngine& /*anEngine*/ ) |
|
277 { |
|
278 // TODO: implement ${event.eventName} event handler |
|
279 } |
|
280 ]]> |
|
281 </template> |
|
282 </defineLocation> |
|
283 <template id="RealizeHandler" location="ConnectingHandler"/> |
|
284 </templateGroup> |
|
285 <!-- end ClientConnecting --> |
|
286 |
|
287 <!-- begin ClientHeaderReceived --> |
|
288 <defineLocation id="ClientHeaderReceived" baseLocation="MAIN_FILE" |
|
289 owned="false" |
|
290 location="function(${handlerClassName}::ClientHeaderReceivedL(CWebClientEngine&, const TDesC&))"> |
|
291 <template><![CDATA[ |
|
292 /** |
|
293 * ClientHeaderReceivedL() |
|
294 * Called when HTTP header is received. |
|
295 * @param aHeaderData: Header field name and value |
|
296 */ |
|
297 void ${className}::ClientHeaderReceivedL( |
|
298 CWebClientEngine& anEngine, |
|
299 const TDesC& aHeaderData ) |
|
300 { |
|
301 } |
|
302 ]]> </template> |
|
303 </defineLocation> |
|
304 <template location="ClientHeaderReceived"/> |
|
305 |
|
306 <defineLocation id="ClientHeaderReceivedBody" baseLocation="ClientHeaderReceived" |
|
307 owned="true" location="region(Generated Code)"/> |
|
308 <template id="RealizeClientHeaderReceivedBody" location="ClientHeaderReceivedBody"/> |
|
309 |
|
310 <templateGroup id="HeaderReceived" ifEvents="headerReceived"> |
|
311 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
312 void ${event.handlerName}( |
|
313 CWebClientEngine& anEngine, |
|
314 const TDesC& aHeaderData ); |
|
315 ]]> </template> |
|
316 |
|
317 <template id="InvokeHandler" location="ClientHeaderReceivedBody"> |
|
318 ${event.handlerName}( anEngine, aHeaderData ); |
|
319 </template> |
|
320 |
|
321 <defineLocation id="HeaderReceivedHandler" baseLocation="MAIN_FILE" |
|
322 owned="false" |
|
323 isEventHandler="true" |
|
324 location="function(${handlerClassName}::${event.handlerName}(CWebClientEngine&, const TDesC&))"> |
|
325 <template><![CDATA[ |
|
326 /** |
|
327 * Handle the ${event.eventName} event. |
|
328 */ |
|
329 void ${handlerClassName}::${event.handlerName}( |
|
330 CWebClientEngine& /*anEngine*/, |
|
331 const TDesC& /*aHeaderData*/) |
|
332 { |
|
333 // TODO: implement ${event.eventName} event handler |
|
334 } |
|
335 ]]> |
|
336 </template> |
|
337 </defineLocation> |
|
338 <template id="RealizeHandler" location="HeaderReceivedHandler"/> |
|
339 </templateGroup> |
|
340 <!-- end ClientHeaderReceived --> |
|
341 |
|
342 <!-- begin ClientBodyReceived --> |
|
343 <defineLocation id="ClientBodyReceived" baseLocation="MAIN_FILE" |
|
344 owned="false" |
|
345 location="function(${handlerClassName}::ClientBodyReceivedL(CWebClientEngine&, const TDesC8&))"> |
|
346 <template><![CDATA[ |
|
347 /** |
|
348 * ClientBodyReceivedL() |
|
349 * Called when a part of the HTTP body is received. |
|
350 * @param aBodyData: Part of the body data received. (e.g. part of |
|
351 * the received HTML page) |
|
352 */ |
|
353 void ${className}::ClientBodyReceivedL( |
|
354 CWebClientEngine& anEngine, |
|
355 const TDesC8& aBodyData ) |
|
356 { |
|
357 } |
|
358 ]]> </template> |
|
359 </defineLocation> |
|
360 <template location="ClientBodyReceived"/> |
|
361 |
|
362 <defineLocation id="ClientBodyReceivedBody" baseLocation="ClientBodyReceived" |
|
363 owned="true" location="region(Generated Code)"/> |
|
364 <template id="RealizeClientBodyReceivedBody" location="ClientBodyReceivedBody"/> |
|
365 |
|
366 <templateGroup id="BodyReceived" ifEvents="bodyReceived"> |
|
367 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
368 void ${event.handlerName}( |
|
369 CWebClientEngine& anEngine, |
|
370 const TDesC8& aBodyData ); |
|
371 ]]> </template> |
|
372 |
|
373 <template id="InvokeHandler" location="ClientBodyReceivedBody"> |
|
374 ${event.handlerName}( anEngine, aBodyData ); |
|
375 </template> |
|
376 |
|
377 <defineLocation id="BodyReceivedHandler" baseLocation="MAIN_FILE" |
|
378 owned="false" |
|
379 isEventHandler="true" |
|
380 location="function(${handlerClassName}::${event.handlerName}(CWebClientEngine&, TDesC8&))"> |
|
381 <template><![CDATA[ |
|
382 /** |
|
383 * Handle the ${event.eventName} event. |
|
384 */ |
|
385 void ${handlerClassName}::${event.handlerName}( |
|
386 CWebClientEngine& /*anEngine*/, |
|
387 const TDesC8& /*aBodyData*/) |
|
388 { |
|
389 // TODO: implement ${event.eventName} event handler |
|
390 } |
|
391 ]]> |
|
392 </template> |
|
393 </defineLocation> |
|
394 <template id="RealizeHandler" location="BodyReceivedHandler"/> |
|
395 </templateGroup> |
|
396 <!-- end ClientBodyReceived --> |
|
397 |
|
398 <!-- begin ClientConnectionCanceled --> |
|
399 <defineLocation id="ClientConnectionCanceled" baseLocation="MAIN_FILE" |
|
400 owned="false" |
|
401 location="function(${handlerClassName}::ClientConnectionCanceledL(CWebClientEngine&))"> |
|
402 <template><![CDATA[ |
|
403 /** |
|
404 * ClientConnectionCanceledL() |
|
405 * Called to notify that a connection attempt has been canceled |
|
406 */ |
|
407 void ${className}::ClientConnectionCanceledL( |
|
408 CWebClientEngine& anEngine ) |
|
409 { |
|
410 } |
|
411 ]]> </template> |
|
412 </defineLocation> |
|
413 <template location="ClientConnectionCanceled"/> |
|
414 |
|
415 <defineLocation id="ClientConnectionCanceledBody" baseLocation="ClientConnectionCanceled" |
|
416 owned="true" location="region(Generated Code)"/> |
|
417 <template id="RealizeClientConnectionCanceledBody" location="ClientConnectionCanceledBody"/> |
|
418 |
|
419 <templateGroup id="ConnectionCanceled" ifEvents="connectionCanceled"> |
|
420 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
421 void ${event.handlerName}( CWebClientEngine& anEngine ); |
|
422 ]]> </template> |
|
423 |
|
424 <template id="InvokeHandler" location="ClientConnectionCanceledBody"> |
|
425 ${event.handlerName}( anEngine ); |
|
426 </template> |
|
427 |
|
428 <defineLocation id="ConnectionCanceledHandler" baseLocation="MAIN_FILE" |
|
429 owned="false" |
|
430 isEventHandler="true" |
|
431 location="function(${handlerClassName}::${event.handlerName}(CWebClientEngine&))"> |
|
432 <template><![CDATA[ |
|
433 /** |
|
434 * Handle the ${event.eventName} event. |
|
435 */ |
|
436 void ${handlerClassName}::${event.handlerName}( |
|
437 CWebClientEngine& /*anEngine*/ ) |
|
438 { |
|
439 // TODO: implement ${event.eventName} event handler |
|
440 } |
|
441 ]]> |
|
442 </template> |
|
443 </defineLocation> |
|
444 <template id="RealizeHandler" location="ConnectionCanceledHandler"/> |
|
445 </templateGroup> |
|
446 <!-- end ClientConnectionCanceled --> |
|
447 |
|
448 <!-- begin ClientResponseComplete --> |
|
449 <defineLocation id="ClientResponseComplete" baseLocation="MAIN_FILE" |
|
450 owned="false" |
|
451 location="function(${handlerClassName}::ClientResponseCompleteL(CWebClientEngine&))"> |
|
452 <template><![CDATA[ |
|
453 /** |
|
454 * ClientResponseCompleteL |
|
455 * Called to notify that a transaction's response is complete. |
|
456 * See TTransactionEvent::EResponseComplete |
|
457 */ |
|
458 void ${className}::ClientResponseCompleteL( |
|
459 CWebClientEngine& anEngine ) |
|
460 { |
|
461 } |
|
462 ]]> </template> |
|
463 </defineLocation> |
|
464 <template location="ClientResponseComplete"/> |
|
465 |
|
466 <defineLocation id="ClientResponseCompleteBody" baseLocation="ClientResponseComplete" |
|
467 owned="true" location="region(Generated Code)"/> |
|
468 <template id="RealizeClientResponseCompleteBody" location="ClientResponseCompleteBody"/> |
|
469 |
|
470 <templateGroup id="ResponseComplete" ifEvents="responseComplete"> |
|
471 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
472 void ${event.handlerName}( CWebClientEngine& anEngine ); |
|
473 ]]> </template> |
|
474 |
|
475 <template id="InvokeHandler" location="ClientResponseCompleteBody"> |
|
476 ${event.handlerName}( anEngine ); |
|
477 </template> |
|
478 |
|
479 <defineLocation id="ResponseCompleteHandler" baseLocation="MAIN_FILE" |
|
480 owned="false" |
|
481 isEventHandler="true" |
|
482 location="function(${handlerClassName}::${event.handlerName}(CWebClientEngine&))"> |
|
483 <template><![CDATA[ |
|
484 /** |
|
485 * Handle the ${event.eventName} event. |
|
486 */ |
|
487 void ${handlerClassName}::${event.handlerName}( |
|
488 CWebClientEngine& /*anEngine*/ ) |
|
489 { |
|
490 // TODO: implement ${event.eventName} event handler |
|
491 } |
|
492 ]]> |
|
493 </template> |
|
494 </defineLocation> |
|
495 <template id="RealizeHandler" location="ResponseCompleteHandler"/> |
|
496 </templateGroup> |
|
497 <!-- end ClientResponseComplete --> |
|
498 |
|
499 <!-- begin ClientTransactionSucceeded --> |
|
500 <defineLocation id="ClientTransactionSucceeded" baseLocation="MAIN_FILE" |
|
501 owned="false" |
|
502 location="function(${handlerClassName}::ClientTransactionSucceededL(CWebClientEngine&))"> |
|
503 <template><![CDATA[ |
|
504 /** |
|
505 * ClientTransactionSucceededL() |
|
506 * Called to notify that a transaction completed successfully |
|
507 * See TTransactionEvent::ESucceeded |
|
508 */ |
|
509 void ${className}::ClientTransactionSucceededL( |
|
510 CWebClientEngine& anEngine ) |
|
511 { |
|
512 } |
|
513 ]]> </template> |
|
514 </defineLocation> |
|
515 <template location="ClientTransactionSucceeded"/> |
|
516 |
|
517 <defineLocation id="ClientTransactionSucceededBody" baseLocation="ClientTransactionSucceeded" |
|
518 owned="true" location="region(Generated Code)"/> |
|
519 <template id="RealizeClientTransactionSucceededBody" location="ClientTransactionSucceededBody"/> |
|
520 |
|
521 <template location="ClientTransactionSucceededBody"><![CDATA[ |
|
522 <% var dialogInstance = lookupInstanceByName(instance.properties.waitDialog); |
|
523 if (dialogInstance != null) { %> |
|
524 Remove${titleCase(dialogInstance.properties.name)}L(); |
|
525 <% } %> ]]></template> |
|
526 |
|
527 <templateGroup id="TransactionSucceeded" ifEvents="transactionSucceeded"> |
|
528 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
529 void ${event.handlerName}( CWebClientEngine& anEngine ); |
|
530 ]]> </template> |
|
531 |
|
532 <template id="InvokeHandler" location="ClientTransactionSucceededBody"> |
|
533 ${event.handlerName}( anEngine ); |
|
534 </template> |
|
535 |
|
536 <defineLocation id="TransactionSucceededHandler" baseLocation="MAIN_FILE" |
|
537 owned="false" |
|
538 isEventHandler="true" |
|
539 location="function(${handlerClassName}::${event.handlerName}(CWebClientEngine&))"> |
|
540 <template><![CDATA[ |
|
541 /** |
|
542 * Handle the ${event.eventName} event. |
|
543 */ |
|
544 void ${handlerClassName}::${event.handlerName}( |
|
545 CWebClientEngine& /*anEngine*/ ) |
|
546 { |
|
547 // TODO: implement ${event.eventName} event handler |
|
548 } |
|
549 ]]> </template> |
|
550 </defineLocation> |
|
551 <template id="RealizeHandler" location="TransactionSucceededHandler"/> |
|
552 </templateGroup> |
|
553 <!-- end ClientTransactionSucceeded --> |
|
554 |
|
555 <!-- begin ClientTransactionFailed --> |
|
556 <defineLocation id="ClientTransactionFailed" baseLocation="MAIN_FILE" |
|
557 owned="false" |
|
558 location="function(${handlerClassName}::ClientTransactionFailedL(CWebClientEngine&))"> |
|
559 <template><![CDATA[ |
|
560 /** |
|
561 * ClientTransactionFailedL() |
|
562 * Catch-all for failure. |
|
563 * See TTransactionEvent::EFailed |
|
564 */ |
|
565 void ${className}::ClientTransactionFailedL( |
|
566 CWebClientEngine& anEngine ) |
|
567 { |
|
568 } |
|
569 ]]> </template> |
|
570 </defineLocation> |
|
571 <template location="ClientTransactionFailed"/> |
|
572 |
|
573 <defineLocation id="ClientTransactionFailedBody" baseLocation="ClientTransactionFailed" |
|
574 owned="true" location="region(Generated Code)"/> |
|
575 <template id="RealizeClientTransactionFailedBody" location="ClientTransactionFailedBody"/> |
|
576 |
|
577 <template location="ClientTransactionFailedBody"><![CDATA[ |
|
578 <% var dialogInstance = lookupInstanceByName(instance.properties.waitDialog); |
|
579 if (dialogInstance != null) { %> |
|
580 Remove${titleCase(dialogInstance.properties.name)}L(); |
|
581 <% } %> ]]></template> |
|
582 |
|
583 <templateGroup id="TransactionFailed" ifEvents="transactionFailed"> |
|
584 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
585 void ${event.handlerName}( CWebClientEngine& anEngine ); |
|
586 ]]> </template> |
|
587 |
|
588 <template id="InvokeHandler" location="ClientTransactionFailedBody"> |
|
589 ${event.handlerName}( anEngine ); |
|
590 </template> |
|
591 |
|
592 <defineLocation id="TransactionFailedHandler" baseLocation="MAIN_FILE" |
|
593 owned="false" |
|
594 isEventHandler="true" |
|
595 location="function(${handlerClassName}::${event.handlerName}(CWebClientEngine&))"> |
|
596 <template><![CDATA[ |
|
597 /** |
|
598 * Handle the ${event.eventName} event. |
|
599 */ |
|
600 void ${handlerClassName}::${event.handlerName}( |
|
601 CWebClientEngine& /*anEngine*/ ) |
|
602 { |
|
603 // TODO: implement ${event.eventName} event handler |
|
604 } |
|
605 ]]> |
|
606 </template> |
|
607 </defineLocation> |
|
608 <template id="RealizeHandler" location="TransactionFailedHandler"/> |
|
609 </templateGroup> |
|
610 <!-- end ClientTransactionFailed --> |
|
611 |
|
612 <!-- begin ClientUnknownEvent --> |
|
613 <defineLocation id="ClientUnknownEvent" baseLocation="MAIN_FILE" |
|
614 owned="false" |
|
615 location="function(${handlerClassName}::ClientUnknownEventL(CWebClientEngine&, TInt))"> |
|
616 <template><![CDATA[ |
|
617 /** |
|
618 * ClientUnknownEventL |
|
619 * Called to notify that an unknown HTTP event has |
|
620 * been received. |
|
621 * @param aStatus: the iStatus field of the event |
|
622 * See THTTPEvent::iStatus |
|
623 */ |
|
624 void ${className}::ClientUnknownEventL( |
|
625 CWebClientEngine& anEngine, |
|
626 TInt aStatus ) |
|
627 { |
|
628 } |
|
629 ]]> </template> |
|
630 </defineLocation> |
|
631 <template location="ClientUnknownEvent"/> |
|
632 |
|
633 <defineLocation id="ClientUnknownEventBody" baseLocation="ClientUnknownEvent" |
|
634 owned="true" location="region(Generated Code)"/> |
|
635 <template id="RealizeClientUnknownEventBody" location="ClientUnknownEventBody"/> |
|
636 |
|
637 <templateGroup id="UnknownEvent" ifEvents="unknownEvent"> |
|
638 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
639 void ${event.handlerName}( |
|
640 CWebClientEngine& anEngine, |
|
641 TInt aStatus ); |
|
642 ]]> </template> |
|
643 |
|
644 <template id="InvokeHandler" location="ClientUnknownEventBody"> |
|
645 ${event.handlerName}( anEngine, aStatus ); |
|
646 </template> |
|
647 |
|
648 <defineLocation id="UnknownEventHandler" baseLocation="MAIN_FILE" |
|
649 owned="false" |
|
650 isEventHandler="true" |
|
651 location="function(${handlerClassName}::${event.handlerName}(CWebClientEngine&,TInt))"> |
|
652 <template><![CDATA[ |
|
653 /** |
|
654 * Handle the ${event.eventName} event. |
|
655 */ |
|
656 void ${handlerClassName}::${event.handlerName}( |
|
657 CWebClientEngine& /*anEngine*/, |
|
658 TInt /*aStatus*/ ) |
|
659 { |
|
660 // TODO: implement ${event.eventName} event handler |
|
661 } |
|
662 ]]> |
|
663 </template> |
|
664 </defineLocation> |
|
665 <template id="RealizeHandler" location="UnknownEventHandler"/> |
|
666 </templateGroup> |
|
667 <!-- end ClientUnknownEvent --> |
|
668 |
|
669 <!-- begin ClientRunError --> |
|
670 <defineLocation id="ClientRunError" baseLocation="MAIN_FILE" |
|
671 owned="false" |
|
672 location="function(${handlerClassName}::ClientRunErrorL(CWebClientEngine&, TInt))"> |
|
673 <template><![CDATA[ |
|
674 /** |
|
675 * ClientRunErrorL() |
|
676 * Called when a error occurs in the handling of a transaction event. |
|
677 * @param anError: the error code |
|
678 */ |
|
679 void ${className}::ClientRunErrorL( |
|
680 CWebClientEngine& anEngine, |
|
681 TInt anError ) |
|
682 { |
|
683 } |
|
684 ]]> </template> |
|
685 </defineLocation> |
|
686 <template location="ClientRunError"/> |
|
687 |
|
688 <defineLocation id="ClientRunErrorBody" baseLocation="ClientRunError" |
|
689 owned="true" location="region(Generated Code)"/> |
|
690 <template id="RealizeClientRunErrorBody" location="ClientRunErrorBody"/> |
|
691 |
|
692 <template location="ClientRunErrorBody"><![CDATA[ |
|
693 <% var dialogInstance = lookupInstanceByName(instance.properties.waitDialog); |
|
694 if (dialogInstance != null) { %> |
|
695 Remove${titleCase(dialogInstance.properties.name)}L(); |
|
696 <% } %> ]]></template> |
|
697 |
|
698 <templateGroup id="RunError" ifEvents="runError"> |
|
699 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
700 void ${event.handlerName}( |
|
701 CWebClientEngine& anEngine, |
|
702 TInt anError ); |
|
703 ]]> </template> |
|
704 |
|
705 <template id="InvokeHandler" location="ClientRunErrorBody"> |
|
706 ${event.handlerName}( anEngine, anError ); |
|
707 </template> |
|
708 |
|
709 <defineLocation id="RunErrorHandler" baseLocation="MAIN_FILE" |
|
710 owned="false" |
|
711 isEventHandler="true" |
|
712 location="function(${handlerClassName}::${event.handlerName}(CWebClientEngine&, TInt))"> |
|
713 <template><![CDATA[ |
|
714 /** |
|
715 * Handle the ${event.eventName} event. |
|
716 */ |
|
717 void ${handlerClassName}::${event.handlerName}( |
|
718 CWebClientEngine& /*anEngine*/, |
|
719 TInt /*anError*/ ) |
|
720 { |
|
721 // TODO: implement ${event.eventName} event handler |
|
722 } |
|
723 ]]> |
|
724 </template> |
|
725 </defineLocation> |
|
726 <template id="RealizeHandler" location="RunErrorHandler"/> |
|
727 </templateGroup> |
|
728 <!-- end ClientRunError --> |
|
729 |
|
730 <!-- begin ClientGetCredentials --> |
|
731 |
|
732 <defineLocation id="ClientGetCredentials" baseLocation="MAIN_FILE" |
|
733 owned="false" |
|
734 location="function(${handlerClassName}::ClientGetCredentialsL(CWebClientEngine&, const TUriC8&, const TDesC8&, TDes&, TDes&))"> |
|
735 <template><![CDATA[ |
|
736 /** |
|
737 * ClientGetCredentialsL() |
|
738 * Called when authentication has been requested by the server. |
|
739 * Return EFalse for no authentication or e.g. the user cancels |
|
740 * an input dialog. Otherwise return the user name and password |
|
741 * as out parameters along with an ETrue result. |
|
742 * @param aUri: the current URI |
|
743 * @param aRealm: the realm associated with the request |
|
744 * @param aUserName: the returned user name |
|
745 * @param aPassword: the returned password |
|
746 */ |
|
747 TBool ${className}::ClientGetCredentialsL( |
|
748 CWebClientEngine& anEngine, |
|
749 const TUriC8& aUri, |
|
750 const TDesC8& aRealm, |
|
751 TDes& aUsername, |
|
752 TDes& aPassword ) |
|
753 { |
|
754 } |
|
755 ]]> </template> |
|
756 </defineLocation> |
|
757 <template location="ClientGetCredentials"/> |
|
758 |
|
759 <defineLocation id="ClientGetCredentialsBody" baseLocation="ClientGetCredentials" |
|
760 owned="true" location="region(Generated Code)"/> |
|
761 <template id="RealizeClientGetCredentialsBody" location="ClientGetCredentialsBody"/> |
|
762 |
|
763 <template location="ClientGetCredentialsBody"><![CDATA[ |
|
764 <% var queryInstance = lookupInstanceByName(instance.properties.credentialsQuery); |
|
765 if (queryInstance != null) { %> |
|
766 TInt result = Run${titleCase(instance.properties.credentialsQuery)}L( aUsername, aPassword, ETrue ); |
|
767 return result == EAknSoftkeyOk; |
|
768 <% } else {%>return EFalse; |
|
769 <% } %>]]> </template> |
|
770 |
|
771 <!-- end ClientGetCredentials --> |
|
772 |
|
773 <defineLocation id="ISSUE_HTTP_GETL_METHOD" baseLocation="MAIN_FILE" |
|
774 owned="true" |
|
775 location="function(${className}::IssueHTTPGetL(const TDesC8*))"> |
|
776 <template><![CDATA[ |
|
777 |
|
778 /** |
|
779 * Initiate the HTTP GET transaction. Progress and data will |
|
780 * be provided through the MWebClientObserver callback methods. |
|
781 * If configured in the UI Designer, the wait dialog is executed |
|
782 * before returning. |
|
783 * @param aUrl: if non-null this is used as the URL to fetch. Otherwise |
|
784 * the URL configured in the UI Designer is used. |
|
785 */ |
|
786 void ${className}::IssueHTTPGetL( const TDesC8* aUrl ) |
|
787 { |
|
788 <% var dialogInstance = lookupInstanceByName(instance.properties.waitDialog); |
|
789 if (dialogInstance != null) { %> |
|
790 Execute${titleCase(dialogInstance.properties.name)}LD(); |
|
791 <% } %> |
|
792 if ( aUrl != NULL ) |
|
793 { |
|
794 ${instanceMemberName}->IssueHTTPGetL( *aUrl ); |
|
795 } |
|
796 <% if (instance.properties.defaultURL != null) { %> else |
|
797 { |
|
798 _LIT8( url, "${instance.properties.defaultURL}" ); |
|
799 ${instanceMemberName}->IssueHTTPGetL( url ); |
|
800 } |
|
801 <% } %> |
|
802 } |
|
803 ]]> </template> |
|
804 </defineLocation> |
|
805 <template id="RealizeHttpGetLMethod" location="ISSUE_HTTP_GETL_METHOD"/> |
|
806 |
|
807 <template mode="upgrade(1.0,1.1)" location="HEADER_FILE"><![CDATA[ |
|
808 @@@ add unowned include |
|
809 // ]]] end generated region [Generated Includes] |
|
810 + #include "WebClientEngine.h" |
|
811 ]]> </template> |
|
812 |
|
813 <template mode="upgrade(1.0,1.1)" location="CLASS"><![CDATA[ |
|
814 @@@ add unowned method declaration |
|
815 protected: |
|
816 + // Implementations of MWebClientObserver methods |
|
817 + void ClientOpenSessionFailedL( |
|
818 + CWebClientEngine& anEngine, |
|
819 + TInt anError ); |
|
820 ]]> </template> |
|
821 |
|
822 <template mode="upgrade(1.0,1.1)" location="CLASS"><![CDATA[ |
|
823 @@@ add unowned method declaration |
|
824 protected: |
|
825 + void ClientConnectingL( |
|
826 + CWebClientEngine& anEngine ); |
|
827 ]]> </template> |
|
828 |
|
829 <template mode="upgrade(1.0,1.1)" location="CLASS"><![CDATA[ |
|
830 @@@ add unowned method declaration |
|
831 protected: |
|
832 + void ClientHeaderReceivedL( |
|
833 + CWebClientEngine& anEngine, |
|
834 + const TDesC& aHeaderData ); |
|
835 ]]> </template> |
|
836 |
|
837 <template mode="upgrade(1.0,1.1)" location="CLASS"><![CDATA[ |
|
838 @@@ add unowned method declaration |
|
839 protected: |
|
840 + void ClientBodyReceivedL( |
|
841 + CWebClientEngine& anEngine, |
|
842 + const TDesC8& aBodyData ); |
|
843 ]]> </template> |
|
844 |
|
845 <template mode="upgrade(1.0,1.1)" location="CLASS"><![CDATA[ |
|
846 @@@ add unowned method declaration |
|
847 protected: |
|
848 + void ClientConnectionCanceledL( |
|
849 + CWebClientEngine& anEngine ); |
|
850 ]]> </template> |
|
851 |
|
852 <template mode="upgrade(1.0,1.1)" location="CLASS"><![CDATA[ |
|
853 @@@ add unowned method declaration |
|
854 protected: |
|
855 + void ClientResponseCompleteL( |
|
856 + CWebClientEngine& anEngine ); |
|
857 ]]> </template> |
|
858 |
|
859 <template mode="upgrade(1.0,1.1)" location="CLASS"><![CDATA[ |
|
860 @@@ add unowned method declaration |
|
861 protected: |
|
862 + void ClientTransactionSucceededL( |
|
863 + CWebClientEngine& anEngine ); |
|
864 ]]> </template> |
|
865 |
|
866 <template mode="upgrade(1.0,1.1)" location="CLASS"><![CDATA[ |
|
867 @@@ add unowned method declaration |
|
868 protected: |
|
869 + void ClientTransactionFailedL( |
|
870 + CWebClientEngine& anEngine ); |
|
871 ]]> </template> |
|
872 |
|
873 <template mode="upgrade(1.0,1.1)" location="CLASS"><![CDATA[ |
|
874 @@@ add unowned method declaration |
|
875 protected: |
|
876 + void ClientUnknownEventL( |
|
877 + CWebClientEngine& anEngine, |
|
878 + TInt aStatus ); |
|
879 ]]> </template> |
|
880 |
|
881 <template mode="upgrade(1.0,1.1)" location="CLASS"><![CDATA[ |
|
882 @@@ add unowned method declaration |
|
883 protected: |
|
884 + void ClientRunErrorL( |
|
885 + CWebClientEngine& anEngine, |
|
886 + TInt anError ); |
|
887 ]]> </template> |
|
888 |
|
889 <template mode="upgrade(1.0,1.1)" location="CLASS"><![CDATA[ |
|
890 @@@ add unowned method declaration |
|
891 protected: |
|
892 + TBool ClientGetCredentialsL( |
|
893 + CWebClientEngine& anEngine, |
|
894 + const TUriC8& aUri, |
|
895 + const TDesC8& aRealm, |
|
896 + TDes& aUsername, |
|
897 + TDes& aPassword ); |
|
898 ]]> </template> |
|
899 |
|
900 |
|
901 </sourceGen> |
|
902 </component> |
|
903 </componentDefinition> |