|
1 <!-- locations provided by component --> |
|
2 |
|
3 <defineLocation id="HEADER_FILE" domain="cpp" dir="${inc}" |
|
4 file="${instanceName}.h" |
|
5 owned="false" |
|
6 location=""> |
|
7 </defineLocation> |
|
8 |
|
9 <template location="HEADER_FILE"> |
|
10 #ifndef ${instanceName.toUpperCase()}_H |
|
11 #define ${instanceName.toUpperCase()}_H |
|
12 |
|
13 </template> |
|
14 |
|
15 <defineLocation id="HEADER_INCLUDES" baseLocation="HEADER_FILE" |
|
16 location="region(Generated Includes)" |
|
17 filter="unique-includes" |
|
18 > |
|
19 </defineLocation> |
|
20 |
|
21 <template location="HEADER_INCLUDES"><![CDATA[ |
|
22 #include <aknappui.h> |
|
23 ]]> </template> |
|
24 <template location="HEADER_INCLUDES"><![CDATA[ |
|
25 #include <eikmenub.h> |
|
26 ]]> </template> |
|
27 |
|
28 <defineLocation id="FORWARD_DECLARATIONS" baseLocation="HEADER_FILE" |
|
29 location="region(Generated Forward Declarations)"> |
|
30 </defineLocation> |
|
31 |
|
32 <template location="FORWARD_DECLARATIONS"/> |
|
33 |
|
34 <defineLocation id="CLASS" baseLocation="HEADER_FILE" |
|
35 owned="false" |
|
36 location="class(${className})"> |
|
37 <template><![CDATA[ |
|
38 /** |
|
39 * @class ${className} ${instanceName}.h |
|
40 * @brief The AppUi class handles application-wide aspects of the user interface, including |
|
41 * container management and the default menu, control pane, and status pane. |
|
42 */ |
|
43 class ${className} : public CAknAppUi |
|
44 { |
|
45 public: |
|
46 // constructor and destructor |
|
47 ${className}(); |
|
48 void ConstructL(); |
|
49 virtual ~${className}(); |
|
50 |
|
51 public: |
|
52 // from CEikAppUi |
|
53 void HandleCommandL( TInt aCommand ); |
|
54 void HandleResourceChangeL( TInt aType ); |
|
55 |
|
56 private: |
|
57 void InitializeContainersL(); |
|
58 }; |
|
59 ]]> |
|
60 </template> |
|
61 </defineLocation> |
|
62 |
|
63 <template location="CLASS"/> |
|
64 |
|
65 <defineLocation id="CLASS_METHODS" baseLocation="CLASS" |
|
66 filter="unique-prototypes" |
|
67 location="region(Generated Methods)"> |
|
68 <template><![CDATA[ |
|
69 public: <% contrib.indentAdjust(-1); %> |
|
70 ]]> </template> |
|
71 </defineLocation> |
|
72 |
|
73 <template location="CLASS_METHODS"/> |
|
74 |
|
75 <defineLocation id="CLASS_IVARS" baseLocation="CLASS" |
|
76 location="region(Generated Instance Variables)"> |
|
77 <template><![CDATA[ |
|
78 private: <% contrib.indentAdjust(-1); %> |
|
79 ]]> </template> |
|
80 </defineLocation> |
|
81 |
|
82 <template location="CLASS_IVARS"/> |
|
83 |
|
84 <defineLocation id="BASE_CLASS_LIST" baseLocation="CLASS" |
|
85 owned="false" |
|
86 filter="unique-bases" |
|
87 location="bases()"> |
|
88 </defineLocation> |
|
89 |
|
90 <template location="BASE_CLASS_LIST" /> |
|
91 |
|
92 <defineLocation id="CLASS_OVERRIDES" baseLocation="CLASS" |
|
93 owned="false" |
|
94 filter="unique-prototypes" |
|
95 location="region(Overridden Methods)"> |
|
96 <template><![CDATA[ |
|
97 protected: <% contrib.indentAdjust(-1); %> |
|
98 ]]> </template> |
|
99 |
|
100 </defineLocation> |
|
101 |
|
102 <template location="CLASS_OVERRIDES"/> |
|
103 |
|
104 <defineLocation id="CLASS_USERHANDLERS" baseLocation="CLASS" |
|
105 owned="false" |
|
106 filter="unique-prototypes" |
|
107 location="region(User Handlers)"> |
|
108 <template><![CDATA[ |
|
109 protected: <% contrib.indentAdjust(-1); %> |
|
110 ]]> </template> |
|
111 |
|
112 </defineLocation> |
|
113 |
|
114 <template location="CLASS_USERHANDLERS"/> |
|
115 |
|
116 <template location="HEADER_FILE"> |
|
117 #endif // ${instanceName.toUpperCase()}_H |
|
118 </template> |
|
119 |
|
120 |
|
121 <defineLocation id="MAIN_FILE" domain="cpp" dir="${src}" |
|
122 file="${instanceName}.cpp" |
|
123 owned="false" |
|
124 location=""> |
|
125 </defineLocation> |
|
126 |
|
127 <template location="MAIN_FILE"/> |
|
128 |
|
129 <defineLocation id="MAIN_SYSTEM_INCLUDES" baseLocation="MAIN_FILE" |
|
130 location="region(Generated System Includes)" |
|
131 filter="unique-includes"> |
|
132 <template><![CDATA[ |
|
133 #include <eikmenub.h> |
|
134 ]]> </template> |
|
135 </defineLocation> |
|
136 |
|
137 <template location="MAIN_SYSTEM_INCLUDES" /> |
|
138 |
|
139 <defineLocation id="MAIN_USER_INCLUDES" baseLocation="MAIN_FILE" |
|
140 location="region(Generated User Includes)" |
|
141 filter="unique-includes"> |
|
142 <template><![CDATA[ |
|
143 #include "${instanceName}.h" |
|
144 ]]> </template> |
|
145 </defineLocation> |
|
146 |
|
147 <template location="MAIN_USER_INCLUDES"/> |
|
148 |
|
149 <defineLocation id="CONSTANTS" baseLocation="MAIN_FILE" |
|
150 location="region(Generated Constants)"> |
|
151 </defineLocation> |
|
152 |
|
153 <template location="CONSTANTS" /> |
|
154 |
|
155 <defineLocation id="CONSTRUCTOR" baseLocation="MAIN_FILE" |
|
156 owned="false" |
|
157 location="function(${className}::${className}())"> |
|
158 <template><![CDATA[ |
|
159 /** |
|
160 * Construct the ${className} instance |
|
161 */ |
|
162 ${className}::${className}() |
|
163 { |
|
164 } |
|
165 ]]> |
|
166 </template> |
|
167 </defineLocation> |
|
168 |
|
169 <template location="CONSTRUCTOR"/> |
|
170 |
|
171 <defineLocation id="CONSTRUCTOR_BODY" baseLocation="CONSTRUCTOR" |
|
172 location="region(Generated Contents)"> |
|
173 </defineLocation> |
|
174 |
|
175 <template location="CONSTRUCTOR_BODY"/> |
|
176 |
|
177 <defineLocation id="DESTRUCTOR" baseLocation="MAIN_FILE" |
|
178 owned="false" |
|
179 location="function(${className}::~${className}())"> |
|
180 <template><![CDATA[ |
|
181 /** |
|
182 * The appui's destructor removes the container from the control |
|
183 * stack and destroys it. |
|
184 */ |
|
185 ${className}::~${className}() |
|
186 { |
|
187 } |
|
188 ]]> |
|
189 </template> |
|
190 </defineLocation> |
|
191 |
|
192 <template location="DESTRUCTOR"/> |
|
193 |
|
194 <defineLocation id="DESTRUCTOR_BODY" baseLocation="DESTRUCTOR" |
|
195 location="region(Generated Contents)"> |
|
196 </defineLocation> |
|
197 |
|
198 <template location="DESTRUCTOR_BODY"/> |
|
199 |
|
200 <defineLocation id="CONSTRUCTL_METHOD" baseLocation="MAIN_FILE" |
|
201 owned="false" |
|
202 location="function(${className}::ConstructL())"> |
|
203 <template><![CDATA[ |
|
204 /** |
|
205 * @brief Completes the second phase of Symbian object construction. |
|
206 * Put initialization code that could leave here. |
|
207 */ |
|
208 void ${className}::ConstructL() |
|
209 { |
|
210 } |
|
211 ]]> |
|
212 </template> |
|
213 </defineLocation> |
|
214 |
|
215 <template location="CONSTRUCTL_METHOD"/> |
|
216 |
|
217 <defineLocation id="CONSTRUCTL_BODY" baseLocation="CONSTRUCTL_METHOD" |
|
218 location="region(Generated Contents)"> |
|
219 </defineLocation> |
|
220 |
|
221 <template id="MakeConstructL" location="CONSTRUCTL_BODY"><![CDATA[ |
|
222 <% var version = getComponentVersions(); |
|
223 if (version.major < 3 || (version.major == 3 && version.minor < 2)) { %> |
|
224 BaseConstructL(${(properties.skinsSupported ? " EAknEnableSkin " : "")}); |
|
225 <% } else { %> |
|
226 BaseConstructL(${(properties.skinsSupported ? " EAknEnableSkin " : "")}<% %>${(properties.skinsSupported && properties.enableMSK ? " | " : "")} |
|
227 ${(properties.enableMSK ? " EAknEnableMSK " : "")}); |
|
228 <% } |
|
229 // In 2.x, this flag is false. |
|
230 // In 2.8, the default is true but may be false. |
|
231 // In 3.0, the default is true and must remain so. |
|
232 if (version.major == 2 && version.minor == 8 && !properties.layoutAware) { %> |
|
233 SetLayoutAwareApp( false ); |
|
234 <% } |
|
235 if (properties.orientation && properties.orientation != "EAppUiOrientationUnspecified") { |
|
236 %>SetOrientationL( ${properties.orientation} ); |
|
237 <% } |
|
238 var event = instance.events['viewEvent']; |
|
239 if (event) { %> |
|
240 // Enable support for view events. They will be dispatched to ${event.handlerName}() |
|
241 AddViewObserverL( this ); |
|
242 <% } %>InitializeContainersL(); |
|
243 ]]> </template> |
|
244 |
|
245 |
|
246 <defineLocation id="INIT_CONTAINERSL" baseLocation="MAIN_FILE" |
|
247 owned="true" |
|
248 location="function(${className}::InitializeContainersL())"> |
|
249 <template><![CDATA[ |
|
250 void ${className}::InitializeContainersL() |
|
251 { |
|
252 } |
|
253 ]]> </template> |
|
254 </defineLocation> |
|
255 |
|
256 <template location="INIT_CONTAINERSL"/> |
|
257 |
|
258 <defineLocation id="HANDLECOMMANDL_METHOD" baseLocation="MAIN_FILE" |
|
259 owned="false" |
|
260 location="function(${className}::HandleCommandL(TInt))"> |
|
261 <template><![CDATA[ |
|
262 /** |
|
263 * Handle a command for this appui (override) |
|
264 * @param aCommand command id to be handled |
|
265 */ |
|
266 void ${className}::HandleCommandL( TInt aCommand ) |
|
267 { |
|
268 } |
|
269 ]]> |
|
270 </template> |
|
271 </defineLocation> |
|
272 |
|
273 <template location="HANDLECOMMANDL_METHOD"/> |
|
274 |
|
275 <defineLocation id="HANDLECOMMANDL_BODY" baseLocation="HANDLECOMMANDL_METHOD" |
|
276 owned="true" |
|
277 location="region(Generated Code)"> |
|
278 </defineLocation> |
|
279 |
|
280 <template location="HANDLECOMMANDL_BODY" id="GenerateHandleCommandBody"><![CDATA[ |
|
281 TBool commandHandled = EFalse; |
|
282 switch ( aCommand ) |
|
283 { // code to dispatch to the AppUi's menu and CBA commands is generated here |
|
284 <% var handlerContribs = Engine.generateChildContributions("HandleCommandSwitchDispatch"); |
|
285 // resolve the contents for switch to this method |
|
286 var switchContribs = Engine.getContributionsForPhase(handlerContribs, "SwitchContents"); |
|
287 Engine.assignLocationsForPhase(switchContribs, "SwitchContents", "HANDLECOMMANDL_BODY") |
|
288 contribs.addAll(switchContribs); |
|
289 handlerContribs.removeAll(switchContribs); |
|
290 %> default: |
|
291 break; |
|
292 } |
|
293 |
|
294 <% // Handle any leftover handler contribs that occur after the switch here. |
|
295 var postSwitchContribs = Engine.getContributionsForPhase(handlerContribs, "PostSwitchContents"); |
|
296 handlerContribs.removeAll(postSwitchContribs); |
|
297 Engine.assignLocationsForPhase(postSwitchContribs, "PostSwitchContents", "HANDLECOMMANDL_BODY") |
|
298 contribs.addAll(postSwitchContribs); |
|
299 |
|
300 // add the rest, which presumably point to other locations |
|
301 contribs.addAll(handlerContribs); %> |
|
302 if ( !commandHandled ) |
|
303 {<% |
|
304 var event = instance.events['handleCommand']; |
|
305 if (event) { |
|
306 %> // dispatch to ${event.eventName} handler |
|
307 commandHandled = ${event.handlerName}( aCommand ); |
|
308 if ( !commandHandled ) |
|
309 { |
|
310 if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit ) |
|
311 { |
|
312 Exit(); |
|
313 } |
|
314 }<% } else { %> |
|
315 if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit ) |
|
316 { |
|
317 Exit(); |
|
318 } |
|
319 <% } |
|
320 %> } |
|
321 ]]> </template> |
|
322 |
|
323 <defineLocation id="HANDLERESOURCECHANGEL_METHOD" baseLocation="MAIN_FILE" |
|
324 owned="false" |
|
325 location="function(${handlerClassName}::HandleResourceChangeL(TInt))"> |
|
326 <template><![CDATA[ |
|
327 /** |
|
328 * Override of the HandleResourceChangeL virtual function |
|
329 */ |
|
330 void ${handlerClassName}::HandleResourceChangeL( TInt aType ) |
|
331 { |
|
332 ${instance.attributes["base-appui-class"]}::HandleResourceChangeL( aType ); |
|
333 } |
|
334 ]]> |
|
335 </template> |
|
336 </defineLocation> |
|
337 |
|
338 <template location="HANDLERESOURCECHANGEL_METHOD"/> |
|
339 |
|
340 <defineLocation id="HANDLERESOURCECHANGEL_BODY" baseLocation="HANDLERESOURCECHANGEL_METHOD" |
|
341 owned="true" |
|
342 location="region(Generated Code)"> |
|
343 </defineLocation> |
|
344 |
|
345 <template location="HANDLERESOURCECHANGEL_BODY"/> |
|
346 |
|
347 |
|
348 <!-- BEGIN EVENT handleKeyEvent --> |
|
349 <templateGroup id="GenerateHandleKeyEventHandler" ifEvents="handleKeyEvent"> |
|
350 |
|
351 <template id="OverrideDecl" phase="OverriddenMethods"><![CDATA[ |
|
352 TKeyResponse HandleKeyEventL( |
|
353 const TKeyEvent& aKeyEvent, |
|
354 TEventCode aType ); |
|
355 ]]> </template> |
|
356 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
357 TKeyResponse ${event.handlerName}( |
|
358 const TKeyEvent& aKeyEvent, |
|
359 TEventCode aType ); |
|
360 ]]> </template> |
|
361 |
|
362 <defineLocation id="KeyEventOverride_Method" baseLocation="MAIN_FILE" |
|
363 owned="false" |
|
364 location="function(${handlerClassName}::HandleKeyEventL(const TKeyEvent&,TEventCode))"> |
|
365 <template><![CDATA[ |
|
366 /** |
|
367 * Override of the HandleKeyEventL virtual function |
|
368 * @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not |
|
369 */ |
|
370 TKeyResponse ${handlerClassName}::HandleKeyEventL( |
|
371 const TKeyEvent& aKeyEvent, |
|
372 TEventCode aType ) |
|
373 { |
|
374 // The inherited HandleKeyEventL is private and cannot be called |
|
375 } |
|
376 ]]> |
|
377 </template> |
|
378 </defineLocation> |
|
379 |
|
380 <template id="RealizeOverrideMethod" location="KeyEventOverride_Method"/> |
|
381 |
|
382 <defineLocation id="KeyEventOverride_Body" baseLocation="KeyEventOverride_Method" |
|
383 owned="true" |
|
384 location="region(Generated Code)"> |
|
385 </defineLocation> |
|
386 |
|
387 <template id="DispatchToHandler" location="KeyEventOverride_Body"><![CDATA[ |
|
388 if ( ${event.handlerName}( aKeyEvent, aType ) == EKeyWasConsumed ) |
|
389 { |
|
390 return EKeyWasConsumed; |
|
391 } |
|
392 ]]> </template> |
|
393 |
|
394 <defineLocation id="KeyEventHandler" baseLocation="MAIN_FILE" |
|
395 owned="false" |
|
396 isEventHandler="true" |
|
397 location="function(${handlerClassName}::${event.handlerName}(const TKeyEvent&, TEventCode))"> |
|
398 <template><![CDATA[ |
|
399 /** |
|
400 * Handle the ${event.eventName} event. |
|
401 * @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not |
|
402 */ |
|
403 TKeyResponse ${handlerClassName}::${event.handlerName}( |
|
404 const TKeyEvent& /* aKeyEvent */, |
|
405 TEventCode /* aType */ ) |
|
406 { |
|
407 // TODO: implement ${event.eventName} event handler |
|
408 return EKeyWasNotConsumed; |
|
409 } |
|
410 ]]> |
|
411 </template> |
|
412 </defineLocation> |
|
413 |
|
414 <template id="RealizeHandler" location="KeyEventHandler"/> |
|
415 </templateGroup> |
|
416 <!-- END EVENT handleKeyEvent --> |
|
417 |
|
418 <!-- BEGIN EVENT handleCommand --> |
|
419 <templateGroup id="GenerateHandleCommandEventHandler" ifEvents="handleCommand"> |
|
420 |
|
421 <template id="1" phase="UserHandlers"> |
|
422 TBool ${event.handlerName}( TInt /* aCommand */); |
|
423 </template> |
|
424 |
|
425 <defineLocation id="CommandHandlerMethod" baseLocation="MAIN_FILE" |
|
426 owned="false" |
|
427 isEventHandler="true" |
|
428 location="function(${handlerClassName}::${event.handlerName}(TInt))"> |
|
429 <template><![CDATA[ |
|
430 /** |
|
431 * Handle the ${event.eventName} event. |
|
432 * @return ETrue if event was handled, EFalse if not |
|
433 */ |
|
434 TBool ${handlerClassName}::${event.handlerName}( TInt /* aCommand */) |
|
435 { |
|
436 // TODO: implement ${event.eventName} event handler |
|
437 return EFalse; |
|
438 } |
|
439 ]]> |
|
440 </template> |
|
441 </defineLocation> |
|
442 |
|
443 <template id="2" location="CommandHandlerMethod"/> |
|
444 </templateGroup> |
|
445 <!-- END EVENT handleCommand --> |
|
446 |
|
447 <!-- BEGIN EVENT foregroundEvent --> |
|
448 <templateGroup id="GenerateForegroundEventHandler" ifEvents="foregroundEvent"> |
|
449 |
|
450 <template id="OverrideDecl" phase="OverriddenMethods"><![CDATA[ |
|
451 void HandleForegroundEventL( TBool aForeground ); |
|
452 ]]> </template> |
|
453 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
454 void ${event.handlerName}( TBool aForeground ); |
|
455 ]]> </template> |
|
456 |
|
457 <defineLocation id="HandleForegroundOverride_Method" baseLocation="MAIN_FILE" |
|
458 owned="false" |
|
459 location="function(${handlerClassName}::HandleForegroundEventL(TBool))"> |
|
460 <template><![CDATA[ |
|
461 /** |
|
462 * Override of the HandleForegroundEventL virtual function |
|
463 */ |
|
464 void ${handlerClassName}::HandleForegroundEventL( TBool aForeground ) |
|
465 { |
|
466 ${instance.attributes["base-appui-class"]}::HandleForegroundEventL( aForeground ); |
|
467 } |
|
468 ]]> |
|
469 </template> |
|
470 </defineLocation> |
|
471 |
|
472 <template id="RealizeOverrideMethod" location="HandleForegroundOverride_Method"/> |
|
473 |
|
474 <defineLocation id="HandleForegroundOverride_Body" baseLocation="HandleForegroundOverride_Method" |
|
475 owned="true" |
|
476 location="region(Generated Code)"> |
|
477 </defineLocation> |
|
478 |
|
479 <template id="DispatchToHandler" location="HandleForegroundOverride_Body"><![CDATA[ |
|
480 ${event.handlerName}( aForeground ); |
|
481 ]]> </template> |
|
482 |
|
483 <defineLocation id="ForegroundEventHandler" baseLocation="MAIN_FILE" |
|
484 owned="false" |
|
485 isEventHandler="true" |
|
486 location="function(${handlerClassName}::${event.handlerName}(TBool))"> |
|
487 <template><![CDATA[ |
|
488 /** |
|
489 * Handle the ${event.eventName} event. |
|
490 */ |
|
491 void ${handlerClassName}::${event.handlerName}( TBool /* aForeground */ ) |
|
492 { |
|
493 // TODO: implement ${event.eventName} event handler |
|
494 } |
|
495 ]]> |
|
496 </template> |
|
497 </defineLocation> |
|
498 |
|
499 <template id="RealizeHandler" location="ForegroundEventHandler"/> |
|
500 </templateGroup> |
|
501 <!-- END EVENT foregroundEvent --> |
|
502 |
|
503 <!-- BEGIN EVENT switchOnEvent --> |
|
504 <templateGroup id="GenerateSwitchOnEventHandler" ifEvents="switchOnEvent"> |
|
505 |
|
506 <template id="OverrideDecl" phase="OverriddenMethods"><![CDATA[ |
|
507 void HandleSwitchOnEventL( CCoeControl* aDestination ); |
|
508 ]]> </template> |
|
509 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
510 void ${event.handlerName}(); |
|
511 ]]> </template> |
|
512 |
|
513 <defineLocation id="HandleSwitchOnOverride_Method" baseLocation="MAIN_FILE" |
|
514 owned="false" |
|
515 location="function(${handlerClassName}::HandleSwitchOnEventL(CCoeControl*))"> |
|
516 <template><![CDATA[ |
|
517 /** |
|
518 * Override of the HandleSwitchOnEventL virtual function |
|
519 */ |
|
520 void ${handlerClassName}::HandleSwitchOnEventL( CCoeControl* /* aDestination */ ) |
|
521 { |
|
522 // The inherited HandleSwitchOnEventL is private and cannot be called |
|
523 } |
|
524 ]]> |
|
525 </template> |
|
526 </defineLocation> |
|
527 |
|
528 <template id="RealizeOverrideMethod" location="HandleSwitchOnOverride_Method"/> |
|
529 |
|
530 <defineLocation id="HandleSwitchOnOverride_Body" baseLocation="HandleSwitchOnOverride_Method" |
|
531 owned="true" |
|
532 location="region(Generated Code)"> |
|
533 </defineLocation> |
|
534 |
|
535 <template id="DispatchToHandler" location="HandleSwitchOnOverride_Body"><![CDATA[ |
|
536 ${event.handlerName}(); |
|
537 ]]> </template> |
|
538 |
|
539 <defineLocation id="SwitchOnEventHandler" baseLocation="MAIN_FILE" |
|
540 owned="false" |
|
541 isEventHandler="true" |
|
542 location="function(${handlerClassName}::${event.handlerName}())"> |
|
543 <template><![CDATA[ |
|
544 /** |
|
545 * Handle the ${event.eventName} event. |
|
546 */ |
|
547 void ${handlerClassName}::${event.handlerName}() |
|
548 { |
|
549 // TODO: implement ${event.eventName} event handler |
|
550 } |
|
551 ]]> |
|
552 </template> |
|
553 </defineLocation> |
|
554 |
|
555 <template id="RealizeHandler" location="SwitchOnEventHandler"/> |
|
556 </templateGroup> |
|
557 <!-- END EVENT switchOnEvent --> |
|
558 |
|
559 <!-- BEGIN EVENT systemEvent --> |
|
560 <templateGroup id="GenerateSystemEventHandler" ifEvents="systemEvent"> |
|
561 |
|
562 <template id="OverrideDecl" phase="OverriddenMethods"><![CDATA[ |
|
563 void HandleSystemEventL( const TWsEvent& anEvent ); |
|
564 ]]> </template> |
|
565 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
566 void ${event.handlerName}( const TWsEvent& /* anEvent */); |
|
567 ]]> </template> |
|
568 |
|
569 <defineLocation id="HandleSystemOverride_Method" baseLocation="MAIN_FILE" |
|
570 owned="false" |
|
571 location="function(${handlerClassName}::HandleSystemEventL(const TWsEvent&))"> |
|
572 <template><![CDATA[ |
|
573 /** |
|
574 * Override of the HandleSystemEventL virtual function |
|
575 */ |
|
576 void ${handlerClassName}::HandleSystemEventL( const TWsEvent& anEvent ) |
|
577 { |
|
578 ${instance.attributes["base-appui-class"]}::HandleSystemEventL( anEvent ); |
|
579 } |
|
580 ]]> |
|
581 </template> |
|
582 </defineLocation> |
|
583 |
|
584 <template id="RealizeOverrideMethod" location="HandleSystemOverride_Method"/> |
|
585 |
|
586 <defineLocation id="HandleSystemOverride_Body" baseLocation="HandleSystemOverride_Method" |
|
587 owned="true" |
|
588 location="region(Generated Code)"> |
|
589 </defineLocation> |
|
590 |
|
591 <template id="DispatchToHandler" location="HandleSystemOverride_Body"><![CDATA[ |
|
592 ${event.handlerName}( anEvent ); |
|
593 ]]> </template> |
|
594 |
|
595 <defineLocation id="SystemEventHandler" baseLocation="MAIN_FILE" |
|
596 owned="false" |
|
597 isEventHandler="true" |
|
598 location="function(${handlerClassName}::${event.handlerName}(const TWsEvent&))"> |
|
599 <template><![CDATA[ |
|
600 /** |
|
601 * Handle the ${event.eventName} event. |
|
602 */ |
|
603 void ${handlerClassName}::${event.handlerName}( const TWsEvent& /* anEvent */ ) |
|
604 { |
|
605 // TODO: implement ${event.eventName} event handler |
|
606 } |
|
607 ]]> |
|
608 </template> |
|
609 </defineLocation> |
|
610 |
|
611 <template id="RealizeHandler" location="SystemEventHandler"/> |
|
612 </templateGroup> |
|
613 <!-- END EVENT systemEvent --> |
|
614 |
|
615 <!-- BEGIN EVENT applicationSpecificEvent --> |
|
616 <templateGroup id="GenerateApplicationSpecificEventHandler" ifEvents="applicationSpecificEvent"> |
|
617 |
|
618 <template id="OverrideDecl" phase="OverriddenMethods"><![CDATA[ |
|
619 void HandleApplicationSpecificEventL( |
|
620 TInt aType, |
|
621 const TWsEvent& anEvent ); |
|
622 ]]> </template> |
|
623 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
624 void ${event.handlerName}( |
|
625 TInt aType, |
|
626 const TWsEvent& anEvent ); |
|
627 ]]> </template> |
|
628 |
|
629 <defineLocation id="HandleApplicationSpecificOverride_Method" baseLocation="MAIN_FILE" |
|
630 owned="false" |
|
631 location="function(${handlerClassName}::HandleApplicationSpecificEventL(TInt, const TWsEvent&))"> |
|
632 <template><![CDATA[ |
|
633 /** |
|
634 * Override of the HandleApplicationSpecificEventL virtual function |
|
635 */ |
|
636 void ${handlerClassName}::HandleApplicationSpecificEventL( |
|
637 TInt aType, |
|
638 const TWsEvent& anEvent ) |
|
639 { |
|
640 ${instance.attributes["base-appui-class"]}::HandleApplicationSpecificEventL( aType, anEvent ); |
|
641 } |
|
642 ]]> |
|
643 </template> |
|
644 </defineLocation> |
|
645 |
|
646 <template id="RealizeOverrideMethod" location="HandleApplicationSpecificOverride_Method"/> |
|
647 |
|
648 <defineLocation id="HandleApplicationSpecificOverride_Body" baseLocation="HandleApplicationSpecificOverride_Method" |
|
649 owned="true" |
|
650 location="region(Generated Code)"> |
|
651 </defineLocation> |
|
652 |
|
653 <template id="DispatchToHandler" location="HandleApplicationSpecificOverride_Body"><![CDATA[ |
|
654 ${event.handlerName}( aType, anEvent ); |
|
655 ]]> </template> |
|
656 |
|
657 <defineLocation id="ApplicationSpecificEventHandler" baseLocation="MAIN_FILE" |
|
658 owned="false" |
|
659 isEventHandler="true" |
|
660 location="function(${handlerClassName}::${event.handlerName}(TInt, const TWsEvent&))"> |
|
661 <template><![CDATA[ |
|
662 /** |
|
663 * Handle the ${event.eventName} event. |
|
664 */ |
|
665 void ${handlerClassName}::${event.handlerName}( |
|
666 TInt /* aType */, |
|
667 const TWsEvent& /* anEvent */ ) |
|
668 { |
|
669 // TODO: implement ${event.eventName} event handler |
|
670 } |
|
671 ]]> |
|
672 </template> |
|
673 </defineLocation> |
|
674 |
|
675 <template id="RealizeHandler" location="ApplicationSpecificEventHandler"/> |
|
676 </templateGroup> |
|
677 <!-- END EVENT applicationSpecificEvent --> |
|
678 |
|
679 <!-- BEGIN EVENT handleStatusPaneSizeChanged --> |
|
680 <templateGroup id="GenerateHandleStatusPaneSizeChangeHandler" ifEvents="handleStatusPaneSizeChanged"> |
|
681 |
|
682 <template id="OverrideDecl" phase="OverriddenMethods"><![CDATA[ |
|
683 void HandleStatusPaneSizeChange(); |
|
684 ]]> </template> |
|
685 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
686 void ${event.handlerName}(); |
|
687 ]]> </template> |
|
688 |
|
689 <defineLocation id="HandleStatusPaneSizeChangeOverride_Method" baseLocation="MAIN_FILE" |
|
690 owned="false" |
|
691 location="function(${handlerClassName}::HandleStatusPaneSizeChange())"> |
|
692 <template><![CDATA[ |
|
693 /** |
|
694 * Override of the HandleStatusPaneSizeChange virtual function |
|
695 */ |
|
696 void ${handlerClassName}::HandleStatusPaneSizeChange() |
|
697 { |
|
698 ${instance.attributes["base-appui-class"]}::HandleStatusPaneSizeChange(); |
|
699 } |
|
700 ]]> |
|
701 </template> |
|
702 </defineLocation> |
|
703 |
|
704 <template id="RealizeOverrideMethod" location="HandleStatusPaneSizeChangeOverride_Method"/> |
|
705 |
|
706 <defineLocation id="HandleStatusPaneSizeChangedOverride_Body" baseLocation="HandleStatusPaneSizeChangeOverride_Method" |
|
707 owned="true" |
|
708 location="region(Generated Code)"> |
|
709 </defineLocation> |
|
710 |
|
711 <template id="DispatchToHandler" location="HandleStatusPaneSizeChangedOverride_Body"><![CDATA[ |
|
712 ${event.handlerName}(); |
|
713 ]]> </template> |
|
714 |
|
715 <defineLocation id="HandleStatusPaneSizeChangeHandler" baseLocation="MAIN_FILE" |
|
716 owned="false" |
|
717 isEventHandler="true" |
|
718 location="function(${handlerClassName}::${event.handlerName}())"> |
|
719 <template><![CDATA[ |
|
720 /** |
|
721 * Handle the ${event.eventName} event. |
|
722 */ |
|
723 void ${handlerClassName}::${event.handlerName}() |
|
724 { |
|
725 // TODO: implement ${event.eventName} event handler |
|
726 } |
|
727 ]]> |
|
728 </template> |
|
729 </defineLocation> |
|
730 |
|
731 <template id="RealizeHandler" location="HandleStatusPaneSizeChangeHandler"/> |
|
732 </templateGroup> |
|
733 <!-- END EVENT handleStatusPaneSizeChanged --> |
|
734 |
|
735 <!-- BEGIN EVENT viewEvent --> |
|
736 <templateGroup id="GenerateViewEventHandler" ifEvents="viewEvent"> |
|
737 |
|
738 <template id="BaseDecl" phase="BaseClassList">,public MCoeViewObserver</template> |
|
739 |
|
740 <template id="OverrideDecl" phase="OverriddenMethods"><![CDATA[ |
|
741 void HandleViewEventL( const TVwsViewEvent& anEvent ); |
|
742 ]]> </template> |
|
743 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
744 void ${event.handlerName}( const TVwsViewEvent& /* anEvent */); |
|
745 ]]> </template> |
|
746 |
|
747 <defineLocation id="HandleViewEventOverride_Method" baseLocation="MAIN_FILE" |
|
748 owned="false" |
|
749 location="function(${handlerClassName}::HandleViewEventL(const TVwsViewEvent&))"> |
|
750 <template><![CDATA[ |
|
751 /** |
|
752 * Override of the HandleViewEventL virtual function |
|
753 */ |
|
754 void ${handlerClassName}::HandleViewEventL( const TVwsViewEvent& anEvent ) |
|
755 { |
|
756 } |
|
757 ]]> |
|
758 </template> |
|
759 </defineLocation> |
|
760 |
|
761 <template id="RealizeOverrideMethod" location="HandleViewEventOverride_Method"/> |
|
762 |
|
763 <defineLocation id="HandleViewEventOverride_Body" baseLocation="HandleViewEventOverride_Method" |
|
764 owned="true" |
|
765 location="region(Generated Code)"> |
|
766 </defineLocation> |
|
767 |
|
768 <template id="DispatchToHandler" location="HandleViewEventOverride_Body"><![CDATA[ |
|
769 ${event.handlerName}( anEvent ); |
|
770 ]]> </template> |
|
771 |
|
772 <defineLocation id="HandleViewEventHandler" baseLocation="MAIN_FILE" |
|
773 owned="false" |
|
774 isEventHandler="true" |
|
775 location="function(${handlerClassName}::${event.handlerName}(const TVwsViewEvent&))"> |
|
776 <template><![CDATA[ |
|
777 /** |
|
778 * Handle the ${event.eventName} event. |
|
779 */ |
|
780 void ${handlerClassName}::${event.handlerName}( const TVwsViewEvent& /* anEvent */) |
|
781 { |
|
782 // TODO: implement ${event.eventName} event handler |
|
783 } |
|
784 ]]> |
|
785 </template> |
|
786 </defineLocation> |
|
787 |
|
788 <template id="RealizeHandler" location="HandleViewEventHandler"/> |
|
789 </templateGroup> |
|
790 <!-- END EVENT viewEvent --> |
|
791 |
|
792 <!-- BEGIN EVENT initializeMenuPane --> |
|
793 <templateGroup id="GenerateInitMenuPaneHandler" ifEvents="initializeMenuPane"> |
|
794 |
|
795 <template id="OverrideDecl" phase="OverriddenMethods"><![CDATA[ |
|
796 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
797 ]]> </template> |
|
798 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
799 void ${event.handlerName}( TInt aResourceId , CEikMenuPane* aMenuPane ); |
|
800 ]]> </template> |
|
801 |
|
802 <defineLocation id="InitMenuPaneOverride_Method" baseLocation="MAIN_FILE" |
|
803 owned="false" |
|
804 location="function(${handlerClassName}::DynInitMenuPaneL(TInt, CEikMenuPane*))"> |
|
805 <template><![CDATA[ |
|
806 /** |
|
807 * Override of the DynInitMenuPaneL virtual function |
|
808 */ |
|
809 void ${handlerClassName}::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) |
|
810 { |
|
811 ${instance.attributes["base-appui-class"]}::DynInitMenuPaneL( aResourceId, aMenuPane ); |
|
812 } |
|
813 ]]> |
|
814 </template> |
|
815 </defineLocation> |
|
816 |
|
817 <template id="RealizeOverrideMethod" location="InitMenuPaneOverride_Method"/> |
|
818 |
|
819 <defineLocation id="InitMenuPaneOverride_Body" baseLocation="InitMenuPaneOverride_Method" |
|
820 owned="true" |
|
821 location="region(Generated Code)"> |
|
822 </defineLocation> |
|
823 |
|
824 <template id="DispatchToHandler" location="InitMenuPaneOverride_Body"><![CDATA[ |
|
825 ${event.handlerName}( aResourceId, aMenuPane ); |
|
826 ]]> </template> |
|
827 |
|
828 <defineLocation id="InitMenuPaneHandler" baseLocation="MAIN_FILE" |
|
829 owned="false" |
|
830 isEventHandler="true" |
|
831 location="function(${handlerClassName}::${event.handlerName}(TInt, CEikMenuPane*))"> |
|
832 <template><![CDATA[ |
|
833 /** |
|
834 * Handle the ${event.eventName} event. |
|
835 */ |
|
836 void ${handlerClassName}::${event.handlerName}( |
|
837 TInt /* aResourceId */, |
|
838 CEikMenuPane* /* aMenuPane */ ) |
|
839 { |
|
840 // TODO: implement ${event.eventName} event handler |
|
841 } |
|
842 ]]> |
|
843 </template> |
|
844 </defineLocation> |
|
845 |
|
846 <template id="RealizeHandler" location="InitMenuPaneHandler"/> |
|
847 </templateGroup> |
|
848 <!-- END EVENT initializeMenuPane --> |
|
849 |
|
850 <!-- BEGIN EVENT offerKeyToApp --> |
|
851 <templateGroup id="GenerateOfferKeyToAppHandler" ifEvents="offerKeyToApp"> |
|
852 |
|
853 <template id="OverrideDecl" phase="OverriddenMethods"><![CDATA[ |
|
854 void OfferKeyToAppL( |
|
855 const TKeyEvent& aKeyEvent, |
|
856 TEventCode aType ); |
|
857 ]]> </template> |
|
858 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
859 void ${event.handlerName}( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
860 ]]> </template> |
|
861 |
|
862 <defineLocation id="OfferKeyToAppOverride_Method" baseLocation="MAIN_FILE" |
|
863 owned="false" |
|
864 location="function(${handlerClassName}::OfferKeyToAppL(const TKeyEvent&, TEventCode))"> |
|
865 <template><![CDATA[ |
|
866 /** |
|
867 * Override of the OfferKeyToAppL virtual function |
|
868 */ |
|
869 void ${handlerClassName}::OfferKeyToAppL( |
|
870 const TKeyEvent& aKeyEvent, |
|
871 TEventCode aType ) |
|
872 { |
|
873 } |
|
874 ]]> |
|
875 </template> |
|
876 </defineLocation> |
|
877 |
|
878 <template id="RealizeOverrideMethod" location="OfferKeyToAppOverride_Method"/> |
|
879 |
|
880 <defineLocation id="OfferKeyToAppOverride_Body" baseLocation="OfferKeyToAppOverride_Method" |
|
881 owned="true" |
|
882 location="region(Generated Code)"> |
|
883 </defineLocation> |
|
884 |
|
885 <template id="DispatchToHandler" location="OfferKeyToAppOverride_Body"><![CDATA[ |
|
886 ${event.handlerName}( aKeyEvent, aType ); |
|
887 ]]> </template> |
|
888 |
|
889 <defineLocation id="OfferKeyEventHandler" baseLocation="MAIN_FILE" |
|
890 owned="false" |
|
891 isEventHandler="true" |
|
892 location="function(${handlerClassName}::${event.handlerName}(const TKeyEvent&,TEventCode))"> |
|
893 <template><![CDATA[ |
|
894 /** |
|
895 * Handle the ${event.eventName} event. |
|
896 */ |
|
897 void ${handlerClassName}::${event.handlerName}( |
|
898 const TKeyEvent& /* aKeyEvent */, |
|
899 TEventCode /* aType */ ) |
|
900 { |
|
901 // TODO: implement ${event.eventName} event handler |
|
902 } |
|
903 ]]> |
|
904 </template> |
|
905 </defineLocation> |
|
906 |
|
907 <template id="RealizeHandler" location="OfferKeyEventHandler"/> |
|
908 </templateGroup> |
|
909 <!-- END EVENT offerKeyToApp --> |
|
910 |
|
911 <!-- BEGIN EVENT handleResourceChanged --> |
|
912 <templateGroup id="GenerateHandleResourceChangeHandler" ifEvents="handleResourceChanged"> |
|
913 |
|
914 <!-- API overrides above --> |
|
915 <template id="HandlerDecl" phase="UserHandlers"><![CDATA[ |
|
916 void ${event.handlerName}(); |
|
917 ]]> </template> |
|
918 |
|
919 <template id="DispatchToHandler" location="HANDLERESOURCECHANGEL_BODY"><![CDATA[ |
|
920 ${event.handlerName}(); |
|
921 ]]> </template> |
|
922 |
|
923 <defineLocation id="HandleResourceChangeHandler" baseLocation="MAIN_FILE" |
|
924 owned="false" |
|
925 isEventHandler="true" |
|
926 location="function(${handlerClassName}::${event.handlerName}())"> |
|
927 <template><![CDATA[ |
|
928 /** |
|
929 * Handle the ${event.eventName} event. |
|
930 */ |
|
931 void ${handlerClassName}::${event.handlerName}() |
|
932 { |
|
933 // TODO: implement ${event.eventName} event handler |
|
934 } |
|
935 ]]> |
|
936 </template> |
|
937 </defineLocation> |
|
938 |
|
939 <template id="RealizeHandler" location="HandleResourceChangeHandler"/> |
|
940 </templateGroup> |
|
941 <!-- END EVENT handleResourceChanged --> |
|
942 |
|
943 <!-- our contributions --> |
|
944 |
|
945 <inline scope="prototype"> |
|
946 include("../containers/containerLibrary.js") |
|
947 include("../cba/cbaLibrary.js") |
|
948 </inline> |
|
949 |
|
950 <inline> |
|
951 this.getHrhFiles(contribs); |
|
952 </inline> |
|
953 |
|
954 <inline scope="prototype"><![CDATA[ |
|
955 ${jsObject}.prototype.getViewContribs = function(contribs, instance) { |
|
956 // gather contributions from views |
|
957 for (i in instance.children) { |
|
958 var view = instance.children[i]; |
|
959 if (view.isInstanceOf("com.nokia.sdt.series60.DesignReference") |
|
960 && (instance.properties.initialDesign == view.name)) { |
|
961 var viewContribs = Engine.generateViewContributions(view.properties.filePath, "RootAppUi"); |
|
962 if (viewContribs != null) |
|
963 contribs.addAll(viewContribs); |
|
964 } |
|
965 } |
|
966 } |
|
967 ]]> </inline> |
|
968 |
|
969 <inline scope="prototype"><![CDATA[ |
|
970 ${jsObject}.prototype.finalizeContribs = function(contribs) { |
|
971 // fix up the phases so they point to real locations |
|
972 Engine.assignLocationsForPhase(contribs, "ClassSource", "MAIN_FILE"); |
|
973 Engine.assignLocationsForPhase(contribs, "ClassHeader", "HEADER_FILE"); |
|
974 |
|
975 Engine.assignLocationsForPhase(contribs, "MainConstants", "CONSTANTS"); |
|
976 Engine.assignLocationsForPhase(contribs, "MainSystemIncludes", "MAIN_SYSTEM_INCLUDES"); |
|
977 Engine.assignLocationsForPhase(contribs, "MainUserIncludes", "MAIN_USER_INCLUDES"); |
|
978 Engine.assignLocationsForPhase(contribs, "Construct", "CONSTRUCTOR_BODY"); |
|
979 Engine.assignLocationsForPhase(contribs, "Destroy", "DESTRUCTOR_BODY"); |
|
980 Engine.assignLocationsForPhase(contribs, "Initialize", "INIT_CONTAINERSL"); |
|
981 Engine.assignLocationsForPhase(contribs, "HeaderIncludes", "HEADER_INCLUDES"); |
|
982 Engine.assignLocationsForPhase(contribs, "ForwardDeclarations", "FORWARD_DECLARATIONS"); |
|
983 Engine.assignLocationsForPhase(contribs, "BaseClassList", "BASE_CLASS_LIST"); |
|
984 Engine.assignLocationsForPhase(contribs, "InstanceVariables", "CLASS_IVARS"); |
|
985 Engine.assignLocationsForPhase(contribs, "ClassMethods", "CLASS_METHODS"); |
|
986 Engine.assignLocationsForPhase(contribs, "UserHandlers", "CLASS_USERHANDLERS"); |
|
987 Engine.assignLocationsForPhase(contribs, "OverriddenMethods", "CLASS_OVERRIDES"); |
|
988 |
|
989 Engine.assignLocationsForPhase(contribs, "HandleResourceChange", "HANDLERESOURCECHANGEL_BODY"); |
|
990 |
|
991 //Engine.removeDuplicateContributionsForLocation(contribs, "MAIN_SYSTEM_INCLUDES"); |
|
992 //Engine.removeDuplicateContributionsForLocation(contribs, "MAIN_USER_INCLUDES"); |
|
993 //Engine.removeDuplicateContributionsForLocation(contribs, "HEADER_INCLUDES"); |
|
994 } |
|
995 ]]> </inline> |
|
996 |
|
997 <inline scope="prototype"><![CDATA[ |
|
998 ${jsObject}.prototype.getChildContribs = function(contribs, form) { |
|
999 // iterate children |
|
1000 contribs.addAll(Engine.generateChildContributions(form)); |
|
1001 |
|
1002 // delete contributions for the status pane, since we initialize these with resources |
|
1003 Engine.removeContributionsForPhase(contribs, "SetupStatusPane"); |
|
1004 Engine.removeContributionsForPhase(contribs, "CleanupStatusPane"); |
|
1005 } |
|
1006 ]]> </inline> |
|
1007 |
|
1008 <inline> |
|
1009 |
|
1010 this.getChildContribs(contribs, form); |
|
1011 |
|
1012 this.getViewContribs(contribs, instance); |
|
1013 |
|
1014 this.finalizeContribs(contribs); |
|
1015 |
|
1016 </inline> |
|
1017 |
|
1018 <template id="IncludeRsgFile" location="MAIN_SYSTEM_INCLUDES"><![CDATA[ |
|
1019 #include <${resourceFileNameBase}.rsg> |
|
1020 ]]> </template> |
|
1021 |
|
1022 <!-- contributions as child (to CAknDocument) --> |
|
1023 |
|
1024 <template phase="MainUserIncludes"> |
|
1025 #include "${instanceName}.h" |
|
1026 </template> |
|
1027 |
|
1028 <template phase="CreateAppUiL"> |
|
1029 return new ( ELeave ) ${className}; |
|
1030 </template> |
|
1031 |