uidesigner/com.nokia.sdt.series60.componentlibrary/components/transient/WaitDialog.component
author wpaul
Wed, 08 Apr 2009 10:40:18 -0500
branchRCL_2_0
changeset 77 e2b416032b5b
parent 2 d760517a8095
permissions -rw-r--r--
the rest of the fix for bug #8694
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:xsi="http://www.w3.org/2001/XMLSchema-instance">
cawthron
parents:
diff changeset
    11
cawthron
parents:
diff changeset
    12
	<component baseComponent="com.nokia.sdt.series60.NonLayoutBase" 
cawthron
parents:
diff changeset
    13
		friendlyName="%friendlyName" 
cawthron
parents:
diff changeset
    14
		qualifiedName="com.nokia.sdt.series60.WaitDialog" 
cawthron
parents:
diff changeset
    15
		category="NotesDialogs"
cawthron
parents:
diff changeset
    16
		instanceNameRoot="waitDialog"
cawthron
parents:
diff changeset
    17
		version="1.0">
cawthron
parents:
diff changeset
    18
		<documentation>
cawthron
parents:
diff changeset
    19
			<information>%information</information>
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="CAknWaitDialog" classHelpTopic=""
cawthron
parents:
diff changeset
    23
			resourceType="AVKON_CONFIRMATION_QUERY" resourceHelpTopic="" />
cawthron
parents:
diff changeset
    24
		<designerImages smallIconFile="WaitDialog_sm.png" 
cawthron
parents:
diff changeset
    25
			largeIconFile="WaitDialog.png"/>
cawthron
parents:
diff changeset
    26
		<attributes>
cawthron
parents:
diff changeset
    27
			<attribute key="is-transient-object">true</attribute>
cawthron
parents:
diff changeset
    28
			<attribute key="is-non-resizable-or-moveable-layout-object">true</attribute>
cawthron
parents:
diff changeset
    29
		</attributes>
cawthron
parents:
diff changeset
    30
		
cawthron
parents:
diff changeset
    31
		<properties>
cawthron
parents:
diff changeset
    32
			<compoundProperty name="location" type="com.nokia.sdt.series60.locationProperty" category="Hidden"
cawthron
parents:
diff changeset
    33
				editorClass="com.nokia.sdt.symbian.ui.editors.ReadOnlySummaryEditorFactory"/>
cawthron
parents:
diff changeset
    34
			<compoundProperty name="size" type="com.nokia.sdt.series60.sizeProperty" category="Hidden"
cawthron
parents:
diff changeset
    35
				editorClass="com.nokia.sdt.symbian.ui.editors.ReadOnlySummaryEditorFactory"/>
cawthron
parents:
diff changeset
    36
			<property name="text" type="localizedString" default="Please wait..." category="Data"
cawthron
parents:
diff changeset
    37
				descriptionKey="textDescription"
cawthron
parents:
diff changeset
    38
				editorClass="com.nokia.sdt.symbian.ui.editors.ScalableTextEditorFactory" />
cawthron
parents:
diff changeset
    39
			<enumProperty name="tone" type="com.nokia.sdt.series60.Query.tone" category="Data"
cawthron
parents:
diff changeset
    40
				descriptionKey="toneDescription" />
cawthron
parents:
diff changeset
    41
			<property name="visibilityDelay" type="boolean" category="Behavior"
cawthron
parents:
diff changeset
    42
				descriptionKey="visibilityDelayDescription" default="true" />
cawthron
parents:
diff changeset
    43
			<property name="canceledHandlerCode" type="string" category="Hidden"/>
cawthron
parents:
diff changeset
    44
		</properties>
cawthron
parents:
diff changeset
    45
		
cawthron
parents:
diff changeset
    46
		<events defaultEventName="canceled">
cawthron
parents:
diff changeset
    47
			<event name="canceled" category="Basic" 
cawthron
parents:
diff changeset
    48
				   handlerNameTemplate="Handle{title(name)}CanceledL"
cawthron
parents:
diff changeset
    49
			    descriptionKey="canceledDescription"
cawthron
parents:
diff changeset
    50
				/>
cawthron
parents:
diff changeset
    51
		</events>
cawthron
parents:
diff changeset
    52
		
cawthron
parents:
diff changeset
    53
		<implementations>
cawthron
parents:
diff changeset
    54
			<implementation>
cawthron
parents:
diff changeset
    55
				<interface id="com.nokia.sdt.datamodel.adapter.IVisualAppearance"/>
cawthron
parents:
diff changeset
    56
				<interface id="com.nokia.sdt.datamodel.adapter.IDirectLabelEdit"/>
cawthron
parents:
diff changeset
    57
				<interface id="com.nokia.sdt.datamodel.adapter.ILayout"/>
cawthron
parents:
diff changeset
    58
				<interface id="com.nokia.sdt.datamodel.adapter.IComponentInstancePropertyListener"/> 
cawthron
parents:
diff changeset
    59
				<script file="WaitDialog.js" prototype="WaitDialog"/>
cawthron
parents:
diff changeset
    60
			</implementation>
cawthron
parents:
diff changeset
    61
		</implementations>
cawthron
parents:
diff changeset
    62
		
cawthron
parents:
diff changeset
    63
		<sourceMapping>
cawthron
parents:
diff changeset
    64
			<mapResource struct="DIALOG" headers="avkon.rh avkon.rsg eikon.rh">
cawthron
parents:
diff changeset
    65
				<mapBitmaskMember property="." member="flags" includedProperties="" >
cawthron
parents:
diff changeset
    66
					<!-- initial blank entry forces bits on -->
cawthron
parents:
diff changeset
    67
					<mapBitmaskValue properties="" value="EAknWaitNoteFlags" />
cawthron
parents:
diff changeset
    68
				</mapBitmaskMember>
cawthron
parents:
diff changeset
    69
				<mapFixedMember member="buttons" value="R_AVKON_SOFTKEYS_CANCEL" />			
cawthron
parents:
diff changeset
    70
		        <mapResourceMember property="." member="items[0]" struct="DLG_LINE" headers="avkon.rh">
cawthron
parents:
diff changeset
    71
					<mapFixedMember member="type" value="EAknCtNote" />			
cawthron
parents:
diff changeset
    72
					<mapEnumMember property="." member="id" uniqueValue="*"
cawthron
parents:
diff changeset
    73
						nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_DIALOG_LINE_ID" />
cawthron
parents:
diff changeset
    74
		        	<mapResourceMember property="." member="control" struct="AVKON_NOTE" headers="avkon.rh">
cawthron
parents:
diff changeset
    75
						<mapFixedMember member="layout" value="EWaitLayout" />			
cawthron
parents:
diff changeset
    76
						<mapSimpleMember property="text" member="singular_label" />
cawthron
parents:
diff changeset
    77
						<mapFixedMember member="animation" value="R_QGN_GRAF_WAIT_BAR_ANIM" />
cawthron
parents:
diff changeset
    78
			        </mapResourceMember>
cawthron
parents:
diff changeset
    79
		        </mapResourceMember>
cawthron
parents:
diff changeset
    80
			</mapResource>
cawthron
parents:
diff changeset
    81
		</sourceMapping>
cawthron
parents:
diff changeset
    82
		
cawthron
parents:
diff changeset
    83
		<sourceGen>
cawthron
parents:
diff changeset
    84
		
cawthron
parents:
diff changeset
    85
			<template phase="HeaderIncludes"><![CDATA[
cawthron
parents:
diff changeset
    86
#include <aknwaitdialog.h>
cawthron
parents:
diff changeset
    87
]]>			</template>
cawthron
parents:
diff changeset
    88
cawthron
parents:
diff changeset
    89
			<template phase="ClassMethods">
cawthron
parents:
diff changeset
    90
void Execute${instanceName$title}LD( const TDesC* aOverrideText = NULL );
cawthron
parents:
diff changeset
    91
void Remove${instanceName$title}L();
cawthron
parents:
diff changeset
    92
			</template>
cawthron
parents:
diff changeset
    93
			
cawthron
parents:
diff changeset
    94
			<template phase="InstanceVariables">
cawthron
parents:
diff changeset
    95
CAknWaitDialog* ${instanceMemberName};
cawthron
parents:
diff changeset
    96
			</template>	
cawthron
parents:
diff changeset
    97
			
cawthron
parents:
diff changeset
    98
				<template phase="Destroy">
cawthron
parents:
diff changeset
    99
TRAPD( err_${instanceName$title}, Remove${instanceName$title}L() );
cawthron
parents:
diff changeset
   100
				</template>
cawthron
parents:
diff changeset
   101
			
cawthron
parents:
diff changeset
   102
			<defineLocation id="ExecuteMethodLocation" baseLocation="MAIN_FILE" 
cawthron
parents:
diff changeset
   103
				owned="true"
cawthron
parents:
diff changeset
   104
				location="function(${className}::Execute${instanceName$title}LD(const TDesC*))">
cawthron
parents:
diff changeset
   105
				<template>
cawthron
parents:
diff changeset
   106
/**
cawthron
parents:
diff changeset
   107
 * Execute the wait dialog for ${instanceName}. This routine returns
cawthron
parents:
diff changeset
   108
 * while the dialog is showing. It will be closed and destroyed when
cawthron
parents:
diff changeset
   109
 * Remove${instanceName$title}L() or the user selects the Cancel soft key.
cawthron
parents:
diff changeset
   110
 * @param aOverrideText optional override text. When null the text configured
cawthron
parents:
diff changeset
   111
 * in the UI Designer is used.
cawthron
parents:
diff changeset
   112
 */
cawthron
parents:
diff changeset
   113
void ${className}::Execute${instanceName$title}LD( const TDesC* aOverrideText )
cawthron
parents:
diff changeset
   114
	{
cawthron
parents:
diff changeset
   115
	}
cawthron
parents:
diff changeset
   116
				</template>
cawthron
parents:
diff changeset
   117
			</defineLocation>
cawthron
parents:
diff changeset
   118
			<template location="ExecuteMethodLocation"><![CDATA[
cawthron
parents:
diff changeset
   119
<% var visibilityDelayOff = (!instance.properties.visibilityDelay) ? "ETrue" : "EFalse"; 
cawthron
parents:
diff changeset
   120
%>${instanceMemberName} = new ( ELeave ) CAknWaitDialog( 
cawthron
parents:
diff changeset
   121
		reinterpret_cast< CEikDialog** >( &${instanceMemberName} ), ${visibilityDelayOff} );
cawthron
parents:
diff changeset
   122
<% if (properties.tone != "ENoTone") { 
cawthron
parents:
diff changeset
   123
%>${instanceMemberName}->SetTone( CAknNoteDialog::${properties.tone} );
cawthron
parents:
diff changeset
   124
<% } 
cawthron
parents:
diff changeset
   125
%>if ( aOverrideText != NULL )
cawthron
parents:
diff changeset
   126
	{
cawthron
parents:
diff changeset
   127
	${instanceMemberName}->SetTextL( *aOverrideText );
cawthron
parents:
diff changeset
   128
	}
cawthron
parents:
diff changeset
   129
${instanceMemberName}->ExecuteLD( ${resourceName$upper} );
cawthron
parents:
diff changeset
   130
]]>			</template>
cawthron
parents:
diff changeset
   131
cawthron
parents:
diff changeset
   132
			<defineLocation id="RemoveMethodLocation" baseLocation="MAIN_FILE" 
cawthron
parents:
diff changeset
   133
				owned="true"
cawthron
parents:
diff changeset
   134
				location="function(${className}::Remove${instanceName$title}L())">
cawthron
parents:
diff changeset
   135
				<template>
cawthron
parents:
diff changeset
   136
/**
cawthron
parents:
diff changeset
   137
 * Close and dispose of the wait dialog for ${instanceName}
cawthron
parents:
diff changeset
   138
 */
cawthron
parents:
diff changeset
   139
void ${className}::Remove${instanceName$title}L()
cawthron
parents:
diff changeset
   140
	{
cawthron
parents:
diff changeset
   141
	}
cawthron
parents:
diff changeset
   142
				</template>
cawthron
parents:
diff changeset
   143
			</defineLocation>
cawthron
parents:
diff changeset
   144
			<template location="RemoveMethodLocation"><![CDATA[
cawthron
parents:
diff changeset
   145
if ( ${instanceMemberName} != NULL )
cawthron
parents:
diff changeset
   146
	{
cawthron
parents:
diff changeset
   147
	${instanceMemberName}->SetCallback( NULL );
cawthron
parents:
diff changeset
   148
	${instanceMemberName}->ProcessFinishedL();    // deletes the dialog
cawthron
parents:
diff changeset
   149
	${instanceMemberName} = NULL;
cawthron
parents:
diff changeset
   150
	}<% if (instance.events['canceled'] != null) {%>
cawthron
parents:
diff changeset
   151
delete ${instanceMemberName}Callback;
cawthron
parents:
diff changeset
   152
${instanceMemberName}Callback = NULL;
cawthron
parents:
diff changeset
   153
<% } %>
cawthron
parents:
diff changeset
   154
 ]]>			</template>
cawthron
parents:
diff changeset
   155
cawthron
parents:
diff changeset
   156
<!-- BEGIN EVENT canceled -->
cawthron
parents:
diff changeset
   157
			<templateGroup id="ProgressDialogCanceledEvent" ifEvents="canceled">
cawthron
parents:
diff changeset
   158
cawthron
parents:
diff changeset
   159
				<template phase="InstanceVariables">
cawthron
parents:
diff changeset
   160
class CProgressDialogCallback;
cawthron
parents:
diff changeset
   161
CProgressDialogCallback* ${instanceMemberName}Callback;
cawthron
parents:
diff changeset
   162
				</template>	
cawthron
parents:
diff changeset
   163
			
cawthron
parents:
diff changeset
   164
				<template id="HandlerDecl" phase="UserHandlers"><![CDATA[
cawthron
parents:
diff changeset
   165
void ${event.handlerName}( CAknProgressDialog* aDialog );
cawthron
parents:
diff changeset
   166
]]>				</template>
cawthron
parents:
diff changeset
   167
cawthron
parents:
diff changeset
   168
				<defineLocation id="MProgressDialogCallbackSupport" baseLocation="CLASS"
cawthron
parents:
diff changeset
   169
						owned="false" 
cawthron
parents:
diff changeset
   170
						location="region(MProgressDialogCallback support)">
cawthron
parents:
diff changeset
   171
					<template><![CDATA[
cawthron
parents:
diff changeset
   172
private: <% contrib.indentAdjust(-1); %>
cawthron
parents:
diff changeset
   173
typedef void ( ${handlerClassName}::*ProgressDialogEventHandler )( 
cawthron
parents:
diff changeset
   174
		CAknProgressDialog* aProgressDialog );
cawthron
parents:
diff changeset
   175
cawthron
parents:
diff changeset
   176
/**
cawthron
parents:
diff changeset
   177
 * This is a helper class for progress/wait dialog callbacks. It routes the dialog's
cawthron
parents:
diff changeset
   178
 * cancel notification to the handler function for the cancel event.
cawthron
parents:
diff changeset
   179
 */
cawthron
parents:
diff changeset
   180
class CProgressDialogCallback : public CBase, public MProgressDialogCallback
cawthron
parents:
diff changeset
   181
	{ 
cawthron
parents:
diff changeset
   182
	public:
cawthron
parents:
diff changeset
   183
		CProgressDialogCallback( 
cawthron
parents:
diff changeset
   184
				${handlerClassName}* aHandlerObj, 
cawthron
parents:
diff changeset
   185
				CAknProgressDialog* aDialog, 
cawthron
parents:
diff changeset
   186
				ProgressDialogEventHandler aHandler ) :
cawthron
parents:
diff changeset
   187
			handlerObj( aHandlerObj ), dialog( aDialog ), handler( aHandler )
cawthron
parents:
diff changeset
   188
			{}
cawthron
parents:
diff changeset
   189
			
cawthron
parents:
diff changeset
   190
		void DialogDismissedL( TInt aButtonId ) 
cawthron
parents:
diff changeset
   191
			{
cawthron
parents:
diff changeset
   192
			( handlerObj->*handler )( dialog );
cawthron
parents:
diff changeset
   193
			}
cawthron
parents:
diff changeset
   194
	private:
cawthron
parents:
diff changeset
   195
		${handlerClassName}* handlerObj;
cawthron
parents:
diff changeset
   196
		CAknProgressDialog* dialog;
cawthron
parents:
diff changeset
   197
		ProgressDialogEventHandler handler;
cawthron
parents:
diff changeset
   198
	};
cawthron
parents:
diff changeset
   199
	
cawthron
parents:
diff changeset
   200
]]>					</template>
cawthron
parents:
diff changeset
   201
				</defineLocation>
cawthron
parents:
diff changeset
   202
				<template id="RealizeMProgressDialogCallbackSupport" location="MProgressDialogCallbackSupport"/>
cawthron
parents:
diff changeset
   203
				
cawthron
parents:
diff changeset
   204
				<template location="ExecuteMethodLocation"><![CDATA[
cawthron
parents:
diff changeset
   205
${instanceMemberName}Callback = new ( ELeave ) CProgressDialogCallback( 
cawthron
parents:
diff changeset
   206
	this, ${instanceMemberName}, &${handlerClassName}::${event.handlerName} );
cawthron
parents:
diff changeset
   207
${instanceMemberName}->SetCallback( ${instanceMemberName}Callback );
cawthron
parents:
diff changeset
   208
]]>				</template>
cawthron
parents:
diff changeset
   209
				
cawthron
parents:
diff changeset
   210
				<defineLocation id="ProgressDialogCanceledHandler" baseLocation="MAIN_FILE"
cawthron
parents:
diff changeset
   211
					owned="false"
cawthron
parents:
diff changeset
   212
					isEventHandler="true"
cawthron
parents:
diff changeset
   213
					location="function(${handlerClassName}::${event.handlerName}(CAknProgressDialog*))">
cawthron
parents:
diff changeset
   214
					<template><![CDATA[
cawthron
parents:
diff changeset
   215
/** 
cawthron
parents:
diff changeset
   216
 * Handle the canceled event.
cawthron
parents:
diff changeset
   217
 */
cawthron
parents:
diff changeset
   218
void ${handlerClassName}::${event.handlerName}( CAknProgressDialog* /* aDialog */ )
cawthron
parents:
diff changeset
   219
	{
cawthron
parents:
diff changeset
   220
<% var code = instance.properties.canceledHandlerCode;
cawthron
parents:
diff changeset
   221
   if (code != "") { 
cawthron
parents:
diff changeset
   222
%>	${code} 
cawthron
parents:
diff changeset
   223
<% } else { 
cawthron
parents:
diff changeset
   224
%>	// TODO: implement ${event.eventName} event handler
cawthron
parents:
diff changeset
   225
<% } %>	}
cawthron
parents:
diff changeset
   226
]]>				
cawthron
parents:
diff changeset
   227
					</template>
cawthron
parents:
diff changeset
   228
				</defineLocation>
cawthron
parents:
diff changeset
   229
				<template id="RealizeHandler" location="ProgressDialogCanceledHandler"/>
cawthron
parents:
diff changeset
   230
cawthron
parents:
diff changeset
   231
			</templateGroup>
cawthron
parents:
diff changeset
   232
<!-- END EVENT canceled -->
cawthron
parents:
diff changeset
   233
cawthron
parents:
diff changeset
   234
		</sourceGen>
cawthron
parents:
diff changeset
   235
	</component>
cawthron
parents:
diff changeset
   236
	
cawthron
parents:
diff changeset
   237
</componentDefinition>