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