uidesigner/com.nokia.sdt.series60.componentlibrary/components/controls/CAknSlider.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
	<enumPropertyDeclaration qualifiedName="com.nokia.sdt.slider.formLayout">
cawthron
parents:
diff changeset
    13
		<enumElement value="EAknFormSliderLayout1"/>
cawthron
parents:
diff changeset
    14
		<enumElement value="EAknFormSliderLayout2"/>
cawthron
parents:
diff changeset
    15
		<enumElement value="EAknFormSliderLayout3"/>
cawthron
parents:
diff changeset
    16
	</enumPropertyDeclaration>
cawthron
parents:
diff changeset
    17
	
cawthron
parents:
diff changeset
    18
	<enumPropertyDeclaration qualifiedName="com.nokia.sdt.slider.settingsLayout">
cawthron
parents:
diff changeset
    19
		<enumElement value="EAknSettingsItemSliderLayout"/>
cawthron
parents:
diff changeset
    20
		<enumElement value="EAknSettingsItemSliderLayoutWithGraphics"/>
cawthron
parents:
diff changeset
    21
	</enumPropertyDeclaration>
cawthron
parents:
diff changeset
    22
	
cawthron
parents:
diff changeset
    23
	<enumPropertyDeclaration qualifiedName="com.nokia.sdt.slider.layout">
cawthron
parents:
diff changeset
    24
		<enumElement value="EAknFormSliderLayout1"/>
cawthron
parents:
diff changeset
    25
		<enumElement value="EAknFormSliderLayout2"/>
cawthron
parents:
diff changeset
    26
		<enumElement value="EAknFormSliderLayout3"/>
cawthron
parents:
diff changeset
    27
		<enumElement value="EAknSettingsItemSliderLayout"/>
cawthron
parents:
diff changeset
    28
		<enumElement value="EAknSettingsItemSliderLayoutWithGraphics"/>
cawthron
parents:
diff changeset
    29
	</enumPropertyDeclaration>
cawthron
parents:
diff changeset
    30
	
cawthron
parents:
diff changeset
    31
	<enumPropertyDeclaration qualifiedName="com.nokia.sdt.slide.valueType"
cawthron
parents:
diff changeset
    32
		defaultValue="EAknSliderValueBareFigure">
cawthron
parents:
diff changeset
    33
		<enumElement value="EAknSliderValueNone"/>
cawthron
parents:
diff changeset
    34
    	<enumElement value="EAknSliderValueBareFigure"/>
cawthron
parents:
diff changeset
    35
    	<enumElement value="EAknSliderValuePercentage"/>
cawthron
parents:
diff changeset
    36
    	<enumElement value="EAknSliderValueFraction"/>
cawthron
parents:
diff changeset
    37
    	<enumElement value="EAknSliderValueDecimal"/>
cawthron
parents:
diff changeset
    38
	</enumPropertyDeclaration>
cawthron
parents:
diff changeset
    39
cawthron
parents:
diff changeset
    40
<component friendlyName="%friendlyName"
cawthron
parents:
diff changeset
    41
	qualifiedName="com.nokia.sdt.series60.CAknSlider"
cawthron
parents:
diff changeset
    42
	baseComponent="com.nokia.sdt.series60.CCoeControlBase" 
cawthron
parents:
diff changeset
    43
	category="Controls"
cawthron
parents:
diff changeset
    44
	instanceNameRoot="slider" version="1.0">
cawthron
parents:
diff changeset
    45
	<documentation>
cawthron
parents:
diff changeset
    46
		<information>%information</information>
cawthron
parents:
diff changeset
    47
		<helpTopic></helpTopic>
cawthron
parents:
diff changeset
    48
		<wizardDescription></wizardDescription>
cawthron
parents:
diff changeset
    49
	</documentation>
cawthron
parents:
diff changeset
    50
	<symbian minSDKVersion="2.0" sdkName="com.nokia.series60"
cawthron
parents:
diff changeset
    51
		resourceType="SLIDER" className="CAknSlider" />
cawthron
parents:
diff changeset
    52
	<designerImages 
cawthron
parents:
diff changeset
    53
		smallIconFile="CAknSlider_sm.png" 
cawthron
parents:
diff changeset
    54
		largeIconFile="CAknSlider.png"/>
cawthron
parents:
diff changeset
    55
			
cawthron
parents:
diff changeset
    56
<attributes>
cawthron
parents:
diff changeset
    57
	<attribute key="cpp-class-name">CAknSlider</attribute>
cawthron
parents:
diff changeset
    58
	<attribute key="is-dialog-content">true</attribute>
cawthron
parents:
diff changeset
    59
	<attribute key="is-setting-item-list-content">true</attribute>
cawthron
parents:
diff changeset
    60
	<attribute key="data-model-cpp-type">TInt</attribute>
cawthron
parents:
diff changeset
    61
	<attribute key="setting-item-class-name">CAknSliderSettingItem</attribute>
cawthron
parents:
diff changeset
    62
	<attribute key="setting-item-class-name">CAknSliderSettingItem</attribute>
cawthron
parents:
diff changeset
    63
	<attribute key="rss-control-type-enum">EAknCtSlider</attribute>
cawthron
parents:
diff changeset
    64
	<attribute key="is-non-resizable-layout-object">true</attribute>
cawthron
parents:
diff changeset
    65
</attributes>
cawthron
parents:
diff changeset
    66
cawthron
parents:
diff changeset
    67
<properties>
cawthron
parents:
diff changeset
    68
	<property name="minValue" type="integer" category="Data" default="0"
cawthron
parents:
diff changeset
    69
		descriptionKey="minValueDescription" />
cawthron
parents:
diff changeset
    70
	<property name="maxValue" type="integer" category="Data" default="100"
cawthron
parents:
diff changeset
    71
		descriptionKey="maxValueDescription" />
cawthron
parents:
diff changeset
    72
	<property name="value" type="integer" category="Data"
cawthron
parents:
diff changeset
    73
		descriptionKey="valueDescription" />
cawthron
parents:
diff changeset
    74
	<property name="step" type="integer" category="Data" default="1" minValue="1" 
cawthron
parents:
diff changeset
    75
		descriptionKey="stepDescription" />
cawthron
parents:
diff changeset
    76
	<enumProperty name="valueType" type="com.nokia.sdt.slide.valueType" category="Appearance"
cawthron
parents:
diff changeset
    77
		descriptionKey="valueTypeDescription" />
cawthron
parents:
diff changeset
    78
	<property name="decimalPlaces" type="integer" category="Data" minValue="0"
cawthron
parents:
diff changeset
    79
		descriptionKey="decimalPlacesDescription" />
cawthron
parents:
diff changeset
    80
	<property name="singularValueLabel" type="localizedString" category="Appearance"
cawthron
parents:
diff changeset
    81
		descriptionKey="singularValueLabelDescription"
cawthron
parents:
diff changeset
    82
		editorClass="com.nokia.sdt.symbian.ui.editors.ScalableTextEditorFactory" />
cawthron
parents:
diff changeset
    83
	<property name="minLabel" type="localizedString" category="Appearance" default="min"
cawthron
parents:
diff changeset
    84
		descriptionKey="minLabelDescription"
cawthron
parents:
diff changeset
    85
		editorClass="com.nokia.sdt.symbian.ui.editors.ScalableTextEditorFactory" />
cawthron
parents:
diff changeset
    86
	<property name="maxLabel" type="localizedString" category="Appearance" default="max"
cawthron
parents:
diff changeset
    87
		descriptionKey="maxLabelDescription"
cawthron
parents:
diff changeset
    88
		editorClass="com.nokia.sdt.symbian.ui.editors.ScalableTextEditorFactory" />
cawthron
parents:
diff changeset
    89
</properties>
cawthron
parents:
diff changeset
    90
		
cawthron
parents:
diff changeset
    91
<extensionProperties name="form">
cawthron
parents:
diff changeset
    92
	<enumProperty name="layout" type="com.nokia.sdt.slider.formLayout" category="Appearance"
cawthron
parents:
diff changeset
    93
		descriptionKey="layoutDescription" />
cawthron
parents:
diff changeset
    94
</extensionProperties>
cawthron
parents:
diff changeset
    95
		
cawthron
parents:
diff changeset
    96
<extensionProperties name="settings">
cawthron
parents:
diff changeset
    97
	<enumProperty name="layout" type="com.nokia.sdt.slider.settingsLayout" category="Appearance"
cawthron
parents:
diff changeset
    98
		descriptionKey="layoutDescription" />
cawthron
parents:
diff changeset
    99
	<compoundProperty category="Appearance" name="graphicalImage"
cawthron
parents:
diff changeset
   100
		type="com.nokia.sdt.symbian.imageProperty"
cawthron
parents:
diff changeset
   101
		descriptionKey="graphicalImageDescription" />
cawthron
parents:
diff changeset
   102
</extensionProperties>
cawthron
parents:
diff changeset
   103
		
cawthron
parents:
diff changeset
   104
<extensionProperties name="default">
cawthron
parents:
diff changeset
   105
	<enumProperty name="layout" type="com.nokia.sdt.slider.formLayout" category="Appearance"
cawthron
parents:
diff changeset
   106
		descriptionKey="layoutDescription" />
cawthron
parents:
diff changeset
   107
</extensionProperties>
cawthron
parents:
diff changeset
   108
cawthron
parents:
diff changeset
   109
<implementations>
cawthron
parents:
diff changeset
   110
	<implementation>
cawthron
parents:
diff changeset
   111
		<interface id="com.nokia.sdt.datamodel.adapter.IVisualAppearance"/>
cawthron
parents:
diff changeset
   112
		<interface id="com.nokia.sdt.datamodel.adapter.IDirectLabelEdit"/>
cawthron
parents:
diff changeset
   113
		<!-- for form -->
cawthron
parents:
diff changeset
   114
		<interface id="com.nokia.sdt.datamodel.adapter.IDirectImageEdit"/>
cawthron
parents:
diff changeset
   115
		<interface id="com.nokia.sdt.datamodel.adapter.IImagePropertyRenderingInfo"/>
cawthron
parents:
diff changeset
   116
		<interface id="com.nokia.sdt.datamodel.adapter.IComponentInstancePropertyListener"/>
cawthron
parents:
diff changeset
   117
		<interface id="com.nokia.sdt.datamodel.adapter.IComponentValidator"/>
cawthron
parents:
diff changeset
   118
		<script file="CAknSlider_visual.js" prototype="CAknSliderVisual"/>
cawthron
parents:
diff changeset
   119
	</implementation>
cawthron
parents:
diff changeset
   120
	<implementation>
cawthron
parents:
diff changeset
   121
		<interface id="com.nokia.sdt.datamodel.adapter.IPropertyExtenders"/>
cawthron
parents:
diff changeset
   122
		<script file="CAknSlider_propertyExtenders.js" prototype="CAknSliderPropertyExtenders"/>
cawthron
parents:
diff changeset
   123
	</implementation>
cawthron
parents:
diff changeset
   124
</implementations>
cawthron
parents:
diff changeset
   125
cawthron
parents:
diff changeset
   126
<sourceMapping>
cawthron
parents:
diff changeset
   127
	<mapResource struct="SLIDER" headers="avkon.rh">
cawthron
parents:
diff changeset
   128
		<!-- TODO: value label -->
cawthron
parents:
diff changeset
   129
		<mapEnumMember property="layout" member="layout"/>
cawthron
parents:
diff changeset
   130
		<mapSimpleMember property="minValue" member="minvalue"/>
cawthron
parents:
diff changeset
   131
		<mapSimpleMember property="maxValue" member="maxvalue"/>
cawthron
parents:
diff changeset
   132
		<mapSimpleMember property="step" member="step"  />
cawthron
parents:
diff changeset
   133
		<mapEnumMember property="valueType" member="valuetype"/>
cawthron
parents:
diff changeset
   134
		<mapSimpleMember property="decimalPlaces" member="decimalplaces" />
cawthron
parents:
diff changeset
   135
		<mapSimpleMember property="singularValueLabel" member="singular_valuelabel"/>
cawthron
parents:
diff changeset
   136
		<mapSimpleMember property="minLabel" member="minlabel"/>
cawthron
parents:
diff changeset
   137
		<mapSimpleMember property="maxLabel" member = "maxlabel"/>
cawthron
parents:
diff changeset
   138
		
cawthron
parents:
diff changeset
   139
		<select property="graphicalImage.bmpfile">
cawthron
parents:
diff changeset
   140
			<choice value="" />
cawthron
parents:
diff changeset
   141
			<choice>
cawthron
parents:
diff changeset
   142
				<mapResourceMember property="graphicalImage" member="graphical_image" 
cawthron
parents:
diff changeset
   143
					struct="IMAGE" headers="uikon.rh eikon.rh">
cawthron
parents:
diff changeset
   144
					<mapSimpleMember property="bmpfile" member="bmpfile"/>
cawthron
parents:
diff changeset
   145
					<mapIdentifierMember property="bmpid" member="bmpid"/>
cawthron
parents:
diff changeset
   146
					<!-- TODO: until we get "isSvg" subprop, this may fail
cawthron
parents:
diff changeset
   147
					<mapIdentifierMember property="bmpmask" member="bmpmask"/>
cawthron
parents:
diff changeset
   148
				-->
cawthron
parents:
diff changeset
   149
				</mapResourceMember>		
cawthron
parents:
diff changeset
   150
			</choice>
cawthron
parents:
diff changeset
   151
		</select>
cawthron
parents:
diff changeset
   152
	</mapResource>
cawthron
parents:
diff changeset
   153
</sourceMapping>
cawthron
parents:
diff changeset
   154
cawthron
parents:
diff changeset
   155
<sourceGen forms="Dialog Container">
cawthron
parents:
diff changeset
   156
cawthron
parents:
diff changeset
   157
			<inline>
cawthron
parents:
diff changeset
   158
include("../srcgenLibrary.js")
cawthron
parents:
diff changeset
   159
			</inline>
cawthron
parents:
diff changeset
   160
			
cawthron
parents:
diff changeset
   161
		<template phase="MainSystemIncludes"><![CDATA[
cawthron
parents:
diff changeset
   162
#ifdef __SERIES60_3X__
cawthron
parents:
diff changeset
   163
#include <akndef.h>
cawthron
parents:
diff changeset
   164
#endif
cawthron
parents:
diff changeset
   165
]]>		</template>
cawthron
parents:
diff changeset
   166
cawthron
parents:
diff changeset
   167
		<useTemplateGroup ids="CLASS_CONTRIBS" />
cawthron
parents:
diff changeset
   168
		<useTemplate ids="INIT_FROM_DIALOG" />
cawthron
parents:
diff changeset
   169
cawthron
parents:
diff changeset
   170
		<template id="INIT_FROM_CONTAINER_CAKNSLIDER" form="Container" phase="Initialize"><![CDATA[
cawthron
parents:
diff changeset
   171
${instanceMemberName} = new ( ELeave ) ${this.getCppClassName(instance)};
cawthron
parents:
diff changeset
   172
${instanceMemberName}->SetContainerWindowL( *this );
cawthron
parents:
diff changeset
   173
	{
cawthron
parents:
diff changeset
   174
	TResourceReader reader;
cawthron
parents:
diff changeset
   175
	iEikonEnv->CreateResourceReaderLC( reader, ${resourceName$upper} );
cawthron
parents:
diff changeset
   176
	${instanceMemberName}->HandleResourceChange( 
cawthron
parents:
diff changeset
   177
			KEikMessageCaptionedControlEditableStateChange );
cawthron
parents:
diff changeset
   178
	${instanceMemberName}->ConstructFromResourceL( reader );
cawthron
parents:
diff changeset
   179
	CleanupStack::PopAndDestroy(); // reader internal state
cawthron
parents:
diff changeset
   180
	}
cawthron
parents:
diff changeset
   181
]]>			</template>
cawthron
parents:
diff changeset
   182
cawthron
parents:
diff changeset
   183
		<useTemplate ids="INIT_FROM_SETTINGS_LIST" />
cawthron
parents:
diff changeset
   184
cawthron
parents:
diff changeset
   185
			<template form="Container" phase="LayoutControls" id="LAYOUT_SLIDER"><![CDATA[
cawthron
parents:
diff changeset
   186
<% var isSettingsLayout = instance.properties.layout.toString().indexOf("SettingsItem") > 0;
cawthron
parents:
diff changeset
   187
   if (isSettingsLayout) { %>
cawthron
parents:
diff changeset
   188
${instanceMemberName}->SetExtent( TPoint( ${properties.location.x}, ${properties.location.y} ), TSize( ${properties.size.width}, ${properties.size.height} ) );
cawthron
parents:
diff changeset
   189
<% } else { %>
cawthron
parents:
diff changeset
   190
${instanceMemberName}->SetExtent( TPoint( ${properties.location.x}, ${properties.location.y} ), ${instanceMemberName}->MinimumSize() );
cawthron
parents:
diff changeset
   191
<% } %>
cawthron
parents:
diff changeset
   192
]]>			</template>
cawthron
parents:
diff changeset
   193
cawthron
parents:
diff changeset
   194
cawthron
parents:
diff changeset
   195
		<inline>
cawthron
parents:
diff changeset
   196
this.getCppSystemIncludes(contribs, [ "barsread.h", "stringloader.h",
cawthron
parents:
diff changeset
   197
									"aknslider.h", "eikenv.h" ]);
cawthron
parents:
diff changeset
   198
		</inline>
cawthron
parents:
diff changeset
   199
cawthron
parents:
diff changeset
   200
		<template form="SettingsList" phase="Initialize"><![CDATA[
cawthron
parents:
diff changeset
   201
<%		this.setupSettingItem(contribs, 0, instance, ""+properties.value); 
cawthron
parents:
diff changeset
   202
%>]]>	</template>
cawthron
parents:
diff changeset
   203
cawthron
parents:
diff changeset
   204
		<inline scope="prototype">
cawthron
parents:
diff changeset
   205
include("../srcgenLibrary.js")
cawthron
parents:
diff changeset
   206
		</inline>
cawthron
parents:
diff changeset
   207
		
cawthron
parents:
diff changeset
   208
		<inline><![CDATA[
cawthron
parents:
diff changeset
   209
if (Engine.formMatches(form, ["", "Dialog", "Container", "SettingsList"])) {
cawthron
parents:
diff changeset
   210
	if (properties.maxValue < properties.minValue)
cawthron
parents:
diff changeset
   211
		error(formatString(lookupString("invalidRange"), instanceName, properties.minValue, properties.maxValue));
cawthron
parents:
diff changeset
   212
	else if (properties.value < properties.minValue || properties.value > properties.maxValue)
cawthron
parents:
diff changeset
   213
		error(formatString(lookupString("valueExceedsRange"), instanceName, properties.minValue, properties.value, properties.maxValue));
cawthron
parents:
diff changeset
   214
	if (properties.step == 0 || ((properties.maxValue - properties.minValue) % properties.step) != 0)
cawthron
parents:
diff changeset
   215
		error(formatString(lookupString("stepNotValid"), instanceName, properties.maxValue, properties.minValue, properties.step));
cawthron
parents:
diff changeset
   216
	if (properties.step == 0 || ((properties.value - properties.minValue) % properties.step) != 0)
cawthron
parents:
diff changeset
   217
		error(formatString(lookupString("valueNotValid"), instanceName, properties.value, properties.minValue, properties.step));
cawthron
parents:
diff changeset
   218
		
cawthron
parents:
diff changeset
   219
	if (!Engine.formMatches(form, ["SettingsList"])) {
cawthron
parents:
diff changeset
   220
		setPropertiesForPhase(contribs, "Initialize", 0, instanceMemberName, false,
cawthron
parents:
diff changeset
   221
			properties.value, 0, "{0}->SetValueL( {1} );\n");
cawthron
parents:
diff changeset
   222
	}
cawthron
parents:
diff changeset
   223
} ]]>		</inline>
cawthron
parents:
diff changeset
   224
cawthron
parents:
diff changeset
   225
cawthron
parents:
diff changeset
   226
		<useTemplateGroup ids="GenerateCommonControlEvents GenerateStateChangedEvent"/>
cawthron
parents:
diff changeset
   227
		<useTemplateGroup ids="GenerateRequestingFocusEvent GenerateRequestingExitEvent"/>
cawthron
parents:
diff changeset
   228
		<useTemplateGroup ids="GenerateRequestingCancelEvent GenerateInteractionRefusedEvent"/>
cawthron
parents:
diff changeset
   229
		<useTemplateGroup ids="GeneratePrepareFocusTransitionEvent"/>
cawthron
parents:
diff changeset
   230
cawthron
parents:
diff changeset
   231
		<useTemplateGroup ids="GenerateEditingStartedEvent GenerateEditingStoppedEvent" />
cawthron
parents:
diff changeset
   232
cawthron
parents:
diff changeset
   233
</sourceGen>
cawthron
parents:
diff changeset
   234
cawthron
parents:
diff changeset
   235
</component>
cawthron
parents:
diff changeset
   236
</componentDefinition>