uidesigner/com.nokia.sdt.series60.componentlibrary/components/controls/CAknButton.component
author Dan Podwall <dan.podwall@nokia.com>
Mon, 27 Apr 2009 15:10:32 -0500
branchRCL_2_0
changeset 129 d13aa008da33
parent 2 d760517a8095
permissions -rw-r--r--
merge RCL_2_0 to MCL
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
	<enumPropertyDeclaration qualifiedName="com.nokia.sdt.series60.ButtonToolbarItemCommands">
cawthron
parents:
diff changeset
    13
		<enumElement value="UNIQUE"/>
cawthron
parents:
diff changeset
    14
	</enumPropertyDeclaration>
cawthron
parents:
diff changeset
    15
	
cawthron
parents:
diff changeset
    16
	<enumPropertyDeclaration qualifiedName="com.nokia.sdt.series60.CAknButton.HorizTextAlign" defaultValue="CGraphicsContext::ECenter">
cawthron
parents:
diff changeset
    17
		<enumElement value="CGraphicsContext::ECenter" displayValue="center" />
cawthron
parents:
diff changeset
    18
		<enumElement value="CGraphicsContext::ELeft" displayValue="left" />
cawthron
parents:
diff changeset
    19
		<enumElement value="CGraphicsContext::ERight" displayValue="right" />
cawthron
parents:
diff changeset
    20
	</enumPropertyDeclaration>
cawthron
parents:
diff changeset
    21
	
cawthron
parents:
diff changeset
    22
	<enumPropertyDeclaration qualifiedName="com.nokia.sdt.series60.CAknButton.ToolTipPosition" defaultValue="CAknButton::EPositionTop">
cawthron
parents:
diff changeset
    23
		<enumElement value="CAknButton::EPositionTop" displayValue="top" />
cawthron
parents:
diff changeset
    24
		<enumElement value="CAknButton::EPositionBottom" displayValue="bottom" />
cawthron
parents:
diff changeset
    25
		<enumElement value="CAknButton::EPositionLeft" displayValue="left" />
cawthron
parents:
diff changeset
    26
		<enumElement value="CAknButton::EPositionRight" displayValue="right" />
cawthron
parents:
diff changeset
    27
	</enumPropertyDeclaration>
cawthron
parents:
diff changeset
    28
	
cawthron
parents:
diff changeset
    29
	<enumPropertyDeclaration qualifiedName="com.nokia.sdt.series60.CAknButton.TextAndIconAlignment" defaultValue="CAknButton::EIconBeforeText">
cawthron
parents:
diff changeset
    30
		<enumElement value="CAknButton::EIconBeforeText" displayValue="icon before text" />
cawthron
parents:
diff changeset
    31
		<enumElement value="CAknButton::EIconAfterText" displayValue="icon after text" />
cawthron
parents:
diff changeset
    32
		<enumElement value="CAknButton::EIconUnderText" displayValue="icon under text" />
cawthron
parents:
diff changeset
    33
		<enumElement value="CAknButton::EIconOverText" displayValue="icon over text" />
cawthron
parents:
diff changeset
    34
		<enumElement value="CAknButton::EOverlay" displayValue="overlay" />
cawthron
parents:
diff changeset
    35
	</enumPropertyDeclaration>
cawthron
parents:
diff changeset
    36
	
cawthron
parents:
diff changeset
    37
	<enumPropertyDeclaration qualifiedName="com.nokia.sdt.series60.CAknButton.VertTextAlign" defaultValue="CAknButton::ECenter">
cawthron
parents:
diff changeset
    38
		<enumElement value="CAknButton::ECenter" displayValue="center" />
cawthron
parents:
diff changeset
    39
		<enumElement value="CAknButton::ETop" displayValue="top" />
cawthron
parents:
diff changeset
    40
		<enumElement value="CAknButton::EBottom" displayValue="bottom" />
cawthron
parents:
diff changeset
    41
	</enumPropertyDeclaration>
cawthron
parents:
diff changeset
    42
	
cawthron
parents:
diff changeset
    43
	<enumPropertyDeclaration qualifiedName="com.nokia.sdt.series60.CAknButton.Font" defaultValue="normal">
cawthron
parents:
diff changeset
    44
		<enumElement value="normal" displayValue="normal" />
cawthron
parents:
diff changeset
    45
		<enumElement value="CEikonEnv::Static()-&gt;LegendFont()" displayValue="legend" />
cawthron
parents:
diff changeset
    46
		<enumElement value="CEikonEnv::Static()-&gt;DenseFont()" displayValue="dense" />
cawthron
parents:
diff changeset
    47
		<enumElement value="CEikonEnv::Static()-&gt;SymbolFont()" displayValue="symbol" />
cawthron
parents:
diff changeset
    48
		<enumElement value="CEikonEnv::Static()-&gt;TitleFont()" displayValue="title" />
cawthron
parents:
diff changeset
    49
		<enumElement value="CEikonEnv::Static()-&gt;AnnotationFont()" displayValue="annotation" />
cawthron
parents:
diff changeset
    50
	</enumPropertyDeclaration>
cawthron
parents:
diff changeset
    51
	
cawthron
parents:
diff changeset
    52
	<compoundPropertyDeclaration 
cawthron
parents:
diff changeset
    53
		qualifiedName="com.nokia.sdt.series60.CAknButtonMultiImageProperty"
cawthron
parents:
diff changeset
    54
		editorClass="com.nokia.sdt.symbian.ui.editors.ImageEditorFactory"
cawthron
parents:
diff changeset
    55
		converterClass="com.nokia.sdt.series60.component.CAknButtonMultiImagePropertyConverter">
cawthron
parents:
diff changeset
    56
		<property name="bmpfile" descriptionKey="bmpfileDescription" type="string"/>
cawthron
parents:
diff changeset
    57
		<property name="bmpid" descriptionKey="bmpidDescription" type="string"/>
cawthron
parents:
diff changeset
    58
		<property name="bmpmask" descriptionKey="bmpmaskDescription" type="string"/>
cawthron
parents:
diff changeset
    59
		<property name="bmpidDimmed" descriptionKey="bmpidDimmedDescription" type="string"/>
cawthron
parents:
diff changeset
    60
		<property name="bmpmaskDimmed" descriptionKey="bmpmaskDimmedDescription" type="string"/>
cawthron
parents:
diff changeset
    61
		<property name="bmpidPressed" descriptionKey="bmpidPressedDescription" type="string"/>
cawthron
parents:
diff changeset
    62
		<property name="bmpmaskPressed" descriptionKey="bmpmaskPressedDescription" type="string"/>
cawthron
parents:
diff changeset
    63
		<property name="bmpidHover" descriptionKey="bmpidHoverDescription" type="string"/>
cawthron
parents:
diff changeset
    64
		<property name="bmpmaskHover" descriptionKey="bmpmaskHoverDescription" type="string"/>
cawthron
parents:
diff changeset
    65
	</compoundPropertyDeclaration>
cawthron
parents:
diff changeset
    66
	
cawthron
parents:
diff changeset
    67
	
cawthron
parents:
diff changeset
    68
	<component baseComponent="com.nokia.sdt.series60.CCoeControlBase" 
cawthron
parents:
diff changeset
    69
		friendlyName="%friendlyName" 
cawthron
parents:
diff changeset
    70
		qualifiedName="com.nokia.sdt.series60.CAknButton"
cawthron
parents:
diff changeset
    71
		category="Controls"
cawthron
parents:
diff changeset
    72
		instanceNameRoot="button"
cawthron
parents:
diff changeset
    73
		version="1.0">
cawthron
parents:
diff changeset
    74
		<documentation>
cawthron
parents:
diff changeset
    75
			<information>%information</information>
cawthron
parents:
diff changeset
    76
		</documentation>
cawthron
parents:
diff changeset
    77
		<symbian sdkName="com.nokia.series60" minSDKVersion="5.0" 
cawthron
parents:
diff changeset
    78
			className="CAknButton" classHelpTopic=""
cawthron
parents:
diff changeset
    79
			resourceType="" resourceHelpTopic="" />
cawthron
parents:
diff changeset
    80
		<designerImages smallIconFile="CAknButton_sm.png" 
cawthron
parents:
diff changeset
    81
			largeIconFile="CAknButton.png" />
cawthron
parents:
diff changeset
    82
			
cawthron
parents:
diff changeset
    83
		<attributes>
cawthron
parents:
diff changeset
    84
			<attribute key="cpp-class-name">CAknButton</attribute>
cawthron
parents:
diff changeset
    85
			<attribute key="is-ccoecontrol-content">true</attribute>
cawthron
parents:
diff changeset
    86
			<attribute key="editable-array-property">items</attribute>
cawthron
parents:
diff changeset
    87
		</attributes>
cawthron
parents:
diff changeset
    88
		
cawthron
parents:
diff changeset
    89
		<properties>
cawthron
parents:
diff changeset
    90
			
cawthron
parents:
diff changeset
    91
			<property category="Text" name="buttonText" type="localizedString" default="Button"
cawthron
parents:
diff changeset
    92
				 editorClass="com.nokia.sdt.symbian.ui.editors.ScalableTextEditorFactory"
cawthron
parents:
diff changeset
    93
			     descriptionKey="buttonTextDescription" displayName="%buttonTextDisplay"/>
cawthron
parents:
diff changeset
    94
			 <property category="Text" name="buttonHelpText" type="localizedString" default="Button Hover Text"
cawthron
parents:
diff changeset
    95
				 editorClass="com.nokia.sdt.symbian.ui.editors.ScalableTextEditorFactory"
cawthron
parents:
diff changeset
    96
			     descriptionKey="buttonHelpTextDescription" displayName="%buttonHelpTextDisplay"/>
cawthron
parents:
diff changeset
    97
			 <enumProperty category="Text" name="horizTextAlign" type="com.nokia.sdt.series60.CAknButton.HorizTextAlign"
cawthron
parents:
diff changeset
    98
				descriptionKey="horizTextAlignDescr" displayName="%horizTextAlign" />
cawthron
parents:
diff changeset
    99
			<enumProperty category="Text" name="vertTextAlign" type="com.nokia.sdt.series60.CAknButton.VertTextAlign"
cawthron
parents:
diff changeset
   100
				descriptionKey="vertTextAlignDescr" displayName="%vertTextAlign" />
cawthron
parents:
diff changeset
   101
			<enumProperty category="Text" name="toolTipPosition" type="com.nokia.sdt.series60.CAknButton.ToolTipPosition"
cawthron
parents:
diff changeset
   102
				descriptionKey="toolTipPositionDescr" displayName="%toolTipPosition" />
cawthron
parents:
diff changeset
   103
			<enumProperty category="Text" name="textAndIconAlignment" type="com.nokia.sdt.series60.CAknButton.TextAndIconAlignment"
cawthron
parents:
diff changeset
   104
				descriptionKey="textAndIconAlignmentDescr" displayName="%textAndIconAlignment" />
cawthron
parents:
diff changeset
   105
			<enumProperty category="Text" name="textFont" type="com.nokia.sdt.series60.CAknButton.Font"
cawthron
parents:
diff changeset
   106
				descriptionKey="textFontDescr" displayName="%textFont" />
cawthron
parents:
diff changeset
   107
			<compoundProperty category="Image" name="images"  
cawthron
parents:
diff changeset
   108
				type="com.nokia.sdt.series60.CAknButtonMultiImageProperty"
cawthron
parents:
diff changeset
   109
				descriptionKey="imagesDescription" />
cawthron
parents:
diff changeset
   110
			
cawthron
parents:
diff changeset
   111
			<property category="Flags" name="buttonTextLeft" type="boolean" descriptionKey="buttonTextLeftDescr" />
cawthron
parents:
diff changeset
   112
			<property category="Flags" name="buttonSizeFitText" type="boolean" descriptionKey="buttonSizeFitTextDescr" />
cawthron
parents:
diff changeset
   113
			<property category="Flags" name="buttonNoFrame" type="boolean" descriptionKey="buttonNoFrameDescr" />
cawthron
parents:
diff changeset
   114
			<property category="Flags" name="buttonKeyRepeat" type="boolean" descriptionKey="buttonKeyRepeatDescr" />
cawthron
parents:
diff changeset
   115
			<property category="Flags" name="buttonReportOnKeyDown" type="boolean" descriptionKey="buttonReportOnKeyDownDescr" />
cawthron
parents:
diff changeset
   116
			<property category="Flags" name="buttonNoFramePressEvent" type="boolean" descriptionKey="buttonNoFramePressEventDescr" />
cawthron
parents:
diff changeset
   117
			<property category="Flags" name="buttonRequestExitOnButtonUpEvent" type="boolean" descriptionKey="buttonRequestExitOnButtonUpEventDescr" />
cawthron
parents:
diff changeset
   118
			<property category="Flags" name="buttonReportOnLongPress" type="boolean" descriptionKey="buttonReportOnLongPressDescr" />
cawthron
parents:
diff changeset
   119
			
cawthron
parents:
diff changeset
   120
			<!-- Hidden commands used to fill out the TBAR_CTRL 'type' and 'id' members -->
cawthron
parents:
diff changeset
   121
			<property category="Hidden" name="toolBarType" type="string" default="EAknCtButton"/>
cawthron
parents:
diff changeset
   122
			<enumProperty category="Hidden" name="command" 
cawthron
parents:
diff changeset
   123
				type="com.nokia.sdt.series60.ButtonToolbarItemCommands" 
cawthron
parents:
diff changeset
   124
				descriptionKey="commandDescription" />
cawthron
parents:
diff changeset
   125
							
cawthron
parents:
diff changeset
   126
		</properties>
cawthron
parents:
diff changeset
   127
		
cawthron
parents:
diff changeset
   128
		<implementations>
cawthron
parents:
diff changeset
   129
			<implementation>
cawthron
parents:
diff changeset
   130
				<interface id="com.nokia.sdt.datamodel.adapter.IVisualAppearance"/>
cawthron
parents:
diff changeset
   131
				<interface id="com.nokia.sdt.datamodel.adapter.IDirectImageEdit"/>
cawthron
parents:
diff changeset
   132
				<interface id="com.nokia.sdt.datamodel.adapter.IDirectLabelEdit"/>
cawthron
parents:
diff changeset
   133
				<interface id="com.nokia.sdt.datamodel.adapter.IComponentEventInfo"/>
cawthron
parents:
diff changeset
   134
				<interface id="com.nokia.sdt.datamodel.adapter.IImagePropertyRenderingInfo"/>
cawthron
parents:
diff changeset
   135
				<script file="CAknButton.js" prototype="CAknButton"/>
cawthron
parents:
diff changeset
   136
			</implementation>
cawthron
parents:
diff changeset
   137
		</implementations>
cawthron
parents:
diff changeset
   138
		
cawthron
parents:
diff changeset
   139
		<events defaultEventName="selected">
cawthron
parents:
diff changeset
   140
			<event name="selected" displayName="%selected" category="ToolbarEvent"
cawthron
parents:
diff changeset
   141
				group="ToolbarEvent" 
cawthron
parents:
diff changeset
   142
			    handlerNameTemplate="Handle{title(name)}SelectedL"
cawthron
parents:
diff changeset
   143
			    descriptionKey="selectedDescription"
cawthron
parents:
diff changeset
   144
			/>
cawthron
parents:
diff changeset
   145
		</events>
cawthron
parents:
diff changeset
   146
		
cawthron
parents:
diff changeset
   147
		<sourceMapping>
cawthron
parents:
diff changeset
   148
		
cawthron
parents:
diff changeset
   149
			<mapResource struct="AVKON_BUTTON" headers="eikon.rh">
cawthron
parents:
diff changeset
   150
				
cawthron
parents:
diff changeset
   151
				<mapBitmaskMember property="." member="flags"
cawthron
parents:
diff changeset
   152
				  includedProperties="buttonTextLeft buttonSizeFitText buttonNoFrame buttonKeyRepeat buttonReportOnKeyDown buttonNoFramePressEvent buttonRequestExitOnButtonUpEvent buttonReportOnLongPress">
cawthron
parents:
diff changeset
   153
					<mapBitmaskValue properties="buttonTextLeft" value="KAknButtonTextLeft" />
cawthron
parents:
diff changeset
   154
					<mapBitmaskValue properties="buttonSizeFitText" value="KAknButtonSizeFitText" />
cawthron
parents:
diff changeset
   155
					<mapBitmaskValue properties="buttonNoFrame" value="KAknButtonNoFrame" />
cawthron
parents:
diff changeset
   156
					<mapBitmaskValue properties="buttonKeyRepeat" value="KAknButtonKeyRepeat" />
cawthron
parents:
diff changeset
   157
					<mapBitmaskValue properties="buttonReportOnKeyDown" value="KAknButtonReportOnKeyDown" />
cawthron
parents:
diff changeset
   158
					<mapBitmaskValue properties="buttonNoFramePressEvent" value="KAknButtonNoFramePressEvent" />
cawthron
parents:
diff changeset
   159
					<mapBitmaskValue properties="buttonRequestExitOnButtonUpEvent" value="KAknButtonRequestExitOnButtonUpEvent" />
cawthron
parents:
diff changeset
   160
					<mapBitmaskValue properties="buttonReportOnLongPress" value="KAknButtonReportOnLongPress" />
cawthron
parents:
diff changeset
   161
				</mapBitmaskMember>
cawthron
parents:
diff changeset
   162
				
cawthron
parents:
diff changeset
   163
				 <mapResourceMember property="." member="states[0]" 
cawthron
parents:
diff changeset
   164
		        		struct="AVKON_BUTTON_STATE" headers="eikon.rh" id="multi$states[0]" >
cawthron
parents:
diff changeset
   165
		        		
cawthron
parents:
diff changeset
   166
		        		<mapSimpleMember property="buttonText" member="txt"/>
cawthron
parents:
diff changeset
   167
						<mapSimpleMember property="buttonHelpText" member="helptxt"/>
cawthron
parents:
diff changeset
   168
						<mapSimpleMember property="images.bmpfile" member="bmpfile"/>
cawthron
parents:
diff changeset
   169
						
cawthron
parents:
diff changeset
   170
						<mapIdentifierMember property="images.bmpid" member="bmpid"/>
cawthron
parents:
diff changeset
   171
						<mapIdentifierMember property="images.bmpmask" member="bmpmask"/>
cawthron
parents:
diff changeset
   172
    					
cawthron
parents:
diff changeset
   173
    					// stupid header doesn't initialize bmpmask to -1
cawthron
parents:
diff changeset
   174
						<select property="images.bmpmask">
cawthron
parents:
diff changeset
   175
							<choice value="">
cawthron
parents:
diff changeset
   176
								<mapFixedMember member="bmpmask" value="-1"/>
cawthron
parents:
diff changeset
   177
							</choice>
cawthron
parents:
diff changeset
   178
							<choice>
cawthron
parents:
diff changeset
   179
								<mapIdentifierMember property="images.bmpmask" member="bmpmask"/>
cawthron
parents:
diff changeset
   180
							</choice>
cawthron
parents:
diff changeset
   181
						</select>
cawthron
parents:
diff changeset
   182
    				
cawthron
parents:
diff changeset
   183
					 	<select property="images.bmpmaskDimmed">
cawthron
parents:
diff changeset
   184
							<choice value="">
cawthron
parents:
diff changeset
   185
								<mapFixedMember member="dim_bmpmask" value="-1"/>
cawthron
parents:
diff changeset
   186
							</choice>
cawthron
parents:
diff changeset
   187
							<choice>
cawthron
parents:
diff changeset
   188
								<mapIdentifierMember property="images.bmpmaskDimmed" member="dim_bmpmask"/>
cawthron
parents:
diff changeset
   189
							</choice>
cawthron
parents:
diff changeset
   190
						</select>
cawthron
parents:
diff changeset
   191
					 
cawthron
parents:
diff changeset
   192
					 	<select property="images.bmpmaskPressed">
cawthron
parents:
diff changeset
   193
							<choice value="">
cawthron
parents:
diff changeset
   194
								<mapFixedMember member="press_bmpmask" value="-1"/>
cawthron
parents:
diff changeset
   195
							</choice>
cawthron
parents:
diff changeset
   196
							<choice>
cawthron
parents:
diff changeset
   197
								<mapIdentifierMember property="images.bmpmaskPressed" member="press_bmpmask"/>
cawthron
parents:
diff changeset
   198
							</choice>
cawthron
parents:
diff changeset
   199
						</select>
cawthron
parents:
diff changeset
   200
					 
cawthron
parents:
diff changeset
   201
					 	<select property="images.bmpmaskHover">
cawthron
parents:
diff changeset
   202
							<choice value="">
cawthron
parents:
diff changeset
   203
								<mapFixedMember member="hover_bmpmask" value="-1"/>
cawthron
parents:
diff changeset
   204
							</choice>
cawthron
parents:
diff changeset
   205
							<choice>
cawthron
parents:
diff changeset
   206
								<mapIdentifierMember property="images.bmpmaskHover" member="hover_bmpmask"/>
cawthron
parents:
diff changeset
   207
							</choice>
cawthron
parents:
diff changeset
   208
						</select>
cawthron
parents:
diff changeset
   209
cawthron
parents:
diff changeset
   210
				</mapResourceMember>
cawthron
parents:
diff changeset
   211
				
cawthron
parents:
diff changeset
   212
			</mapResource>
cawthron
parents:
diff changeset
   213
		</sourceMapping>
cawthron
parents:
diff changeset
   214
		
cawthron
parents:
diff changeset
   215
		<sourceGen>
cawthron
parents:
diff changeset
   216
			<useTemplateGroup ids="CLASS_CONTRIBS" />
cawthron
parents:
diff changeset
   217
			<useTemplateGroup ids="CONTAINER_CHILD_CONTRIBS" />
cawthron
parents:
diff changeset
   218
			
cawthron
parents:
diff changeset
   219
			<inline scope="prototype">
cawthron
parents:
diff changeset
   220
include("../containers/containerLibrary.js")
cawthron
parents:
diff changeset
   221
			</inline>
cawthron
parents:
diff changeset
   222
			
cawthron
parents:
diff changeset
   223
			<template form="Container" phase="HeaderIncludes"><![CDATA[
cawthron
parents:
diff changeset
   224
#include <aknbutton.h>
cawthron
parents:
diff changeset
   225
#include <stringloader.h>
cawthron
parents:
diff changeset
   226
]]>			</template>
cawthron
parents:
diff changeset
   227
			
cawthron
parents:
diff changeset
   228
			<template form="Container" phase="ForwardDeclarations">
cawthron
parents:
diff changeset
   229
class CAknButton;
cawthron
parents:
diff changeset
   230
			</template>
cawthron
parents:
diff changeset
   231
cawthron
parents:
diff changeset
   232
			<template form="Container" phase="Destroy"><![CDATA[
cawthron
parents:
diff changeset
   233
delete ${instanceMemberName};
cawthron
parents:
diff changeset
   234
${instanceMemberName} = NULL;
cawthron
parents:
diff changeset
   235
]]>			</template>
cawthron
parents:
diff changeset
   236
		
cawthron
parents:
diff changeset
   237
<template id="INIT_FROM_CONTAINER" form="Container" phase="Initialize"><![CDATA[
cawthron
parents:
diff changeset
   238
cawthron
parents:
diff changeset
   239
${instanceMemberName} = static_cast< CAknButton* >
cawthron
parents:
diff changeset
   240
				( EikControlFactory::CreateByTypeL( EAknCtButton ).iControl );
cawthron
parents:
diff changeset
   241
${instanceMemberName}->ConstructFromResourceL ( ${resourceName$upper} );
cawthron
parents:
diff changeset
   242
cawthron
parents:
diff changeset
   243
${instanceMemberName}->SetContainerWindowL ( *this );
cawthron
parents:
diff changeset
   244
${instanceMemberName}->SetRect ( TRect ( 
cawthron
parents:
diff changeset
   245
							TPoint ( ${properties.location.x}, ${properties.location.y} ) , 
cawthron
parents:
diff changeset
   246
							TSize ( ${properties.size.width}, ${properties.size.height} ) )  
cawthron
parents:
diff changeset
   247
							 ) ; 
cawthron
parents:
diff changeset
   248
${instanceMemberName}->SetObserver( ( MCoeControlObserver* ) iCommandObserver ); 
cawthron
parents:
diff changeset
   249
<% if (properties.horizTextAlign != "CGraphicsContext::ECenter") { %>${instanceMemberName}->SetTextHorizontalAlignment( ${properties.horizTextAlign} );<% } %>
cawthron
parents:
diff changeset
   250
<% if (properties.vertTextAlign != "CAknButton::ECenter") { %> ${instanceMemberName}->SetTextVerticalAlignment( ${properties.vertTextAlign} );<% } %>
cawthron
parents:
diff changeset
   251
<% if (properties.textAndIconAlignment != "CAknButton::EIconBeforeText") { %> ${instanceMemberName}->SetTextAndIconAlignment( ${properties.textAndIconAlignment} );<% } %>
cawthron
parents:
diff changeset
   252
<% if (properties.toolTipPosition != "CAknButton::EPositionTop") { %>${instanceMemberName}->SetTooltipPosition( ${properties.toolTipPosition} );<% } %>
cawthron
parents:
diff changeset
   253
<% if (properties.textFont != "normal") { %>${instanceMemberName}->SetTextFont( ${properties.textFont} );<% } %>
cawthron
parents:
diff changeset
   254
cawthron
parents:
diff changeset
   255
]]>			</template>
cawthron
parents:
diff changeset
   256
cawthron
parents:
diff changeset
   257
		<templateGroup id="HandleSelectedEvent" ifEvents="selected">
cawthron
parents:
diff changeset
   258
			<template id="0" phase="UserHandlers">
cawthron
parents:
diff changeset
   259
TBool ${event.handlerName}( TInt aCommand );
cawthron
parents:
diff changeset
   260
			</template>
cawthron
parents:
diff changeset
   261
cawthron
parents:
diff changeset
   262
			<defineLocation id="SelectedMethod" baseLocation="MAIN_FILE"
cawthron
parents:
diff changeset
   263
					owned="false"
cawthron
parents:
diff changeset
   264
					isEventHandler="true"
cawthron
parents:
diff changeset
   265
					location="function(${handlerClassName}::${event.handlerName}(TInt))">
cawthron
parents:
diff changeset
   266
					<template id="2"><![CDATA[
cawthron
parents:
diff changeset
   267
/** 
cawthron
parents:
diff changeset
   268
 * Handle the ${event.eventName} event.
cawthron
parents:
diff changeset
   269
 * @param aCommand the command id invoked
cawthron
parents:
diff changeset
   270
 * @return ETrue if the command was handled, EFalse if not
cawthron
parents:
diff changeset
   271
 */
cawthron
parents:
diff changeset
   272
TBool ${handlerClassName}::${event.handlerName}( TInt aCommand )
cawthron
parents:
diff changeset
   273
	{
cawthron
parents:
diff changeset
   274
	// TODO: implement ${event.eventName} event handler
cawthron
parents:
diff changeset
   275
	return ETrue;
cawthron
parents:
diff changeset
   276
	}
cawthron
parents:
diff changeset
   277
]]>				
cawthron
parents:
diff changeset
   278
					</template>
cawthron
parents:
diff changeset
   279
				</defineLocation>
cawthron
parents:
diff changeset
   280
			
cawthron
parents:
diff changeset
   281
			<template id="3" location="SelectedMethod" />
cawthron
parents:
diff changeset
   282
	
cawthron
parents:
diff changeset
   283
			<template id="4" form="HandleCommandSwitchDispatch" phase="SwitchContents" ifEvents="selected"><![CDATA[
cawthron
parents:
diff changeset
   284
<% var commandId =  Engine.findOrCreateEnumeratorForAlgorithm(instance, "command", 
cawthron
parents:
diff changeset
   285
		"com.nokia.sdt.component.symbian.NAME_ALG_COMMANDS");
cawthron
parents:
diff changeset
   286
	//println("commandId = " + commandId);
cawthron
parents:
diff changeset
   287
	if (commandId != null) { 
cawthron
parents:
diff changeset
   288
%>	case ${commandId}:
cawthron
parents:
diff changeset
   289
		commandHandled = ${event.handlerName}( aCommand );
cawthron
parents:
diff changeset
   290
		break;
cawthron
parents:
diff changeset
   291
<% } %> ]]>	</template>
cawthron
parents:
diff changeset
   292
		</templateGroup>
cawthron
parents:
diff changeset
   293
		
cawthron
parents:
diff changeset
   294
		<useTemplateGroup ids="GenerateCommonControlEvents GenerateStateChangedEvent"/>
cawthron
parents:
diff changeset
   295
		<useTemplateGroup ids="GenerateRequestingFocusEvent GenerateRequestingExitEvent"/>
cawthron
parents:
diff changeset
   296
		<useTemplateGroup ids="GenerateRequestingCancelEvent GenerateInteractionRefusedEvent"/>
cawthron
parents:
diff changeset
   297
		<useTemplateGroup ids="GeneratePrepareFocusTransitionEvent"/>
cawthron
parents:
diff changeset
   298
		
cawthron
parents:
diff changeset
   299
		</sourceGen>
cawthron
parents:
diff changeset
   300
		
cawthron
parents:
diff changeset
   301
	</component>
cawthron
parents:
diff changeset
   302
</componentDefinition>