uidesigner/com.nokia.sdt.series60.componentlibrary/components/transient/CAknPreviewPopUp.component
changeset 0 fb279309251b
equal deleted inserted replaced
-1:000000000000 0:fb279309251b
       
     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:ecore="http://www.eclipse.org/emf/2002/Ecore" 
       
    11 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
       
    12 	
       
    13 	<component baseComponent="com.nokia.sdt.series60.CommonBase" 
       
    14 			friendlyName="%friendlyName" 
       
    15 			qualifiedName="com.nokia.sdt.series60.CAknPreviewPopUp" 
       
    16 			category="NotesDialogs"
       
    17 			instanceNameRoot="previewPopUp"
       
    18 			version="1.0">
       
    19 		<documentation>
       
    20 			<information>%information</information>
       
    21 		</documentation>
       
    22 		<symbian sdkName="com.nokia.series60" minSDKVersion="3.2" 
       
    23 			className="CAknPreviewPopUpController" classHelpTopic="" />
       
    24 		<designerImages 
       
    25 			smallIconFile="CAknPreviewPopUp_sm.png" 
       
    26 			largeIconFile="CAknPreviewPopUp.png"/>
       
    27 		<attributes>
       
    28 			<attribute key="is-non-layout-object">true</attribute>
       
    29 			<attribute key="is-transient-object">true</attribute>
       
    30 			<attribute key="is-layout-object">true</attribute>
       
    31 			<attribute key="is-layout-container">true</attribute>
       
    32 			<attribute key="event-handler-target">true</attribute>
       
    33 		</attributes>
       
    34 		
       
    35 		<properties>
       
    36 			<property category="Hidden" name="className" type="string" readOnly="true"/>
       
    37 			<compoundProperty category="Hidden" name="location" type="com.nokia.sdt.series60.locationProperty" 
       
    38 				editorClass="com.nokia.sdt.symbian.ui.editors.ReadOnlySummaryEditorFactory" readOnly="true"/>
       
    39 			<compoundProperty category="Layout" name="size" type="com.nokia.sdt.series60.sizeProperty" 
       
    40 				editorClass="com.nokia.sdt.symbian.ui.editors.ReadOnlySummaryEditorFactory" readOnly="true"
       
    41 				descriptionKey="sizeDescription"/>
       
    42 			<property category="Appearance" name="backColor" displayName="%backColor" type="string" 
       
    43 				editorClass="com.nokia.sdt.symbian.ui.editors.RGBEditorFactoryWithSystemColorCombo"
       
    44 				descriptionKey="backColorDescription" />
       
    45 			<property category="Behavior" name="asynchronous"
       
    46 				descriptionKey="asynchronousDescription"
       
    47 				type="boolean"
       
    48 				default="true" />
       
    49 			<property category="Flags" name="ELayoutDefault"
       
    50 				descriptionKey="ELayoutDefaultDescription"
       
    51 				type="boolean"
       
    52 				default="false" />
       
    53 			<property category="Flags" name="ELayoutSubMenu"
       
    54 				descriptionKey="ELayoutSubMenuDescription"
       
    55 				type="boolean"
       
    56 				default="false" />
       
    57 			<property category="Flags" name="EPermanentMode"
       
    58 				descriptionKey="EPermanentModeDescription"
       
    59 				type="boolean"
       
    60 				default="false" />
       
    61 			<property category="Flags" name="EFixedMode"
       
    62 				descriptionKey="EFixedModeDescription"
       
    63 				type="boolean"
       
    64 				default="false" />
       
    65 			<property category="Flags" name="EExcludeFrames"
       
    66 				descriptionKey="EExcludeFramesDescription"
       
    67 				type="boolean"
       
    68 				default="false" />
       
    69 			<property category="Behavior" name="showDelay"
       
    70 				descriptionKey="showDelayDescription"
       
    71 				type="float"
       
    72 				default="1.0" minValue="0" maxValue="2147.0" />
       
    73 			<property category="Behavior" name="hideDelay"
       
    74 				descriptionKey="hideDelayDescription"
       
    75 				type="float"
       
    76 				default="3.0" minValue="0" maxValue="2147.0" />
       
    77 			<property category="Data" name="headingText" type="localizedString" 
       
    78 				default="" descriptionKey="headingTextDescription"
       
    79 				editorClass="com.nokia.sdt.symbian.ui.editors.ScalableTextEditorFactory" />
       
    80 		</properties>
       
    81 
       
    82 		<events>
       
    83 			<event name="resourceChanged" category="Content" 
       
    84 					group="CAknPreviewPopUp"
       
    85 					handlerNameTemplate="Handle{title(name)}ResourceChanged"
       
    86 					descriptionKey="resourceChangedDescription"
       
    87 				/>
       
    88 			<event name="sizeChanged" category="Content" 
       
    89 					group="CAknPreviewPopUp"
       
    90 					descriptionKey="sizeChangedDescription"
       
    91 					handlerNameTemplate="Handle{title(name)}SizeChanged"
       
    92 				/>
       
    93 			<event name="draw" category="Content" 
       
    94 					group="CAknPreviewPopUp"
       
    95 					handlerNameTemplate="Handle{title(name)}Draw"
       
    96 					descriptionKey="drawDescription"
       
    97 				/>
       
    98 			<event name="positionChanged" category="Content" 
       
    99 					group="CAknPreviewPopUp"
       
   100 					handlerNameTemplate="Handle{title(name)}PositionChanged"
       
   101 					descriptionKey="positionChangedDescription"
       
   102 				/>
       
   103 			<event name="handlePointerEvent" category="Content" 
       
   104 					group="CAknPreviewPopUp"
       
   105 					handlerNameTemplate="Handle{title(name)}PointerEventL"
       
   106 					descriptionKey="handlePointerEventDescription"
       
   107 				/>
       
   108 			<event name="handleLongTapEvent" category="Content" 
       
   109 					group="CAknPreviewPopUp"
       
   110 					handlerNameTemplate="Handle{title(name)}LongTapEventL"
       
   111 					descriptionKey="handleLongTapEventDescription"
       
   112 				/>
       
   113 			<event name="previewPopUpShown" category="Observer" 
       
   114 					group="CAknPreviewPopUp"
       
   115 					handlerNameTemplate="Handle{title(name)}PreviewPopUpShownL"
       
   116 					descriptionKey="previewPopUpShownDescription"
       
   117 				/>
       
   118 			<event name="previewPopUpHidden" category="Observer" 
       
   119 					group="CAknPreviewPopUp"
       
   120 					handlerNameTemplate="Handle{title(name)}PreviewPopUpHiddenL"
       
   121 					descriptionKey="previewPopUpHiddenDescription"
       
   122 				/>
       
   123 		</events>
       
   124 
       
   125 		<implementations>
       
   126 			<implementation>
       
   127 				<interface id="com.nokia.sdt.datamodel.adapter.IVisualAppearance"/>
       
   128 				<interface id="com.nokia.sdt.datamodel.adapter.IDirectLabelEdit"/>
       
   129 				<interface id="com.nokia.sdt.datamodel.adapter.ILayout"/>
       
   130 				<script file="CAknPreviewPopUp.js" prototype="CAknPreviewPopUpVisual"/>
       
   131 			</implementation>
       
   132 			<implementation>
       
   133 				<interface id="com.nokia.sdt.datamodel.adapter.IQueryContainment"/>
       
   134 				<script file="CAknPreviewPopUp.js" prototype="CAknPreviewPopUpContainment"/>
       
   135 			</implementation>
       
   136 			<implementation>
       
   137 				<interface id="com.nokia.sdt.datamodel.adapter.IInitializer"/>
       
   138 				<interface id="com.nokia.sdt.datamodel.adapter.IComponentInstancePropertyListener"/>
       
   139 				<script file="CAknPreviewPopUp.js" prototype="CAknPreviewPopUpInit"/>
       
   140 			</implementation>
       
   141 			<implementation>
       
   142 				<interface id="com.nokia.sdt.datamodel.adapter.IComponentEventInfo"/>
       
   143 				<script file="CAknPreviewPopUp.js" prototype="CAknPreviewPopUpEventInfo"/>
       
   144 			</implementation>
       
   145 		</implementations>
       
   146 
       
   147 		<sourceMapping>
       
   148 			<select property="headingText">
       
   149 				<choice value="">
       
   150 				</choice>
       
   151 				<choice>
       
   152 					<mapResource struct="TBUF" headers="eikon.rh" id="headingText">
       
   153 						<mapSimpleMember property="headingText" member="buf" />
       
   154 					</mapResource>
       
   155 				</choice>
       
   156 			</select>
       
   157 		</sourceMapping>
       
   158 
       
   159 		<sourceGen>
       
   160 		
       
   161 			<expandMacro name="HeaderFileTemplate"
       
   162 				LocationPrefix="CONTENT_HEADER">
       
   163 				<expandArgument name="InitialOwnedSystemIncludesContent"><![CDATA[
       
   164 #include <coecntrl.h>		
       
   165 #include <aknpreviewpopupcontentprovider.h>
       
   166 				]]></expandArgument>
       
   167 				<expandArgument name="InitialOwnedForwardDeclarationsContent"><![CDATA[
       
   168 class MEikCommandObserver;		
       
   169 class CAknPreviewPopUpController;
       
   170 				]]></expandArgument>
       
   171 			</expandMacro>
       
   172 
       
   173 			<template id="IncludeRsgFile" location="CONTENT_MAIN_OWNED_SYSTEM_INCLUDES"><![CDATA[
       
   174 <% if (resourceFileNameBase != null) {%>#include <${resourceFileNameBase}.rsg>
       
   175 <% } %>]]></template>
       
   176 		
       
   177 			<expandMacro name="SourceFileTemplate"
       
   178 				LocationPrefix="CONTENT_MAIN">
       
   179 				<expandArgument name="InitialSystemIncludesContent"><![CDATA[
       
   180 #include <eikcmobs.h>
       
   181 #include <aknpreviewpopupcontroller.h>
       
   182 				]]></expandArgument>
       
   183 			</expandMacro>
       
   184 			
       
   185 			<expandMacro name="ClassTemplate"
       
   186 				LocationPrefix="CONTENT_"
       
   187 				BaseLocation="CONTENT_HEADER_FILE"
       
   188 				BaseClassName="CCoeControl"
       
   189 				ExtraBaseClasses="public MAknPreviewPopUpContentProvider">
       
   190 				<expandArgument name="ClassComment">
       
   191 /**
       
   192  * Content class for ${instanceName}.
       
   193  * @class	${className} ${instanceName$title}.h
       
   194  */
       
   195 				</expandArgument>
       
   196 				<expandArgument name="InitialPrivateTailContent">
       
   197 MEikCommandObserver* iCommandObserver;
       
   198 CAknPreviewPopUpController* iController;
       
   199 				</expandArgument>
       
   200 			</expandMacro>
       
   201 
       
   202 			<defineLocation id="CONTENT_CHILD_ENUMS" 
       
   203 				baseLocation="CONTENT_CLASS"
       
   204 				owned="false"
       
   205 				location="enum(TControls)">
       
   206 				<template><![CDATA[
       
   207 public: <% contrib.indentAdjust(-1); %>
       
   208 enum TControls
       
   209 	{
       
   210 	};
       
   211 ]]>				</template>
       
   212 			</defineLocation>
       
   213 
       
   214 			<defineLocation id="CONTENT_CHILD_ENUMS_CONTENTS" 
       
   215 				baseLocation="CONTENT_CHILD_ENUMS"
       
   216 				location="region(Generated Contents)">
       
   217 			</defineLocation>
       
   218 
       
   219 			<template id="GetChildEnums" location="CONTENT_CHILD_ENUMS_CONTENTS"><![CDATA[<%
       
   220 	// each control must contribute enumerators
       
   221 	if (Engine.formMatches(form, ["AppUi", "AknView"])) {
       
   222 		var enumContribs = Engine.generateChildContributions("HandleCCoeControlEnums");
       
   223 		Engine.assignLocationsForPhase(enumContribs, "ChildEnumsContents", "CONTENT_CHILD_ENUMS_CONTENTS");
       
   224 		contribs.addAll(enumContribs);
       
   225 	}
       
   226 %>]]>
       
   227 			</template>
       
   228 
       
   229 			<template id="AddLastChildEnum" location="CONTENT_CHILD_ENUMS">
       
   230 // add any user-defined entries here...
       
   231 
       
   232 ELastControl
       
   233 			</template>
       
   234 
       
   235 			<expandMacro name="GenerateMethodWithOwnedBody"
       
   236 				IsOwned="false"
       
   237 				FunctionLocationId="CONSTRUCTOR"
       
   238 				FunctionName="${className}"
       
   239 				FunctionArgs=""
       
   240 				ReturnType=""
       
   241 				DeclLocation="CONTENT_CLASS_PUBLIC"
       
   242 				DefnLocation="CONTENT_MAIN_FILE">
       
   243 				<expandArgument name="FunctionComment">
       
   244 /**
       
   245  * First phase of Symbian two-phase construction. Should not 
       
   246  * contain any code that could leave.
       
   247  */
       
   248 				</expandArgument>				
       
   249 			</expandMacro>
       
   250 
       
   251 			<expandMacro name="GenerateMethodWithOwnedBody"
       
   252 				IsOwned="false"
       
   253 				IsVirtual="true"
       
   254 				FunctionLocationId="DESTRUCTOR"
       
   255 				FunctionName="~${className}"
       
   256 				FunctionArgs=""
       
   257 				ReturnType=""
       
   258 				DeclLocation="CONTENT_CLASS_PUBLIC"
       
   259 				DefnLocation="CONTENT_MAIN_FILE">
       
   260 				<expandArgument name="FunctionComment">
       
   261 /** 
       
   262  * Destroy child controls.
       
   263  */
       
   264 				</expandArgument>				
       
   265 			</expandMacro>
       
   266 
       
   267 			<expandMacro name="GenerateMethod"
       
   268 				IsOwned="false"
       
   269 				IsStatic="true"
       
   270 				FunctionLocationId="NEWL_METHOD"
       
   271 				FunctionName="NewL"
       
   272 				FunctionArgs="MEikCommandObserver* aCommandObserver"
       
   273 				ReturnType="${className}*"
       
   274 				DeclLocation="CONTENT_CLASS_PUBLIC"
       
   275 				DefnLocation="CONTENT_MAIN_FILE">
       
   276 				<expandArgument name="FunctionComment">
       
   277 /**
       
   278  * Construct the control (first phase).
       
   279  *  Creates an instance and initializes it.
       
   280  *  Instance is not left on cleanup stack.
       
   281  * @return initialized instance of ${className}
       
   282  */
       
   283 				</expandArgument>				
       
   284 				<expandArgument name="FunctionBody"><![CDATA[
       
   285 ${className}* self = ${className}::NewLC( aCommandObserver );
       
   286 CleanupStack::Pop( self );
       
   287 return self;
       
   288 			]]>	</expandArgument>
       
   289 			</expandMacro>
       
   290 			
       
   291 			<expandMacro name="GenerateMethod"
       
   292 				IsOwned="false"
       
   293 				IsStatic="true"
       
   294 				FunctionLocationId="NEWLC_METHOD"
       
   295 				FunctionName="NewLC"
       
   296 				FunctionArgs="MEikCommandObserver* aCommandObserver"
       
   297 				ReturnType="${className}*"
       
   298 				DeclLocation="CONTENT_CLASS_PUBLIC"
       
   299 				DefnLocation="CONTENT_MAIN_FILE">
       
   300 				<expandArgument name="FunctionComment">
       
   301 /**
       
   302  * Construct the control (first phase).
       
   303  *  Creates an instance and initializes it.
       
   304  *  Instance is left on cleanup stack.
       
   305  * @return new instance of ${className}
       
   306  */
       
   307 				</expandArgument>				
       
   308 				<expandArgument name="FunctionBody"><![CDATA[
       
   309 ${className}* self = new ( ELeave ) ${className}();
       
   310 CleanupStack::PushL( self );
       
   311 self->ConstructL( aCommandObserver );
       
   312 return self;
       
   313 			]]>	</expandArgument>
       
   314 			</expandMacro>
       
   315 	
       
   316 			<expandMacro name="GenerateMethodWithOwnedBody"
       
   317 				IsOwned="false"
       
   318 				FunctionLocationId="CONSTRUCTL_METHOD"
       
   319 				FunctionName="ConstructL"
       
   320 				FunctionArgs="MEikCommandObserver* aCommandObserver"
       
   321 				DeclLocation="CONTENT_CLASS_PUBLIC"
       
   322 				DefnLocation="CONTENT_MAIN_FILE">
       
   323 				<expandArgument name="FunctionComment">
       
   324 /**
       
   325  * Construct the control (second phase).
       
   326  *  Creates a window to contain the controls and activates it.
       
   327  */ 
       
   328 				</expandArgument>				
       
   329 				<expandArgument name="StartFunctionBody"><![CDATA[
       
   330 iCommandObserver = aCommandObserver;
       
   331 CreateWindowL();
       
   332 InitializeControlsL();
       
   333 ActivateL();
       
   334 			]]> </expandArgument>
       
   335 			</expandMacro>
       
   336 			
       
   337 			<expandMacro name="GenerateMethod"
       
   338 				IsOwned="false"
       
   339 				IsConst="true"
       
   340 				FunctionLocationId="COUNTCOMPONENTCONTROLS_METHOD"
       
   341 				FunctionName="CountComponentControls"
       
   342 				FunctionArgs=""
       
   343 				ReturnType="TInt"
       
   344 				DeclLocation="CONTENT_CLASS_PUBLIC"
       
   345 				DefnLocation="CONTENT_MAIN_FILE">
       
   346 				<expandArgument name="FunctionComment">
       
   347 /**
       
   348 * Return the number of controls in the container (override)
       
   349 * @return count
       
   350 */
       
   351 				</expandArgument>				
       
   352 				<expandArgument name="FunctionBody"><![CDATA[
       
   353 return ( int ) ELastControl;
       
   354 			]]> </expandArgument>
       
   355 			</expandMacro>
       
   356 
       
   357 			<expandMacro name="GenerateMethodWithOwnedBody"
       
   358 				IsOwned="false"
       
   359 				IsConst="true"
       
   360 				FunctionLocationId="COMPONENTCONTROL_METHOD"
       
   361 				FunctionName="ComponentControl"
       
   362 				FunctionArgs="TInt aIndex"
       
   363 				ReturnType="CCoeControl*"
       
   364 				DeclLocation="CONTENT_CLASS_PUBLIC"
       
   365 				DefnLocation="CONTENT_MAIN_FILE">
       
   366 				<expandArgument name="FunctionComment"><![CDATA[
       
   367 /**
       
   368 * Get the control with the given index (override)
       
   369 * @param aIndex Control index [0...n) (limited by #CountComponentControls)
       
   370 * @return Pointer to control
       
   371 */
       
   372 			]]> </expandArgument>
       
   373 				<expandArgument name="EndFunctionBody"><![CDATA[
       
   374 // handle any user controls here...
       
   375 
       
   376 return NULL;
       
   377 			]]> </expandArgument>
       
   378 			</expandMacro>
       
   379 
       
   380 			<template id="ComponentControlSwitch1" location="COMPONENTCONTROL_METHOD_BODY"><![CDATA[
       
   381 switch ( aIndex )
       
   382 	{
       
   383 ]]>			</template>
       
   384 
       
   385 			<template id="GetChildSwitchCases" location="COMPONENTCONTROL_METHOD_BODY"><![CDATA[<%
       
   386 	// each control must contribute switch cases
       
   387 	if (Engine.formMatches(form, ["AppUi", "AknView"])) {
       
   388 		var switchContribs = Engine.generateChildContributions("HandleComponentSwitchDispatch");
       
   389 		Engine.assignLocationsForPhase(switchContribs, "ComponentControlBody", "COMPONENTCONTROL_METHOD_BODY");
       
   390 		contribs.addAll(switchContribs);
       
   391 	}
       
   392 		%>]]></template>
       
   393 
       
   394 			<template id="ComponentControlSwitch2" location="COMPONENTCONTROL_METHOD_BODY"><![CDATA[
       
   395 	}
       
   396 ]]>			</template>
       
   397 
       
   398 			<expandMacro name="GenerateMethod"
       
   399 				IsOwned="false"
       
   400 				FunctionLocationId="STARTCONTENTBUILDINGL_METHOD"
       
   401 				FunctionName="StartContentBuildingL"
       
   402 				FunctionArgs=""
       
   403 				DeclLocation="CONTENT_CLASS_PUBLIC"
       
   404 				DefnLocation="CONTENT_MAIN_FILE">
       
   405 				<expandArgument name="FunctionComment">
       
   406 /**
       
   407 * When asynchronous, called by the preview popup controller when 
       
   408 * content building should be started.
       
   409 */
       
   410 				</expandArgument>				
       
   411 				<expandArgument name="FunctionBody"><![CDATA[
       
   412 iController->ContentReady();
       
   413 			]]>	</expandArgument>
       
   414 			</expandMacro>
       
   415 
       
   416 			<expandMacro name="GenerateMethod"
       
   417 				IsOwned="false"
       
   418 				FunctionLocationId="CANCELCONTENTBUILDING_METHOD"
       
   419 				FunctionName="CancelContentBuilding"
       
   420 				FunctionArgs=""
       
   421 				DeclLocation="CONTENT_CLASS_PUBLIC"
       
   422 				DefnLocation="CONTENT_MAIN_FILE"
       
   423 				Realize="true">
       
   424 				<expandArgument name="FunctionComment">
       
   425 /**
       
   426 * When asynchronous, called by the preview popup controller if ongoing
       
   427 * content building operation should be cancelled.
       
   428 */
       
   429 				</expandArgument>				
       
   430 			</expandMacro>
       
   431 
       
   432 			<expandMacro name="GenerateMethod" 
       
   433 				IsOwned="false" 
       
   434 				FunctionLocationId="SETPOPUPCONTROLLER_METHOD" 
       
   435 				FunctionName="SetPopUpController" 
       
   436 				FunctionArgs="CAknPreviewPopUpController* aController" 
       
   437 				DeclLocation="CONTENT_CLASS_PUBLIC"
       
   438 				DefnLocation="CONTENT_MAIN_FILE">
       
   439 				<expandArgument name="FunctionComment">
       
   440 /**
       
   441 * Set the pop-up controller member.
       
   442 */
       
   443 				</expandArgument>				
       
   444 				<expandArgument name="FunctionBody"><![CDATA[
       
   445 iController = aController;
       
   446 			]]>	</expandArgument>
       
   447 			</expandMacro>
       
   448 			
       
   449 			<expandMacro name="GenerateMethodWithOwnedBody"
       
   450 				IsOwned="false"
       
   451 				FunctionLocationId="MINIMUMSIZE_METHOD"
       
   452 				FunctionName="MinimumSize"
       
   453 				FunctionArgs=""
       
   454 				ReturnType="TSize"
       
   455 				DeclLocation="CONTENT_CLASS_PROTECTED"
       
   456 				DefnLocation="CONTENT_MAIN_FILE">
       
   457 				<expandArgument name="FunctionComment">
       
   458 /**
       
   459 * Return the size of the pop-up.
       
   460 * Modify this method to dynamically size the pop-up.
       
   461 */
       
   462 				</expandArgument>
       
   463 				<expandArgument name="StartFunctionBody">
       
   464 TSize size;
       
   465 				</expandArgument>				
       
   466 				<expandArgument name="FunctionBody"><![CDATA[
       
   467 <% include("popupDialogLibrary.js")
       
   468 	var size = new Point(instance.properties.size.width, instance.properties.size.height);
       
   469 	var laf = findExistingLookAndFeel(instance);
       
   470 	if (laf != null) {
       
   471 		size.y -= getPreviewPopUpHeadingHeight(instance, laf);
       
   472 	}
       
   473 	// the frame
       
   474 	size.x -= 12;
       
   475 	size.y -= 12;
       
   476 %>size = TSize(${size.x}, ${size.y});]]></expandArgument>
       
   477 				<expandArgument name="EndFunctionBody">
       
   478 return size;
       
   479 				</expandArgument>				
       
   480 			</expandMacro>
       
   481 			
       
   482 			<expandMacro name="GenerateMethodWithOwnedBody"
       
   483 				IsOwned="false"
       
   484 				FunctionLocationId="SIZECHANGED_METHOD"
       
   485 				FunctionName="SizeChanged"
       
   486 				FunctionArgs=""
       
   487 				DeclLocation="CONTENT_CLASS_PROTECTED"
       
   488 				DefnLocation="CONTENT_MAIN_FILE">
       
   489 				<expandArgument name="FunctionComment">
       
   490 /**
       
   491  *	Handle resizing of the container. This implementation will lay out
       
   492  *  labels, images, etc. to the size they were given in the UI designer.
       
   493  *  This code will need to be modified to adjust arbitrary controls to
       
   494  *  any screen size.
       
   495  */				
       
   496 				</expandArgument>				
       
   497 				<expandArgument name="StartFunctionBody"><![CDATA[
       
   498 CCoeControl::SizeChanged();
       
   499 LayoutControls();
       
   500 			]]> </expandArgument>
       
   501 			</expandMacro>
       
   502 			
       
   503 			<expandMacro name="GenerateMethodWithOwnedBody"
       
   504 				IsOwned="false"
       
   505 				IsConst="true"
       
   506 				FunctionLocationId="DRAW_METHOD"
       
   507 				FunctionName="Draw"
       
   508 				FunctionArgs="const TRect&amp; aRect"
       
   509 				DeclLocation="CONTENT_CLASS_PRIVATE"
       
   510 				DefnLocation="CONTENT_MAIN_FILE">
       
   511 				<expandArgument name="FunctionComment">
       
   512 /**
       
   513  *	Draw container contents.
       
   514  */				
       
   515 				</expandArgument>				
       
   516 			</expandMacro>
       
   517 			
       
   518 			<inline scope="prototype">
       
   519 function getBackgroundColorRgb(properties) {
       
   520 	if (properties.backColor.indexOf(',') > 0)
       
   521 		return "( " + properties.backColor + " )";
       
   522 	else
       
   523 		return " = iEikonEnv->Color( ( TLogicalColor ) " + properties.backColor + " )";
       
   524 }	
       
   525 			</inline>
       
   526 			
       
   527 			<template id="DrawBodyBgColor" location="DRAW_METHOD_BODY"><![CDATA[
       
   528 CWindowGc& gc = SystemGc();
       
   529 <%if (properties.backColor == "") {%>gc.Clear( aRect );
       
   530 <%} else {%>gc.SetPenStyle( CGraphicsContext::ENullPen );
       
   531 TRgb backColor${getBackgroundColorRgb(properties)};
       
   532 gc.SetBrushColor( backColor );
       
   533 gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
       
   534 gc.DrawRect( aRect );
       
   535 <%}%>
       
   536 ]]>				</template>
       
   537 
       
   538 			<expandMacro name="GenerateMethod"
       
   539 				FunctionLocationId="INITIALIZECONTROLSL_METHOD"
       
   540 				FunctionName="InitializeControlsL"
       
   541 				FunctionArgs=""
       
   542 				DeclLocation="CONTENT_CLASS_PRIVATE_OWNED_METHODS"
       
   543 				DefnLocation="CONTENT_MAIN_FILE"
       
   544 				Realize="true">
       
   545 				<expandArgument name="FunctionComment">
       
   546 /**
       
   547  *	Initialize each control upon creation.
       
   548  */				
       
   549 				</expandArgument>
       
   550 			</expandMacro>
       
   551 			
       
   552 			<expandMacro name="GenerateMethod"
       
   553 				FunctionLocationId="LAYOUTCONTROLS_METHOD"
       
   554 				FunctionName="LayoutControls"
       
   555 				FunctionArgs=""
       
   556 				DeclLocation="CONTENT_CLASS_PRIVATE_OWNED_METHODS"
       
   557 				DefnLocation="CONTENT_MAIN_FILE"
       
   558 				Realize="true">
       
   559 				<expandArgument name="FunctionComment">
       
   560 /**
       
   561  * Layout components as specified in the UI Designer
       
   562  */
       
   563 				</expandArgument>
       
   564 			</expandMacro>
       
   565 
       
   566 			<templateGroup id="GenerateResourceChanged" ifEvents="resourceChanged">
       
   567 				<expandMacro name="GenerateVirtualMethodOverrideForEventHandler"
       
   568 					IsOwned="false"
       
   569 					FunctionLocationId="HANDLERESOURCECHANGED_METHOD"
       
   570 					FunctionArgs="TInt aType"
       
   571 					FunctionName="HandleResourceChange"
       
   572 					DeclLocation="CONTENT_CLASS_PROTECTED_OVERRIDDEN_METHODS"
       
   573 					DefnLocation="CONTENT_MAIN_FILE">
       
   574 					<expandArgument name="FunctionComment">
       
   575 /** 
       
   576  * Handle global resource changes, such as scalable UI or skin events (override)
       
   577  */
       
   578 					</expandArgument>
       
   579 					<expandArgument name="StartFunctionBody">
       
   580 CCoeControl::HandleResourceChange( aType );
       
   581 					</expandArgument>
       
   582 				</expandMacro>
       
   583 				<expandMacro name="GenerateUserEventHandlerFunction"
       
   584 					FunctionLocationId="RESOURCECHANGED_EVENTHANDLER"
       
   585 					FunctionArgs="TInt aType"
       
   586 					DeclLocation="CONTENT_CLASS_PROTECTED_USER_HANDLERS"
       
   587 					DefnLocation="CONTENT_MAIN_FILE">
       
   588 				</expandMacro>
       
   589 			</templateGroup>
       
   590 			
       
   591 			<templateGroup id="GenerateSizeChangedHandler" ifEvents="sizeChanged">
       
   592 				<expandMacro name="GenerateUserEventHandlerFunction"
       
   593 					FunctionLocationId="SIZECHANGED_EVENTHANDLER"
       
   594 					FunctionArgs=""
       
   595 					DeclLocation="CONTENT_CLASS_PROTECTED_USER_HANDLERS"
       
   596 					DefnLocation="CONTENT_MAIN_FILE">
       
   597 				</expandMacro>
       
   598 				<template id="InvokeSizeChangedHandler" location="SIZECHANGED_METHOD_BODY">
       
   599 ${event.handlerName}();
       
   600 				</template>
       
   601 			</templateGroup>
       
   602 			
       
   603 			<templateGroup id="GenerateDrawHandler" ifEvents="draw">
       
   604 				<expandMacro name="GenerateUserEventHandlerFunction"
       
   605 					IsConst="true"
       
   606 					FunctionLocationId="DRAW_EVENTHANDLER"
       
   607 					FunctionArgs="const TRect&amp; aRect"
       
   608 					DeclLocation="CONTENT_CLASS_PROTECTED_USER_HANDLERS"
       
   609 					DefnLocation="CONTENT_MAIN_FILE">
       
   610 				</expandMacro>
       
   611 				<template id="InvokeDrawHandler" location="DRAW_METHOD_BODY">
       
   612 ${event.handlerName}( aRect );
       
   613 				</template>
       
   614 			</templateGroup>
       
   615 			
       
   616 			<templateGroup id="GeneratePositionChanged" ifEvents="positionChanged">
       
   617 				<expandMacro name="GenerateVirtualMethodOverrideForEventHandler"
       
   618 					IsOwned="false"
       
   619 					FunctionLocationId="POSITIONCHANGED_METHOD"
       
   620 					FunctionArgs=""
       
   621 					FunctionName="PositionChanged"
       
   622 					DeclLocation="CONTENT_CLASS_PROTECTED_OVERRIDDEN_METHODS"
       
   623 					DefnLocation="CONTENT_MAIN_FILE">
       
   624 					<expandArgument name="FunctionComment">
       
   625 /** 
       
   626  * Handle position change (override)
       
   627  */
       
   628 					</expandArgument>
       
   629 					<expandArgument name="StartFunctionBody">
       
   630 CCoeControl::PositionChanged();
       
   631 					</expandArgument>
       
   632 				</expandMacro>
       
   633 				<expandMacro name="GenerateUserEventHandlerFunction"
       
   634 					FunctionLocationId="POSITIONCHANGED_EVENTHANDLER"
       
   635 					FunctionArgs=""
       
   636 					DeclLocation="CONTENT_CLASS_PROTECTED_USER_HANDLERS"
       
   637 					DefnLocation="CONTENT_MAIN_FILE">
       
   638 				</expandMacro>
       
   639 			</templateGroup>
       
   640 			
       
   641 			<templateGroup id="HandlePointerEvent" ifEvents="handlePointerEvent handleLongTapEvent">
       
   642 				<expandMacro name="GenerateMethodWithOwnedBody"
       
   643 					IsOwned="false"
       
   644 					FunctionLocationId="HANDLEPOINTEREVENTL_METHOD"
       
   645 					FunctionArgs="const TPointerEvent&amp; aPointerEvent"
       
   646 					FunctionName="HandlePointerEventL"
       
   647 					DeclLocation="CONTENT_CLASS_PROTECTED_OVERRIDDEN_METHODS"
       
   648 					DefnLocation="CONTENT_MAIN_FILE">
       
   649 					<expandArgument name="FunctionComment">
       
   650 /** 
       
   651  * Handle pointer events (override)
       
   652  */
       
   653 					</expandArgument>
       
   654 					<expandArgument name="StartFunctionBody">
       
   655 CCoeControl::HandlePointerEventL( aPointerEvent );
       
   656 					</expandArgument>
       
   657 				</expandMacro>
       
   658 			</templateGroup>
       
   659 			
       
   660 			<templateGroup id="HandlePointerEventHandler" ifEvents="handlePointerEvent">
       
   661 
       
   662 				<template id="InvokeHandlePointerEventHandler" location="HANDLEPOINTEREVENTL_METHOD_BODY">
       
   663 ${event.handlerName}( aPointerEvent );
       
   664 				</template>
       
   665 				
       
   666 				<expandMacro name="GenerateUserEventHandlerFunction"
       
   667 					FunctionLocationId="HANDLEPOINTEREVENT_EVENTHANDLER"
       
   668 					FunctionArgs="const TPointerEvent&amp; aPointerEvent"
       
   669 					DeclLocation="CONTENT_CLASS_PROTECTED_USER_HANDLERS"
       
   670 					DefnLocation="CONTENT_MAIN_FILE">
       
   671 				</expandMacro>
       
   672 			</templateGroup>
       
   673 
       
   674 			<inline><![CDATA[
       
   675 			include("../srcgenLibrary.js");
       
   676 
       
   677 if (!Engine.formMatches(form, ["RootAppUi"])) {
       
   678 
       
   679 	if (Engine.formMatches(form, ["AppUi", "AknView"])) {
       
   680 		// clear out any image stuff
       
   681 		resetImagePropertyState(instance);
       
   682 	}
       
   683 	
       
   684 	if (!Engine.formMatches(form, ["RootAppUi"])) {
       
   685 		if (Engine.formMatches(form, [ "AknView", "AppUi" ])) {
       
   686 			// get default and container-specific contributions
       
   687 			// (the argument is a regular expression)
       
   688 			contribs.addAll(Engine.generateChildContributions(form+"|Container"))
       
   689 		} else {
       
   690 			// unknown form -- likely specific to a parent -- so get 
       
   691 			// form-specific contributions
       
   692 			contribs.addAll(Engine.generateChildContributions(form))
       
   693 		}
       
   694 	}
       
   695 
       
   696 	if (Engine.formMatches(form, ["AppUi", "AknView"])) {
       
   697 		Engine.collateContributionsByPhase(contribs, ["Initialize", "PostInitialize"]);
       
   698 		
       
   699 		// fix up the phases so they point to real locations
       
   700 		Engine.assignLocationsForPhase(contribs, "MainConstants", "CONTENT_HEADER_OWNED_CONSTANTS");
       
   701 		Engine.assignLocationsForPhase(contribs, "MainSystemIncludes", "CONTENT_MAIN_OWNED_SYSTEM_INCLUDES");
       
   702 		Engine.assignLocationsForPhase(contribs, "MainUserIncludes", "CONTENT_MAIN_OWNED_USER_INCLUDES");
       
   703 		Engine.assignLocationsForPhase(contribs, "Destroy", "DESTRUCTOR_BODY");
       
   704 		Engine.assignLocationsForPhase(contribs, "Construct", "CONSTRUCTOR_BODY");
       
   705 		Engine.assignLocationsForPhase(contribs, "Initialize", "INITIALIZECONTROLSL_METHOD");
       
   706 		Engine.assignLocationsForPhase(contribs, "PostInitialize", "INITIALIZECONTROLSL_METHOD");
       
   707 		Engine.assignLocationsForPhase(contribs, "PostActivateL", "CONSTRUCTL_METHOD_BODY");
       
   708 		Engine.assignLocationsForPhase(contribs, "LayoutControls", "LAYOUTCONTROLS_METHOD");
       
   709 		Engine.assignLocationsForPhase(contribs, "HeaderIncludes", "CONTENT_HEADER_OWNED_SYSTEM_INCLUDES");
       
   710 		Engine.assignLocationsForPhase(contribs, "ForwardDeclarations", "CONTENT_HEADER_OWNED_FORWARD_DECLARATIONS");
       
   711 		Engine.assignLocationsForPhase(contribs, "ClassTypeDeclarations", "CONTENT_CLASS_PUBLIC_OWNED_TYPES");
       
   712 		Engine.assignLocationsForPhase(contribs, "InstanceVariables", "CONTENT_CLASS_PRIVATE_OWNED_INSTANCE_VARIABLES");
       
   713 		Engine.assignLocationsForPhase(contribs, "ClassMethods", "CONTENT_CLASS_PRIVATE_OWNED_METHODS");
       
   714 		Engine.assignLocationsForPhase(contribs, "ClassSource", "CONTENT_MAIN_FILE");
       
   715 		Engine.assignLocationsForPhase(contribs, "ClassHeader", "CONTENT_HEADER_FILE");
       
   716 		Engine.assignLocationsForPhase(contribs, "BaseClassList", "CONTENT_CLASS_BASES");
       
   717 		Engine.assignLocationsForPhase(contribs, "OverriddenMethods", "CONTENT_CLASS_PROTECTED_OVERRIDDEN_METHODS");
       
   718 		Engine.assignLocationsForPhase(contribs, "UserHandlers", "CONTENT_CLASS_PROTECTED_USER_HANDLERS");
       
   719 		Engine.assignLocationsForPhase(contribs, "EventIncludes", "CONTENT_HEADER_EVENT_HANDLER_INCLUDES");
       
   720 		Engine.assignLocationsForPhase(contribs, "SizeChanged", "SIZECHANGED_METHOD_BODY");
       
   721 								
       
   722 		// remove duplicate contributions where the location doesn't already have a filter
       
   723 		Engine.removeDuplicateContributionsForLocation(contribs, "CONTENT_HEADER_OWNED_FORWARD_DECLARATIONS");
       
   724 		Engine.removeDuplicateContributionsForLocation(contribs, "DESTRUCTOR_BODY");
       
   725 	}
       
   726 }
       
   727 			]]> </inline>			
       
   728 
       
   729 		<template phase="ForwardDeclarations"><![CDATA[
       
   730 class CAknPreviewPopUpController;
       
   731 class ${className};
       
   732 	]]> </template>			
       
   733 			
       
   734 		<template phase="MainSystemIncludes"><![CDATA[
       
   735 #include <aknpreviewpopupcontroller.h>
       
   736 #include <barsread.h>
       
   737 #include <stringloader.h>
       
   738 	]]> </template>			
       
   739 			
       
   740 		<template phase="MainSystemIncludes"><![CDATA[
       
   741 #include "${instanceName$title}.h"
       
   742 	]]> </template>			
       
   743 			
       
   744 		<inline scope="prototype">
       
   745 function controllerInstance() {
       
   746 	return instanceMemberName + "Controller";
       
   747 }
       
   748 			
       
   749 function contentInstance() {
       
   750 	return instanceMemberName + "Content";
       
   751 }
       
   752 		</inline>
       
   753 			
       
   754 		<template phase="Construct"><![CDATA[
       
   755 ${controllerInstance()} = NULL;
       
   756 ${contentInstance()} = NULL;
       
   757 	]]> </template>
       
   758 			
       
   759 		<template phase="Destroy"><![CDATA[
       
   760 delete ${controllerInstance()};
       
   761 ${controllerInstance()} = NULL;
       
   762 delete ${contentInstance()};
       
   763 ${contentInstance()} = NULL;
       
   764 	]]> </template>
       
   765 			
       
   766 		<template phase="InstanceVariables"><![CDATA[
       
   767 CAknPreviewPopUpController* ${controllerInstance()};
       
   768 ${className}* ${contentInstance()};
       
   769 	]]> </template>
       
   770 			
       
   771 		<inline>
       
   772 function getStyleArgs(instance) {
       
   773 	var flags = "";
       
   774 	if (instance.properties.ELayoutDefault)
       
   775 		flags += "CAknPreviewPopUpController::ELayoutDefault";
       
   776 	if (instance.properties.ELayoutSubMenu) {
       
   777 		if (flags.length != 0)
       
   778 			flags += " |\n\t\t";
       
   779 		flags += "CAknPreviewPopUpController::ELayoutSubMenu";
       
   780 	}
       
   781 	if (instance.properties.EPermanentMode) {
       
   782 		if (flags.length != 0)
       
   783 			flags += " |\n\t\t";
       
   784 		flags += "CAknPreviewPopUpController::EPermanentMode";
       
   785 	}
       
   786 	if (instance.properties.EFixedMode) {
       
   787 		if (flags.length != 0)
       
   788 			flags += " |\n\t\t";
       
   789 		flags += "CAknPreviewPopUpController::EFixedMode";
       
   790 	}
       
   791 	if (instance.properties.EExcludeFrames) {
       
   792 		if (flags.length != 0)
       
   793 			flags += " |\n\t\t";
       
   794 		flags += "CAknPreviewPopUpController::EExcludeFrames";
       
   795 	}
       
   796 
       
   797 	return flags;
       
   798 }
       
   799 			
       
   800 function getCommandObserver(instance) {
       
   801 	if (instance.parent.componentId == "com.nokia.sdt.series60.CAknView" ||
       
   802 			instance.parent.componentId == "com.nokia.sdt.series60.CAknAppUi")
       
   803 		return "this";
       
   804 
       
   805 	return "iCoeEnv->AppUi()";	
       
   806 }
       
   807 		</inline>
       
   808 			
       
   809 		<inline><![CDATA[
       
   810 var mycontrib = Engine.createContributionForPhase("Initialize")
       
   811 var text = contentInstance() + " = " + className + "::NewL( " + getCommandObserver(instance) + " );\n";
       
   812 var styleArgs = getStyleArgs(instance);
       
   813 text += controllerInstance() + " = CAknPreviewPopUpController::NewL(\n"
       
   814 if (styleArgs.length == 0 && !instance.properties.asynchronous)
       
   815 	text += "\t\t*" + contentInstance() + " );\n";
       
   816 if (styleArgs.length > 0 && !instance.properties.asynchronous)
       
   817 	text += "\t\t*" + contentInstance() + ",\n\t\t" + styleArgs + " );\n";
       
   818 if (styleArgs.length == 0 && instance.properties.asynchronous)
       
   819 	text += "\t\t*" + contentInstance() + ",\n\t\t*" + contentInstance() + " );\n";
       
   820 if (styleArgs.length > 0 && instance.properties.asynchronous)
       
   821 	text += "\t\t*" + contentInstance() + ",\n\t\t*" + contentInstance() + ",\n\t\t" + styleArgs + " );\n";
       
   822 text += contentInstance() + "->SetPopUpController( " + controllerInstance() + " );\n";
       
   823 mycontrib.setText(text);
       
   824 contribs.add(mycontrib);
       
   825 	]]> </inline>
       
   826 			
       
   827 			<template phase="Initialize"><![CDATA[
       
   828 <% if (instance.properties.headingText.length > 0) {
       
   829 %>	{
       
   830 	HBufC* headingText = StringLoader::LoadLC( ${Engine.getGeneratedResource(instance, "headingText").toUpperCase() } );
       
   831 	${controllerInstance()}->SetHeadingTextL( *headingText );
       
   832 	CleanupStack::PopAndDestroy( headingText );
       
   833 	}<% } %>
       
   834 ]]>			</template>
       
   835 
       
   836 			<inline>
       
   837 function getMicroSecs(aFloat) {
       
   838 	return (1000000.0 * aFloat).toFixed();				
       
   839 }				
       
   840 			</inline>
       
   841 			
       
   842 			<template phase="Initialize"><![CDATA[
       
   843 <% if (instance.properties.showDelay != 1.0) {
       
   844 %>	{
       
   845 	TTimeIntervalMicroSeconds32 ms = ${getMicroSecs(instance.properties.showDelay)};
       
   846 	${controllerInstance()}->SetPopUpShowDelay( ms );
       
   847 	}<% } %>
       
   848 ]]>			</template>
       
   849 
       
   850 			<template phase="Initialize"><![CDATA[
       
   851 <% if (instance.properties.hideDelay != 3.0) {
       
   852 %>	{
       
   853 	TTimeIntervalMicroSeconds32 ms = ${getMicroSecs(instance.properties.hideDelay)};
       
   854 	${controllerInstance()}->SetPopUpHideDelay( ms );
       
   855 	}<% } %>
       
   856 ]]>			</template>
       
   857 
       
   858 			<expandMacro name="GenerateMethod"
       
   859 				FunctionLocationId="SHOW_PREVIEW_POPUP_RECT_METHOD"
       
   860 				FunctionName="Show${instanceName$title}L"
       
   861 				FunctionArgs="const TRect&amp; aHighlightRect, const TDesC* aOverrideHeadingText"
       
   862 				DeclPhase="ClassMethods"
       
   863 				DefnLocation="MAIN_FILE"
       
   864 				ClassName="${parentClassName}">
       
   865 				<expandArgument name="FunctionComment">
       
   866 /**
       
   867  * Show the preview pop-up for ${instanceName}.
       
   868  * Sets the position of the preview pop-up so that it is aligned with the highlight rect.
       
   869  * This is intented to be used in conjunction with lists and grids if the 
       
   870  * application wishes to implement a popup that follows lists/grids item highlight.
       
   871  * If fixed mode is used then the value of the highlight rect has no effect.
       
   872  * @param aHighlightRect Screen-relative rectangle used to calculate pop-up's position.
       
   873  * @param aOverrideText optional override header text
       
   874  */
       
   875 				</expandArgument>
       
   876 			</expandMacro>
       
   877 
       
   878 			<template location="SHOW_PREVIEW_POPUP_RECT_METHOD">
       
   879 if ( aOverrideHeadingText != NULL )
       
   880 	{
       
   881 	${controllerInstance()}->SetHeadingTextL( *aOverrideHeadingText );
       
   882 	}
       
   883 ${controllerInstance()}->SetPositionByHighlight( aHighlightRect );
       
   884 ${controllerInstance()}->ShowPopUp();
       
   885 			</template>
       
   886 			
       
   887 			
       
   888 			<expandMacro name="GenerateMethod"
       
   889 				FunctionLocationId="SHOW_PREVIEW_POPUP_POINT_METHOD"
       
   890 				FunctionName="Show${instanceName$title}L"
       
   891 				FunctionArgs="const TPoint&amp; aPoint, const TDesC* aOverrideHeadingText"
       
   892 				DeclPhase="ClassMethods"
       
   893 				DefnLocation="MAIN_FILE"
       
   894 				ClassName="${parentClassName}">
       
   895 				<expandArgument name="FunctionComment">
       
   896 /**
       
   897  * Show the preview pop-up for ${instanceName}.
       
   898  * Sets the position of preview popup left and down from the given point. 
       
   899  * If there is not enough space, the pop-up is opened up and left.
       
   900  * If fixed mode is used then the value of the point has no effect.
       
   901  * @param aPoint Popup's position.
       
   902  * @param aOverrideText optional override header text
       
   903  */
       
   904 				</expandArgument>
       
   905 			</expandMacro>
       
   906 			
       
   907 			<template location="SHOW_PREVIEW_POPUP_POINT_METHOD">
       
   908 if ( aOverrideHeadingText != NULL )
       
   909 	{
       
   910 	${controllerInstance()}->SetHeadingTextL( *aOverrideHeadingText );
       
   911 	}
       
   912 ${controllerInstance()}->SetPosition( aPoint );
       
   913 ${controllerInstance()}->ShowPopUp();
       
   914 			</template>
       
   915 			
       
   916 		<templateGroup id="GeneratePreviewPopupObserverEvents" ifEvents="previewPopUpShown previewPopUpHidden">
       
   917 			<template phase="EventIncludes"><![CDATA[
       
   918 #include <aknpreviewpopupobserver.h>
       
   919 		]]> </template>			
       
   920 				
       
   921 			<template phase="BaseClassList">, MAknPreviewPopUpObserver</template>
       
   922 			
       
   923 			<expandMacro name="GenerateMethodWithOwnedBody"
       
   924 				IsOwned="false"
       
   925 				FunctionLocationId="HANDLEPREVIEWPOPUPEVENTL_METHOD"
       
   926 				FunctionArgs="CAknPreviewPopUpController* aController, TPreviewPopUpEvent aEvent"
       
   927 				FunctionName="HandlePreviewPopUpEventL"
       
   928 				DeclPhase="ClassPublic"
       
   929 				DefnLocation="MAIN_FILE"
       
   930 				ClassName="${parentClassName}">
       
   931 				<expandArgument name="FunctionComment">
       
   932 /** 
       
   933  * Handle preview pop-up events
       
   934  */
       
   935 				</expandArgument>
       
   936 			</expandMacro>
       
   937 			
       
   938 			<template id="DispatchPreviewPopUpShown" location="HANDLEPREVIEWPOPUPEVENTL_METHOD_BODY"><![CDATA[<%
       
   939 	var event = instance.events["previewPopUpShown"];
       
   940 	if (event) { %>
       
   941 if ( aEvent == MAknPreviewPopUpObserver::EPreviewPopUpShown &&
       
   942 		aController == ${controllerInstance()} )
       
   943 	{
       
   944 	${event.handlerName}( aController, aEvent );
       
   945 	return;
       
   946 	}
       
   947 	<%}%>
       
   948 	]]> </template>
       
   949 
       
   950 			<template id="DispatchPreviewPopUpHidden" location="HANDLEPREVIEWPOPUPEVENTL_METHOD_BODY"><![CDATA[<%
       
   951 	var event = instance.events["previewPopUpHidden"];
       
   952 	if (event) { %>
       
   953 if ( aEvent == MAknPreviewPopUpObserver::EPreviewPopUpHidden &&
       
   954 		aController == ${controllerInstance()} )
       
   955 	{
       
   956 	${event.handlerName}( aController, aEvent );
       
   957 	return;
       
   958 	}
       
   959 	<%}%>
       
   960 	]]> </template>
       
   961 			
       
   962 			<template phase="Initialize"><![CDATA[
       
   963 ${controllerInstance()}->AddObserverL( *this );			
       
   964 		]]> </template>
       
   965 
       
   966 		</templateGroup>
       
   967 
       
   968 		<templateGroup id="GeneratePreviewPopupShownHandler" ifEvents="previewPopUpShown">
       
   969 			<expandMacro name="GenerateUserEventHandlerFunction"
       
   970 				FunctionLocationId="PREVIEWPOPUPSHOWN_EVENTHANDLER"
       
   971 				FunctionArgs="CAknPreviewPopUpController* aController, TPreviewPopUpEvent aEvent"
       
   972 				DeclPhase="UserHandlers"
       
   973 				DefnLocation="MAIN_FILE"
       
   974 				ClassName="${parentClassName}">
       
   975 			</expandMacro>
       
   976 		</templateGroup>
       
   977 
       
   978 		<templateGroup id="GeneratePreviewPopupHiddenHandler" ifEvents="previewPopUpHidden">
       
   979 			<expandMacro name="GenerateUserEventHandlerFunction"
       
   980 				FunctionLocationId="PREVIEWPOPUPHIDDEN_EVENTHANDLER"
       
   981 				FunctionArgs="CAknPreviewPopUpController* aController, TPreviewPopUpEvent aEvent"
       
   982 				DeclPhase="UserHandlers"
       
   983 				DefnLocation="MAIN_FILE"
       
   984 				ClassName="${parentClassName}">
       
   985 			</expandMacro>
       
   986 		</templateGroup>
       
   987 
       
   988 <!-- BEGIN EVENT handleLongTapEvent -->
       
   989 	<templateGroup id="HandleLongTapEvent" ifEvents="handleLongTapEvent">
       
   990 			
       
   991 		<template id="EventIncludes" location="CONTENT_HEADER_EVENT_HANDLER_INCLUDES"><![CDATA[
       
   992 #include <AknLongTapDetector.h>
       
   993 ]]>		</template>
       
   994 		
       
   995 		<template id="EventInterface" location="CONTENT_CLASS_BASES">, MAknLongTapDetectorCallBack</template>			
       
   996 			
       
   997 		<template id="CallDetectorWithPointerEvent" location="HANDLEPOINTEREVENTL_METHOD_BODY"><![CDATA[
       
   998 iLongTapDetector->PointerEventL( aPointerEvent );
       
   999 	]]> </template>
       
  1000 		
       
  1001 		<expandMacro name="GenerateVirtualMethodOverrideForEventHandler"
       
  1002 			IsOwned="false"
       
  1003 			FunctionLocationId="HANDLELONGTAPEVENTL_METHOD"
       
  1004 			FunctionArgs="const TPoint&amp; aPenEventLocation, const TPoint&amp; aPenEventScreenLocation"
       
  1005 			FunctionName="HandleLongTapEventL"
       
  1006 			DeclLocation="CONTENT_CLASS_PROTECTED_OVERRIDDEN_METHODS"
       
  1007 			DefnLocation="CONTENT_MAIN_FILE">
       
  1008 			<expandArgument name="FunctionComment">
       
  1009 /** 
       
  1010  * Implement the HandleLongTapEventL method of MAknLongTapDetectorCallBack 
       
  1011  */
       
  1012 			</expandArgument>
       
  1013 		</expandMacro>
       
  1014 		
       
  1015 		<expandMacro name="GenerateUserEventHandlerFunction"
       
  1016 			FunctionLocationId="HANDLELONGTAP_EVENTHANDLER"
       
  1017 			FunctionArgs="const TPoint&amp; aPenEventLocation, const TPoint&amp; aPenEventScreenLocation"
       
  1018 			DeclLocation="CONTENT_CLASS_PROTECTED_USER_HANDLERS"
       
  1019 			DefnLocation="CONTENT_MAIN_FILE">
       
  1020 		</expandMacro>
       
  1021 		
       
  1022 		<template id="DeclareDetectorMember" location="CONTENT_CLASS_PRIVATE_OWNED_INSTANCE_VARIABLES">
       
  1023 CAknLongTapDetector* iLongTapDetector;			
       
  1024 		</template>
       
  1025 
       
  1026 		<template id="MainSystemIncludes" location="CONTENT_MAIN_OWNED_SYSTEM_INCLUDES"><![CDATA[
       
  1027 #include <AknLongTapDetector.h>
       
  1028 ]]>		</template>
       
  1029 
       
  1030 		<template id="ClearDetectorMember" location="CONSTRUCTOR_BODY">
       
  1031 iLongTapDetector = NULL;		
       
  1032 		</template>
       
  1033 
       
  1034 		<template id="DestroyDetectorMember" location="DESTRUCTOR_BODY">
       
  1035 delete iLongTapDetector;		
       
  1036 iLongTapDetector = NULL;		
       
  1037 		</template>
       
  1038 
       
  1039 		<template id="ConstructDetectorMember" location="CONSTRUCTL_METHOD_BODY">
       
  1040 iLongTapDetector = CAknLongTapDetector::NewL( this );			
       
  1041 		</template>
       
  1042 
       
  1043 	</templateGroup>
       
  1044 <!-- END EVENT handleLongTapEvent -->		
       
  1045 		</sourceGen>
       
  1046 		
       
  1047 	</component>
       
  1048 </componentDefinition>