uidesigner/com.nokia.sdt.series60.componentlibrary/components/containers/CAknDialog.component
author fturovic <frank.turovich@nokia.com>
Fri, 03 Apr 2009 10:36:00 -0500
changeset 36 131ddbe8aee4
parent 2 d760517a8095
permissions -rw-r--r--
added IAD rules to CS manual
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
cawthron
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
cawthron
parents:
diff changeset
     2
<!-- Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -->
cawthron
parents:
diff changeset
     3
<!-- All rights reserved. -->
cawthron
parents:
diff changeset
     4
<!-- This component and the accompanying materials are made available -->
cawthron
parents:
diff changeset
     5
<!-- under the terms of the License "Eclipse Public License v1.0" -->
cawthron
parents:
diff changeset
     6
<!-- which accompanies this distribution, and is available -->
cawthron
parents:
diff changeset
     7
<!-- at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
cawthron
parents:
diff changeset
     8
cawthron
parents:
diff changeset
     9
<componentDefinition xmlns="http://www.nokia.com/sdt/emf/component" 
cawthron
parents:
diff changeset
    10
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" 
cawthron
parents:
diff changeset
    11
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
cawthron
parents:
diff changeset
    12
	<component baseComponent="com.nokia.sdt.series60.DialogBase" 
cawthron
parents:
diff changeset
    13
			friendlyName="%friendlyName" 
cawthron
parents:
diff changeset
    14
			qualifiedName="com.nokia.sdt.series60.CAknDialog" 
cawthron
parents:
diff changeset
    15
			abstract="true"
cawthron
parents:
diff changeset
    16
			version="1.0">
cawthron
parents:
diff changeset
    17
		<documentation>
cawthron
parents:
diff changeset
    18
			<information>%information</information>
cawthron
parents:
diff changeset
    19
			<wizardDescription>%information</wizardDescription>
cawthron
parents:
diff changeset
    20
		</documentation>
cawthron
parents:
diff changeset
    21
		<symbian sdkName="com.nokia.series60" minSDKVersion="2.0" 
cawthron
parents:
diff changeset
    22
			className="CAknDialog" classHelpTopic="" />
cawthron
parents:
diff changeset
    23
		<designerImages 
cawthron
parents:
diff changeset
    24
			smallIconFile="CAknDialog_sm.png" 
cawthron
parents:
diff changeset
    25
			largeIconFile="CAknDialog.png"/>
cawthron
parents:
diff changeset
    26
cawthron
parents:
diff changeset
    27
		<attributes>
cawthron
parents:
diff changeset
    28
			<attribute key="options-menu-property-name">optionsMenu</attribute>
cawthron
parents:
diff changeset
    29
			<attribute key="event-handler-target">true</attribute>
cawthron
parents:
diff changeset
    30
			<attribute key="base-container-class">CAknDialog</attribute>
cawthron
parents:
diff changeset
    31
		</attributes>
cawthron
parents:
diff changeset
    32
		<properties>
cawthron
parents:
diff changeset
    33
			<property category="Appearance" name="backColor" type="string" 
cawthron
parents:
diff changeset
    34
				editorClass="com.nokia.sdt.symbian.ui.editors.RGBEditorFactoryWithSystemColorCombo"/>
cawthron
parents:
diff changeset
    35
			<property category="Appearance" name="fillRect" type="boolean" default="true"/>
cawthron
parents:
diff changeset
    36
				<!-- corresponds to flag EEikDialogFlagFillAppClientRect 0x1000 -->
cawthron
parents:
diff changeset
    37
			<componentReferenceProperty category="Dialog" scope="children" constraint="com.nokia.sdt.series60.MenuBar" name="optionsMenu"/>
cawthron
parents:
diff changeset
    38
		</properties>
cawthron
parents:
diff changeset
    39
		<implementations>
cawthron
parents:
diff changeset
    40
			<implementation>
cawthron
parents:
diff changeset
    41
				<interface id="com.nokia.sdt.datamodel.adapter.IVisualAppearance"/>
cawthron
parents:
diff changeset
    42
				<interface id="com.nokia.sdt.datamodel.adapter.ILayout"/>
cawthron
parents:
diff changeset
    43
				<code class="com.nokia.sdt.series60.component.AknDialogVisualAndLayoutImplFactory"/>
cawthron
parents:
diff changeset
    44
			</implementation>
cawthron
parents:
diff changeset
    45
			<implementation>
cawthron
parents:
diff changeset
    46
				<interface id="com.nokia.sdt.datamodel.adapter.IQueryContainment"/>
cawthron
parents:
diff changeset
    47
				<script file="CAknDialog_queryContainment.js" prototype="CAknDialogQueryContainment"/>
cawthron
parents:
diff changeset
    48
			</implementation>
cawthron
parents:
diff changeset
    49
		</implementations>
cawthron
parents:
diff changeset
    50
		
cawthron
parents:
diff changeset
    51
		<sourceMapping>
cawthron
parents:
diff changeset
    52
			<mapResource struct="DIALOG" headers="avkon.rsg avkon.rh eikon.rh">
cawthron
parents:
diff changeset
    53
				<!-- TODO: flags -->
cawthron
parents:
diff changeset
    54
				<mapBitmaskMember property="." member="flags"
cawthron
parents:
diff changeset
    55
					includedProperties="fillRect wait notifyEsc modeless">
cawthron
parents:
diff changeset
    56
					<!-- initial blank entries force bits on -->
cawthron
parents:
diff changeset
    57
					<mapBitmaskValue properties="" value="EEikDialogFlagNoDrag" />
cawthron
parents:
diff changeset
    58
					<mapBitmaskValue properties="" value="EEikDialogFlagNoTitleBar" />
cawthron
parents:
diff changeset
    59
					<mapBitmaskValue properties="" value="EEikDialogFlagCbaButtons" />
cawthron
parents:
diff changeset
    60
					
cawthron
parents:
diff changeset
    61
					<mapBitmaskValue properties="notifyEsc" value="EEikDialogFlagNotifyEsc" />
cawthron
parents:
diff changeset
    62
					<mapBitmaskValue properties="modeless" value="EEikDialogFlagModeless" />
cawthron
parents:
diff changeset
    63
					<mapBitmaskValue properties="fillRect" value="EEikDialogFlagFillAppClientRect" />
cawthron
parents:
diff changeset
    64
					<mapBitmaskValue properties="wait" value="EEikDialogFlagWait" />
cawthron
parents:
diff changeset
    65
				</mapBitmaskMember>
cawthron
parents:
diff changeset
    66
	  		    <select property="[parent].[com.nokia.sdt.series60.CBA]">
cawthron
parents:
diff changeset
    67
	   		        <choice value="">
cawthron
parents:
diff changeset
    68
	  		          <!-- no CBA -->
cawthron
parents:
diff changeset
    69
	  		        </choice>
cawthron
parents:
diff changeset
    70
	  		        <choice>
cawthron
parents:
diff changeset
    71
			 		  <select property="[parent].[com.nokia.sdt.series60.CBA].info">
cawthron
parents:
diff changeset
    72
					    <choice value="com.nokia.sdt.series60.CBA.Type.CUSTOM">
cawthron
parents:
diff changeset
    73
					    	<!-- emit a reference to the resource generated -->
cawthron
parents:
diff changeset
    74
					        <mapReferenceMember property="[parent].[com.nokia.sdt.series60.CBA]" member="buttons"/>
cawthron
parents:
diff changeset
    75
					    </choice>
cawthron
parents:
diff changeset
    76
					    <choice>
cawthron
parents:
diff changeset
    77
							<!-- else, emit the builtin -->
cawthron
parents:
diff changeset
    78
							<mapIdentifierMember property="[parent].[com.nokia.sdt.series60.CBA].info" member="buttons" />
cawthron
parents:
diff changeset
    79
					    </choice> 
cawthron
parents:
diff changeset
    80
					  </select>
cawthron
parents:
diff changeset
    81
					</choice>
cawthron
parents:
diff changeset
    82
				</select>
cawthron
parents:
diff changeset
    83
				<mapArrayMember property="." member="items">
cawthron
parents:
diff changeset
    84
					<select attribute="is-dialog-content">
cawthron
parents:
diff changeset
    85
						<!-- only map visible items, not menu bars, etc. -->
cawthron
parents:
diff changeset
    86
						<choice value="true">
cawthron
parents:
diff changeset
    87
							<mapResourceElement struct="DLG_LINE" headers="avkon.rh"
cawthron
parents:
diff changeset
    88
								instanceIdentifyingMember="id" id="dialog_line">
cawthron
parents:
diff changeset
    89
								<!-- looking at the current array element, always
cawthron
parents:
diff changeset
    90
									create a unique value from the dialog and instance name -->
cawthron
parents:
diff changeset
    91
								<mapEnumMember property="." member="id"
cawthron
parents:
diff changeset
    92
									uniqueValue="*"
cawthron
parents:
diff changeset
    93
									nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_DIALOG_LINE_ID"
cawthron
parents:
diff changeset
    94
								/>
cawthron
parents:
diff changeset
    95
								<!-- looking at the current array element, get the
cawthron
parents:
diff changeset
    96
									enumerator for the instance's control type -->
cawthron
parents:
diff changeset
    97
								<mapEnumMember property="." member="type"
cawthron
parents:
diff changeset
    98
									nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE"
cawthron
parents:
diff changeset
    99
								/>
cawthron
parents:
diff changeset
   100
								<mapResourceMember property="." member="control"/>
cawthron
parents:
diff changeset
   101
							</mapResourceElement>
cawthron
parents:
diff changeset
   102
						</choice>
cawthron
parents:
diff changeset
   103
						<!-- default case does nothing -->
cawthron
parents:
diff changeset
   104
						<choice/>
cawthron
parents:
diff changeset
   105
					</select>						
cawthron
parents:
diff changeset
   106
				</mapArrayMember>
cawthron
parents:
diff changeset
   107
			
cawthron
parents:
diff changeset
   108
			</mapResource>
cawthron
parents:
diff changeset
   109
		</sourceMapping>
cawthron
parents:
diff changeset
   110
		
cawthron
parents:
diff changeset
   111
		<sourceGen forms="AppUi AknView RootAppUi">
cawthron
parents:
diff changeset
   112
		
cawthron
parents:
diff changeset
   113
			<!-- contributions as dialog -->
cawthron
parents:
diff changeset
   114
cawthron
parents:
diff changeset
   115
			<defineLocation id="HEADER_FILE" domain="cpp" dir="${inc}" 
cawthron
parents:
diff changeset
   116
				file="${instanceName}.h"
cawthron
parents:
diff changeset
   117
				owned="false"
cawthron
parents:
diff changeset
   118
				location="">
cawthron
parents:
diff changeset
   119
			</defineLocation>
cawthron
parents:
diff changeset
   120
			
cawthron
parents:
diff changeset
   121
			<template location="HEADER_FILE">
cawthron
parents:
diff changeset
   122
#ifndef ${instanceName.toUpperCase()}_H
cawthron
parents:
diff changeset
   123
#define ${instanceName.toUpperCase()}_H
cawthron
parents:
diff changeset
   124
cawthron
parents:
diff changeset
   125
			</template>
cawthron
parents:
diff changeset
   126
			
cawthron
parents:
diff changeset
   127
			<defineLocation id="HEADER_INCLUDES" baseLocation="HEADER_FILE"
cawthron
parents:
diff changeset
   128
				location="region(Generated Includes)"
cawthron
parents:
diff changeset
   129
				filter="unique-includes">
cawthron
parents:
diff changeset
   130
			</defineLocation>
cawthron
parents:
diff changeset
   131
			
cawthron
parents:
diff changeset
   132
			<template location="HEADER_INCLUDES"><![CDATA[
cawthron
parents:
diff changeset
   133
#include <akndialog.h>
cawthron
parents:
diff changeset
   134
]]>			</template>
cawthron
parents:
diff changeset
   135
		
cawthron
parents:
diff changeset
   136
			<defineLocation id="EVENT_INCLUDES" baseLocation="HEADER_FILE"
cawthron
parents:
diff changeset
   137
				owned="false"
cawthron
parents:
diff changeset
   138
				filter="unique-includes"
cawthron
parents:
diff changeset
   139
				location="region(Event Handler Includes)">
cawthron
parents:
diff changeset
   140
			</defineLocation>
cawthron
parents:
diff changeset
   141
			
cawthron
parents:
diff changeset
   142
			<template location="EVENT_INCLUDES" />
cawthron
parents:
diff changeset
   143
			
cawthron
parents:
diff changeset
   144
			<defineLocation id="HEADER_FORWARD_DECLARATIONS" baseLocation="HEADER_FILE"
cawthron
parents:
diff changeset
   145
				location="region(Generated Forward Declarations)">
cawthron
parents:
diff changeset
   146
			</defineLocation>	
cawthron
parents:
diff changeset
   147
				
cawthron
parents:
diff changeset
   148
			<template location="HEADER_FORWARD_DECLARATIONS"/>
cawthron
parents:
diff changeset
   149
			
cawthron
parents:
diff changeset
   150
	
cawthron
parents:
diff changeset
   151
			<defineLocation id="CLASS" baseLocation="HEADER_FILE"
cawthron
parents:
diff changeset
   152
				owned="false"
cawthron
parents:
diff changeset
   153
				location="class(${className})">
cawthron
parents:
diff changeset
   154
				<template><![CDATA[
cawthron
parents:
diff changeset
   155
/**
cawthron
parents:
diff changeset
   156
 * @class	${className} ${instanceName}.h
cawthron
parents:
diff changeset
   157
 */
cawthron
parents:
diff changeset
   158
class ${className} : public CAknDialog
cawthron
parents:
diff changeset
   159
	{
cawthron
parents:
diff changeset
   160
public:
cawthron
parents:
diff changeset
   161
	// constructors and destructor
cawthron
parents:
diff changeset
   162
	${className}();
cawthron
parents:
diff changeset
   163
	virtual ~${className}();
cawthron
parents:
diff changeset
   164
	void ConstructL();
cawthron
parents:
diff changeset
   165
	
cawthron
parents:
diff changeset
   166
	static TBool RunDlgLD();
cawthron
parents:
diff changeset
   167
	void LoadFromResourceL();
cawthron
parents:
diff changeset
   168
cawthron
parents:
diff changeset
   169
protected:
cawthron
parents:
diff changeset
   170
	// from CAknDialog
cawthron
parents:
diff changeset
   171
	void Draw( const TRect& aRect ) const;
cawthron
parents:
diff changeset
   172
	TBool OkToExitL( TInt aButtonId );
cawthron
parents:
diff changeset
   173
	void PreLayoutDynInitL();
cawthron
parents:
diff changeset
   174
	};
cawthron
parents:
diff changeset
   175
]]>
cawthron
parents:
diff changeset
   176
				</template>
cawthron
parents:
diff changeset
   177
			</defineLocation>
cawthron
parents:
diff changeset
   178
			
cawthron
parents:
diff changeset
   179
			<template location="CLASS"/>
cawthron
parents:
diff changeset
   180
cawthron
parents:
diff changeset
   181
			<defineLocation id="CLASS_IVARS" baseLocation="CLASS"
cawthron
parents:
diff changeset
   182
			location="region(Generated Instance Variables)">
cawthron
parents:
diff changeset
   183
				<template><![CDATA[
cawthron
parents:
diff changeset
   184
private: <% contrib.indentAdjust(-1); %>
cawthron
parents:
diff changeset
   185
]]>				</template>
cawthron
parents:
diff changeset
   186
			</defineLocation>
cawthron
parents:
diff changeset
   187
cawthron
parents:
diff changeset
   188
			<template location="CLASS_IVARS"/>
cawthron
parents:
diff changeset
   189
cawthron
parents:
diff changeset
   190
			<template location="HEADER_FILE">
cawthron
parents:
diff changeset
   191
#endif // ${instanceName.toUpperCase()}_H
cawthron
parents:
diff changeset
   192
			</template>
cawthron
parents:
diff changeset
   193
							
cawthron
parents:
diff changeset
   194
			<defineLocation id="MAIN_FILE" domain="cpp" dir="${src}" 
cawthron
parents:
diff changeset
   195
				file="${instanceName}.cpp"
cawthron
parents:
diff changeset
   196
				owned="false"
cawthron
parents:
diff changeset
   197
				location="">
cawthron
parents:
diff changeset
   198
			</defineLocation>
cawthron
parents:
diff changeset
   199
cawthron
parents:
diff changeset
   200
			<template location="MAIN_FILE"/>
cawthron
parents:
diff changeset
   201
			
cawthron
parents:
diff changeset
   202
			<defineLocation id="MAIN_SYSTEM_INCLUDES" baseLocation="MAIN_FILE"
cawthron
parents:
diff changeset
   203
				location="region(Generated System Includes)"
cawthron
parents:
diff changeset
   204
				filter="unique-includes">
cawthron
parents:
diff changeset
   205
				<template><![CDATA[
cawthron
parents:
diff changeset
   206
#include <aknappui.h>
cawthron
parents:
diff changeset
   207
]]>				</template>
cawthron
parents:
diff changeset
   208
				<template><![CDATA[
cawthron
parents:
diff changeset
   209
#include <avkon.hrh>
cawthron
parents:
diff changeset
   210
]]>				</template>
cawthron
parents:
diff changeset
   211
			</defineLocation>
cawthron
parents:
diff changeset
   212
cawthron
parents:
diff changeset
   213
			<template location="MAIN_SYSTEM_INCLUDES"/>
cawthron
parents:
diff changeset
   214
	
cawthron
parents:
diff changeset
   215
			<defineLocation id="MAIN_USER_INCLUDES" baseLocation="MAIN_FILE"
cawthron
parents:
diff changeset
   216
				location="region(Generated User Includes)"
cawthron
parents:
diff changeset
   217
				filter="unique-includes">
cawthron
parents:
diff changeset
   218
				<template><![CDATA[
cawthron
parents:
diff changeset
   219
#include "${instanceName}.h"
cawthron
parents:
diff changeset
   220
]]>				</template>
cawthron
parents:
diff changeset
   221
			</defineLocation>		
cawthron
parents:
diff changeset
   222
cawthron
parents:
diff changeset
   223
			<template location="MAIN_USER_INCLUDES"/>
cawthron
parents:
diff changeset
   224
			
cawthron
parents:
diff changeset
   225
			<inline>
cawthron
parents:
diff changeset
   226
if (Engine.formMatches(form, [""])) {
cawthron
parents:
diff changeset
   227
	this.getHrhFiles(contribs);
cawthron
parents:
diff changeset
   228
}
cawthron
parents:
diff changeset
   229
			</inline>
cawthron
parents:
diff changeset
   230
			
cawthron
parents:
diff changeset
   231
			<defineLocation id="CONSTANTS" baseLocation="MAIN_FILE"
cawthron
parents:
diff changeset
   232
				location="region(Generated Constants)">
cawthron
parents:
diff changeset
   233
			</defineLocation>
cawthron
parents:
diff changeset
   234
cawthron
parents:
diff changeset
   235
			<template location="CONSTANTS" />
cawthron
parents:
diff changeset
   236
cawthron
parents:
diff changeset
   237
			<defineLocation id="CONSTRUCTOR" baseLocation="MAIN_FILE"
cawthron
parents:
diff changeset
   238
				owned="false"
cawthron
parents:
diff changeset
   239
				location="function(${className}::${className}())">
cawthron
parents:
diff changeset
   240
				<template><![CDATA[
cawthron
parents:
diff changeset
   241
/**
cawthron
parents:
diff changeset
   242
 * Construct the ${className} instance
cawthron
parents:
diff changeset
   243
 */ 
cawthron
parents:
diff changeset
   244
${className}::${className}()
cawthron
parents:
diff changeset
   245
	{
cawthron
parents:
diff changeset
   246
	}
cawthron
parents:
diff changeset
   247
]]>
cawthron
parents:
diff changeset
   248
				</template>			
cawthron
parents:
diff changeset
   249
			</defineLocation>
cawthron
parents:
diff changeset
   250
			
cawthron
parents:
diff changeset
   251
			<template location="CONSTRUCTOR"/>
cawthron
parents:
diff changeset
   252
cawthron
parents:
diff changeset
   253
			<defineLocation id="CONSTRUCTOR_BODY" baseLocation="CONSTRUCTOR"
cawthron
parents:
diff changeset
   254
				location="region(Generated Contents)">
cawthron
parents:
diff changeset
   255
				<template>
cawthron
parents:
diff changeset
   256
iContextMenuCommandObserver = NULL;
cawthron
parents:
diff changeset
   257
				</template>
cawthron
parents:
diff changeset
   258
			</defineLocation>
cawthron
parents:
diff changeset
   259
					
cawthron
parents:
diff changeset
   260
			
cawthron
parents:
diff changeset
   261
			<defineLocation id="CONSTRUCTL" baseLocation="MAIN_FILE"
cawthron
parents:
diff changeset
   262
				owned="false"
cawthron
parents:
diff changeset
   263
				location="function(${className}::ConstructL())">
cawthron
parents:
diff changeset
   264
				<template><![CDATA[
cawthron
parents:
diff changeset
   265
/**
cawthron
parents:
diff changeset
   266
 * @brief Completes the second phase of Symbian object construction. 
cawthron
parents:
diff changeset
   267
 * Put initialization code that could leave here.  
cawthron
parents:
diff changeset
   268
 */ 
cawthron
parents:
diff changeset
   269
void ${className}::ConstructL()
cawthron
parents:
diff changeset
   270
	{
cawthron
parents:
diff changeset
   271
	}
cawthron
parents:
diff changeset
   272
]]>
cawthron
parents:
diff changeset
   273
				</template>			
cawthron
parents:
diff changeset
   274
			</defineLocation>
cawthron
parents:
diff changeset
   275
			
cawthron
parents:
diff changeset
   276
			<template location="CONSTRUCTL"/>
cawthron
parents:
diff changeset
   277
cawthron
parents:
diff changeset
   278
			<defineLocation id="CONSTRUCTL_BODY" baseLocation="CONSTRUCTL"
cawthron
parents:
diff changeset
   279
				location="region(Generated Contents)">
cawthron
parents:
diff changeset
   280
			</defineLocation>
cawthron
parents:
diff changeset
   281
cawthron
parents:
diff changeset
   282
			<inline scope="prototype">
cawthron
parents:
diff changeset
   283
include("containerLibrary.js")
cawthron
parents:
diff changeset
   284
			</inline>			
cawthron
parents:
diff changeset
   285
cawthron
parents:
diff changeset
   286
			<template location="CONSTRUCTL_BODY"><![CDATA[
cawthron
parents:
diff changeset
   287
<% var menuBarId = 
cawthron
parents:
diff changeset
   288
	Engine.getGeneratedResource(getInstanceFromChildName(children, properties.optionsMenu)); 
cawthron
parents:
diff changeset
   289
	// TODO children are not yet generated, so can't get the generated resource name for menuBar!
cawthron
parents:
diff changeset
   290
	if (menuBarId != null) { %>
cawthron
parents:
diff changeset
   291
CAknDialog::ConstructL( ${menuBarId.toUpperCase()} );
cawthron
parents:
diff changeset
   292
<%	} %>
cawthron
parents:
diff changeset
   293
]]>			</template>
cawthron
parents:
diff changeset
   294
cawthron
parents:
diff changeset
   295
cawthron
parents:
diff changeset
   296
			<defineLocation id="DESTRUCTOR" baseLocation="MAIN_FILE"
cawthron
parents:
diff changeset
   297
				owned="false"
cawthron
parents:
diff changeset
   298
				location="function(${className}::~${className}())">
cawthron
parents:
diff changeset
   299
				<template><![CDATA[
cawthron
parents:
diff changeset
   300
/** 
cawthron
parents:
diff changeset
   301
 * The dialog's destructor removes the container from the control
cawthron
parents:
diff changeset
   302
 * stack and destroys it.
cawthron
parents:
diff changeset
   303
 */
cawthron
parents:
diff changeset
   304
${className}::~${className}()
cawthron
parents:
diff changeset
   305
	{
cawthron
parents:
diff changeset
   306
	}
cawthron
parents:
diff changeset
   307
]]>
cawthron
parents:
diff changeset
   308
				</template>			
cawthron
parents:
diff changeset
   309
			</defineLocation>
cawthron
parents:
diff changeset
   310
			
cawthron
parents:
diff changeset
   311
			<template location="DESTRUCTOR"/>
cawthron
parents:
diff changeset
   312
cawthron
parents:
diff changeset
   313
			<defineLocation id="DESTRUCTOR_BODY" baseLocation="DESTRUCTOR"
cawthron
parents:
diff changeset
   314
				location="region(Generated Contents)">
cawthron
parents:
diff changeset
   315
			</defineLocation>
cawthron
parents:
diff changeset
   316
			
cawthron
parents:
diff changeset
   317
			<defineLocation id="RUNDLGLD" baseLocation="MAIN_FILE"
cawthron
parents:
diff changeset
   318
				owned="false"
cawthron
parents:
diff changeset
   319
				location="function(${className}::RunDlgLD())">
cawthron
parents:
diff changeset
   320
				<template><![CDATA[
cawthron
parents:
diff changeset
   321
/**
cawthron
parents:
diff changeset
   322
* Static construction and execution of the dialog. 
cawthron
parents:
diff changeset
   323
* @return ETrue if the dialog is accepted, EFalse if canceled
cawthron
parents:
diff changeset
   324
*/
cawthron
parents:
diff changeset
   325
TBool ${className}::RunDlgLD()
cawthron
parents:
diff changeset
   326
	{
cawthron
parents:
diff changeset
   327
	${className}* ${instanceName} = new ( ELeave ) ${className}();
cawthron
parents:
diff changeset
   328
	return ${instanceName}->ExecuteLD( ${resourceName$upper} );
cawthron
parents:
diff changeset
   329
	}
cawthron
parents:
diff changeset
   330
]]>				
cawthron
parents:
diff changeset
   331
				</template>			
cawthron
parents:
diff changeset
   332
			</defineLocation>
cawthron
parents:
diff changeset
   333
			
cawthron
parents:
diff changeset
   334
			<template location="RUNDLGLD"/>
cawthron
parents:
diff changeset
   335
cawthron
parents:
diff changeset
   336
cawthron
parents:
diff changeset
   337
			<defineLocation id="DRAW_BODY" baseLocation="DRAW"
cawthron
parents:
diff changeset
   338
				location="region(Generated Contents)">
cawthron
parents:
diff changeset
   339
			</defineLocation>
cawthron
parents:
diff changeset
   340
cawthron
parents:
diff changeset
   341
			<useTemplate ids="DrawBodyBgColor"/>
cawthron
parents:
diff changeset
   342
			
cawthron
parents:
diff changeset
   343
			<defineLocation id="OKTOEXITL" baseLocation="MAIN_FILE"
cawthron
parents:
diff changeset
   344
				owned="false"
cawthron
parents:
diff changeset
   345
				location="function(${className}::OkToExitL(TInt))">
cawthron
parents:
diff changeset
   346
				<template><![CDATA[
cawthron
parents:
diff changeset
   347
/**
cawthron
parents:
diff changeset
   348
 * Handle a button press and tell whether it closes the dialog.  (override)  
cawthron
parents:
diff changeset
   349
 * @param aButtonId the identifier for the button (avkon.hrh)
cawthron
parents:
diff changeset
   350
 */
cawthron
parents:
diff changeset
   351
TBool ${className}::OkToExitL( TInt aButtonId )
cawthron
parents:
diff changeset
   352
	{
cawthron
parents:
diff changeset
   353
	}
cawthron
parents:
diff changeset
   354
]]>				
cawthron
parents:
diff changeset
   355
				</template>			
cawthron
parents:
diff changeset
   356
			</defineLocation>
cawthron
parents:
diff changeset
   357
			
cawthron
parents:
diff changeset
   358
			<template location="OKTOEXITL"/>
cawthron
parents:
diff changeset
   359
			
cawthron
parents:
diff changeset
   360
			<defineLocation id="OKTOEXITL_BODY" baseLocation="OKTOEXITL"
cawthron
parents:
diff changeset
   361
				location="region(Generated Contents)">
cawthron
parents:
diff changeset
   362
			</defineLocation>
cawthron
parents:
diff changeset
   363
		
cawthron
parents:
diff changeset
   364
<!-- TODO: need to check for CBA overrides -->
cawthron
parents:
diff changeset
   365
			<template location="OKTOEXITL_BODY" form="AppUi"><![CDATA[
cawthron
parents:
diff changeset
   366
switch ( aButtonId )
cawthron
parents:
diff changeset
   367
	{
cawthron
parents:
diff changeset
   368
	case EAknSoftkeyOptions:
cawthron
parents:
diff changeset
   369
		iAvkonAppUi->ProcessCommandL( EAknSoftkeyOptions );
cawthron
parents:
diff changeset
   370
		break;
cawthron
parents:
diff changeset
   371
	case EAknSoftkeyBack:
cawthron
parents:
diff changeset
   372
		iAvkonAppUi->ProcessCommandL( EEikCmdExit );
cawthron
parents:
diff changeset
   373
		break;
cawthron
parents:
diff changeset
   374
	}
cawthron
parents:
diff changeset
   375
cawthron
parents:
diff changeset
   376
// Do not exit the application; this is the main window.  
cawthron
parents:
diff changeset
   377
// AppUi determines when to exit based on the EEikCmdExit command above.
cawthron
parents:
diff changeset
   378
return EFalse;
cawthron
parents:
diff changeset
   379
]]>			</template>			
cawthron
parents:
diff changeset
   380
		
cawthron
parents:
diff changeset
   381
			<inline scope="prototype">
cawthron
parents:
diff changeset
   382
include("../cba/cbaLibrary.js")
cawthron
parents:
diff changeset
   383
			</inline>			
cawthron
parents:
diff changeset
   384
cawthron
parents:
diff changeset
   385
			<template location="OKTOEXITL_BODY" form="AknView"><![CDATA[
cawthron
parents:
diff changeset
   386
switch ( aButtonId )
cawthron
parents:
diff changeset
   387
	{
cawthron
parents:
diff changeset
   388
<%			// "handle" left command id
cawthron
parents:
diff changeset
   389
			var id = findCbaLeftId(children);
cawthron
parents:
diff changeset
   390
			if (id != null && id != "") {
cawthron
parents:
diff changeset
   391
%>	case ${id}:
cawthron
parents:
diff changeset
   392
		{
cawthron
parents:
diff changeset
   393
		// handle left button
cawthron
parents:
diff changeset
   394
		break;
cawthron
parents:
diff changeset
   395
		}
cawthron
parents:
diff changeset
   396
<%	}		// "handle" right command id
cawthron
parents:
diff changeset
   397
			id = findCbaRightId(children);
cawthron
parents:
diff changeset
   398
			if (id == null) 
cawthron
parents:
diff changeset
   399
				id = "EAknSoftkeyExit";
cawthron
parents:
diff changeset
   400
			var rightShouldExit = (id == null || id == "EAknSoftkeyExit" || id == "EAknSoftkeyBack");
cawthron
parents:
diff changeset
   401
%>	case ${id}:
cawthron
parents:
diff changeset
   402
		{
cawthron
parents:
diff changeset
   403
		// handle right button<% if (rightShouldExit) { %>
cawthron
parents:
diff changeset
   404
		iAvkonAppUi->ProcessCommandL( EEikCmdExit );<% } %>
cawthron
parents:
diff changeset
   405
		break;
cawthron
parents:
diff changeset
   406
		}
cawthron
parents:
diff changeset
   407
	}	
cawthron
parents:
diff changeset
   408
return EFalse;
cawthron
parents:
diff changeset
   409
]]>			</template>			
cawthron
parents:
diff changeset
   410
		
cawthron
parents:
diff changeset
   411
			
cawthron
parents:
diff changeset
   412
	
cawthron
parents:
diff changeset
   413
	
cawthron
parents:
diff changeset
   414
			<defineLocation id="PRELAYOUTDYNINITL" baseLocation="MAIN_FILE"
cawthron
parents:
diff changeset
   415
				owned="false"
cawthron
parents:
diff changeset
   416
				location="function(${className}::PreLayoutDynInitL())">
cawthron
parents:
diff changeset
   417
				<template><![CDATA[
cawthron
parents:
diff changeset
   418
/**
cawthron
parents:
diff changeset
   419
 * Initialize controls and settings before a dialog is laid out.  (override)
cawthron
parents:
diff changeset
   420
 */
cawthron
parents:
diff changeset
   421
void ${className}::PreLayoutDynInitL()
cawthron
parents:
diff changeset
   422
	{
cawthron
parents:
diff changeset
   423
	}
cawthron
parents:
diff changeset
   424
]]>				
cawthron
parents:
diff changeset
   425
				</template>			
cawthron
parents:
diff changeset
   426
			</defineLocation>
cawthron
parents:
diff changeset
   427
			
cawthron
parents:
diff changeset
   428
			<template location="PRELAYOUTDYNINITL"/>
cawthron
parents:
diff changeset
   429
			
cawthron
parents:
diff changeset
   430
			<defineLocation id="PRELAYOUTDYNINITL_BODY" baseLocation="PRELAYOUTDYNINITL"
cawthron
parents:
diff changeset
   431
				location="region(Generated Contents)">
cawthron
parents:
diff changeset
   432
			</defineLocation>
cawthron
parents:
diff changeset
   433
cawthron
parents:
diff changeset
   434
			<template location="PRELAYOUTDYNINITL_BODY"/>
cawthron
parents:
diff changeset
   435
cawthron
parents:
diff changeset
   436
			<defineLocation id="DRAW" baseLocation="MAIN_FILE"
cawthron
parents:
diff changeset
   437
				owned="false"
cawthron
parents:
diff changeset
   438
				location="function(${className}::Draw(const TRect&amp;))">
cawthron
parents:
diff changeset
   439
				<template><![CDATA[
cawthron
parents:
diff changeset
   440
void ${className}::Draw( const TRect& aRect ) const
cawthron
parents:
diff changeset
   441
	{
cawthron
parents:
diff changeset
   442
	}
cawthron
parents:
diff changeset
   443
]]>				
cawthron
parents:
diff changeset
   444
				</template>
cawthron
parents:
diff changeset
   445
			</defineLocation>
cawthron
parents:
diff changeset
   446
cawthron
parents:
diff changeset
   447
cawthron
parents:
diff changeset
   448
			<defineLocation id="LOADFROMRESOURCEL" baseLocation="MAIN_FILE"
cawthron
parents:
diff changeset
   449
				location="function(${className}::LoadFromResourceL())">
cawthron
parents:
diff changeset
   450
				<template>
cawthron
parents:
diff changeset
   451
void ${className}::LoadFromResourceL()
cawthron
parents:
diff changeset
   452
	{
cawthron
parents:
diff changeset
   453
	}
cawthron
parents:
diff changeset
   454
				</template>
cawthron
parents:
diff changeset
   455
			</defineLocation>
cawthron
parents:
diff changeset
   456
			
cawthron
parents:
diff changeset
   457
			<template form="AppUi" location="LOADFROMRESOURCEL">
cawthron
parents:
diff changeset
   458
ExecuteLD( ${resourceName.toUpperCase()} );
cawthron
parents:
diff changeset
   459
			</template>
cawthron
parents:
diff changeset
   460
		
cawthron
parents:
diff changeset
   461
			<!-- gather child contributions -->
cawthron
parents:
diff changeset
   462
cawthron
parents:
diff changeset
   463
			<inline scope="prototype">
cawthron
parents:
diff changeset
   464
			include("../srcgenLibrary.js");
cawthron
parents:
diff changeset
   465
			</inline>
cawthron
parents:
diff changeset
   466
cawthron
parents:
diff changeset
   467
			<inline>
cawthron
parents:
diff changeset
   468
cawthron
parents:
diff changeset
   469
			if (form != 'RootAppUi') {
cawthron
parents:
diff changeset
   470
				if (Engine.formMatches(form, [ "AknView", "AppUi" ])) {
cawthron
parents:
diff changeset
   471
					// clear out any image stuff
cawthron
parents:
diff changeset
   472
					resetImagePropertyState(instance);
cawthron
parents:
diff changeset
   473
					
cawthron
parents:
diff changeset
   474
					// get default and dialog-specific contributions
cawthron
parents:
diff changeset
   475
					contribs.addAll(Engine.generateChildContributions(form+"|Dialog"))
cawthron
parents:
diff changeset
   476
				} else {
cawthron
parents:
diff changeset
   477
					// get specific desired contributions
cawthron
parents:
diff changeset
   478
					contribs.addAll(Engine.generateChildContributions(form))
cawthron
parents:
diff changeset
   479
				}
cawthron
parents:
diff changeset
   480
				
cawthron
parents:
diff changeset
   481
				// fix up the phases so they point to real locations
cawthron
parents:
diff changeset
   482
				Engine.assignLocationsForPhase(contribs, "ClassSource", "MAIN_FILE");
cawthron
parents:
diff changeset
   483
				Engine.assignLocationsForPhase(contribs, "ClassHeader", "HEADER_FILE");
cawthron
parents:
diff changeset
   484
cawthron
parents:
diff changeset
   485
				Engine.assignLocationsForPhase(contribs, "MainConstants", "CONSTANTS");
cawthron
parents:
diff changeset
   486
				Engine.assignLocationsForPhase(contribs, "MainSystemIncludes", "MAIN_SYSTEM_INCLUDES");
cawthron
parents:
diff changeset
   487
				Engine.assignLocationsForPhase(contribs, "MainUserIncludes", "MAIN_USER_INCLUDES");
cawthron
parents:
diff changeset
   488
				Engine.assignLocationsForPhase(contribs, "Construct", "CONSTRUCTOR_BODY");
cawthron
parents:
diff changeset
   489
				Engine.assignLocationsForPhase(contribs, "Initialize", "PRELAYOUTDYNINITL_BODY");
cawthron
parents:
diff changeset
   490
				Engine.assignLocationsForPhase(contribs, "HeaderIncludes", "HEADER_INCLUDES");
cawthron
parents:
diff changeset
   491
				Engine.assignLocationsForPhase(contribs, "EventIncludes", "EVENT_INCLUDES");
cawthron
parents:
diff changeset
   492
				Engine.assignLocationsForPhase(contribs, "ForwardDeclarations", "HEADER_FORWARD_DECLARATIONS");
cawthron
parents:
diff changeset
   493
				Engine.assignLocationsForPhase(contribs, "InstanceVariables", "CLASS_IVARS");
cawthron
parents:
diff changeset
   494
	
cawthron
parents:
diff changeset
   495
				//Engine.removeDuplicateContributionsForLocation(contribs, "HEADER_INCLUDES");
cawthron
parents:
diff changeset
   496
				Engine.removeDuplicateContributionsForLocation(contribs, "HEADER_FORWARD_DECLARATIONS");
cawthron
parents:
diff changeset
   497
				//Engine.removeDuplicateContributionsForLocation(contribs, "MAIN_SYSTEM_INCLUDES");
cawthron
parents:
diff changeset
   498
				//Engine.removeDuplicateContributionsForLocation(contribs, "MAIN_USER_INCLUDES");
cawthron
parents:
diff changeset
   499
			}
cawthron
parents:
diff changeset
   500
						
cawthron
parents:
diff changeset
   501
			</inline>
cawthron
parents:
diff changeset
   502
cawthron
parents:
diff changeset
   503
			<template id="IncludeRsgFile" location="MAIN_SYSTEM_INCLUDES"><![CDATA[
cawthron
parents:
diff changeset
   504
#include <${resourceFileNameBase}.rsg>
cawthron
parents:
diff changeset
   505
]]>			</template>
cawthron
parents:
diff changeset
   506
cawthron
parents:
diff changeset
   507
			<!-- contributions as child  -->
cawthron
parents:
diff changeset
   508
cawthron
parents:
diff changeset
   509
			<template form="AknView" phase="MainUserIncludes">
cawthron
parents:
diff changeset
   510
#include "${instanceName}.h"
cawthron
parents:
diff changeset
   511
			</template>
cawthron
parents:
diff changeset
   512
cawthron
parents:
diff changeset
   513
			<template form="AknView" phase="ForwardDeclarations">
cawthron
parents:
diff changeset
   514
class ${className};
cawthron
parents:
diff changeset
   515
			</template>
cawthron
parents:
diff changeset
   516
cawthron
parents:
diff changeset
   517
			<template form="AknView" phase="InstanceVariables">
cawthron
parents:
diff changeset
   518
${className}* ${instanceMemberName};
cawthron
parents:
diff changeset
   519
			</template>
cawthron
parents:
diff changeset
   520
cawthron
parents:
diff changeset
   521
			<template form="AknView" phase="DoActivateL"><![CDATA[
cawthron
parents:
diff changeset
   522
if ( ${instanceMemberName} == NULL )
cawthron
parents:
diff changeset
   523
	{
cawthron
parents:
diff changeset
   524
	${instanceMemberName} = new ${className}();
cawthron
parents:
diff changeset
   525
	${instanceMemberName}->SetMopParent( this ); <%
cawthron
parents:
diff changeset
   526
if ( properties.wait ) {
cawthron
parents:
diff changeset
   527
	var sb = newStatusBuilder();
cawthron
parents:
diff changeset
   528
	sb.add(IStatus.ERROR, lookupString("waitPropertySetInView"), [ instanceName ]);
cawthron
parents:
diff changeset
   529
	logStatus(sb.createStatus("", null));
cawthron
parents:
diff changeset
   530
	} %>
cawthron
parents:
diff changeset
   531
	${instanceMemberName}->ExecuteLD( ${resourceName.toUpperCase()} );
cawthron
parents:
diff changeset
   532
	AppUi()->AddToStackL( *this, ${instanceMemberName} );
cawthron
parents:
diff changeset
   533
	} 
cawthron
parents:
diff changeset
   534
]]>			</template>
cawthron
parents:
diff changeset
   535
			
cawthron
parents:
diff changeset
   536
			<template form="AknView" phase="DoDeactivate">
cawthron
parents:
diff changeset
   537
if ( ${instanceMemberName} != NULL )
cawthron
parents:
diff changeset
   538
	{
cawthron
parents:
diff changeset
   539
	AppUi()->RemoveFromViewStack( *this, ${instanceMemberName} );
cawthron
parents:
diff changeset
   540
	delete ${instanceMemberName};
cawthron
parents:
diff changeset
   541
	${instanceMemberName} = NULL;
cawthron
parents:
diff changeset
   542
	}
cawthron
parents:
diff changeset
   543
			</template>
cawthron
parents:
diff changeset
   544
cawthron
parents:
diff changeset
   545
cawthron
parents:
diff changeset
   546
			<template form="RootAppUi" phase="MainUserIncludes">
cawthron
parents:
diff changeset
   547
#include "${instanceName}.h"
cawthron
parents:
diff changeset
   548
			</template>
cawthron
parents:
diff changeset
   549
cawthron
parents:
diff changeset
   550
			<template form="RootAppUi" phase="ForwardDeclarations">
cawthron
parents:
diff changeset
   551
class ${className};
cawthron
parents:
diff changeset
   552
			</template>
cawthron
parents:
diff changeset
   553
cawthron
parents:
diff changeset
   554
			<template form="RootAppUi" phase="InstanceVariables">
cawthron
parents:
diff changeset
   555
${className}* ${instanceMemberName};
cawthron
parents:
diff changeset
   556
			</template>
cawthron
parents:
diff changeset
   557
cawthron
parents:
diff changeset
   558
cawthron
parents:
diff changeset
   559
			<!-- NOTE: this only makes sense when this is the initial view -->
cawthron
parents:
diff changeset
   560
			<template form="RootAppUi" phase="Initialize">
cawthron
parents:
diff changeset
   561
${instanceMemberName} = new ( ELeave ) ${className};
cawthron
parents:
diff changeset
   562
${instanceMemberName}->ConstructL();
cawthron
parents:
diff changeset
   563
${instanceMemberName}->SetMopParent( this );
cawthron
parents:
diff changeset
   564
${instanceMemberName}->LoadFromResourceL();
cawthron
parents:
diff changeset
   565
AddToStackL( ${instanceMemberName} );
cawthron
parents:
diff changeset
   566
			</template>
cawthron
parents:
diff changeset
   567
cawthron
parents:
diff changeset
   568
			<template form="RootAppUi" phase="Destroy">
cawthron
parents:
diff changeset
   569
if ( ${instanceMemberName} != NULL )
cawthron
parents:
diff changeset
   570
	{
cawthron
parents:
diff changeset
   571
	RemoveFromStack( ${instanceMemberName} );
cawthron
parents:
diff changeset
   572
	delete ${instanceMemberName};
cawthron
parents:
diff changeset
   573
	${instanceMemberName} = NULL;
cawthron
parents:
diff changeset
   574
	}
cawthron
parents:
diff changeset
   575
			</template>
cawthron
parents:
diff changeset
   576
cawthron
parents:
diff changeset
   577
			<useTemplateGroup ids="GeneratePrepareForFocusTransition GeneratePageChanged GenerateLineChanged"/>
cawthron
parents:
diff changeset
   578
			<useTemplateGroup ids="GenerateProcessCommand GenerateOfferKeyToApp"/>
cawthron
parents:
diff changeset
   579
			<useTemplateGroup ids="GenerateFocusChanged"/>
cawthron
parents:
diff changeset
   580
			<useTemplateGroup ids="GenerateSizeChanged GeneratePositionChanged"/>
cawthron
parents:
diff changeset
   581
			<useTemplateGroup ids="GenerateDraw GenerateOfferKeyEvent"/>
cawthron
parents:
diff changeset
   582
			<useTemplateGroup ids="GeneratePrepareForFocusLoss GeneratePrepareForFocusGain"/>
cawthron
parents:
diff changeset
   583
cawthron
parents:
diff changeset
   584
		</sourceGen>
cawthron
parents:
diff changeset
   585
	</component>
cawthron
parents:
diff changeset
   586
</componentDefinition>