<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -->
<!-- All rights reserved. -->
<!-- This component and the accompanying materials are made available -->
<!-- under the terms of the License "Eclipse Public License v1.0" -->
<!-- which accompanies this distribution, and is available -->
<!-- at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<componentDefinition xmlns="http://www.nokia.com/sdt/emf/component" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	
	<component friendlyName="%friendlyName"
		qualifiedName="com.nokia.sdt.series60.CAknBinaryPopupSettingItem" 
		baseComponent="com.nokia.sdt.series60.EnumeratedTextPopupBase"
		category="Controls"
		instanceNameRoot="binarySetting" version="1.0">
		<documentation>
			<information>%information</information>
			<helpTopic></helpTopic>
			<wizardDescription></wizardDescription>
		</documentation>
		<symbian minSDKVersion="2.0" sdkName="com.nokia.series60"
			resourceType="AVKON_POPUP_SETTING_TEXTS" className="CAknBinaryPopupSettingItem" />
		<designerImages 
			smallIconFile="CAknBinaryPopupSettingItem_sm.png" 
			largeIconFile="CAknBinaryPopupSettingItem.png"/>
				
		<attributes>
			<attribute key="cpp-class-name">CAknBinaryPopupSettingItem</attribute>
			<attribute key="setting-item-class-name">CAknBinaryPopupSettingItem</attribute>
			<attribute key="data-model-cpp-type">TBool</attribute>
			<attribute key="rss-control-type-enum">EAknCtPopupSettingList</attribute>
			<attribute key="setting-item-has-associated-resource">true</attribute>
			<attribute key="editable-array-property">items</attribute>
		</attributes>
		
		<properties>
			<arrayProperty name="items" category="Data" resettable="false"
				type="com.nokia.sdt.series60.EnumeratedTextPopupType" 
				editorClass="com.nokia.sdt.series60.component.EnumeratedTextPopupListEditorFactory"
				descriptionKey="itemsDescription"
			/>
		</properties>
	
		<implementations>
			<implementation>
				<interface id="com.nokia.sdt.datamodel.adapter.IComponentValidator"/>
				<script file="CAknBinaryPopupSettingItem.js" prototype="CAknBinaryPopupSettingItem"/>
			</implementation>
			<implementation>
				<interface id="com.nokia.sdt.datamodel.adapter.IInitializer"/>
				<code class="com.nokia.sdt.series60.component.BinaryPopupSettingItemInitializerFactory"/>
			</implementation>
		</implementations>

	<sourceMapping>
		<!-- empty for setting item page -->
		<mapResource struct="POPUP_SETTING_LIST" headers="avkon.rh" />
		
		<!-- this is the associated resource -->
		<mapResource struct="AVKON_POPUP_SETTING_TEXTS" headers="avkon.rh avkon.hrh"
			id="associated">
			<!-- TODO: flags? -->
			<mapResourceMember struct="ARRAY" 
					property="." member="setting_texts_resource" 
					headers="badef.rh"
					id="setting">
				<mapArrayMember property="items" member="items">
					<mapResourceElement struct="AVKON_ENUMERATED_TEXT" id="setting_element">
						<mapSimpleMember property="settingText" member="text"/>
						<mapSimpleMember property="value" member="value"/>
					</mapResourceElement>
				</mapArrayMember>
			</mapResourceMember>
			<mapResourceMember struct="ARRAY" 
					property="." member="popped_up_texts_resource" 
					headers="badef.rh"
					id="popup">
				<mapArrayMember property="items" member="items">
					<mapResourceElement struct="LBUF" id="popup_element">
						<mapSimpleMember property="popupText" member="txt"/>
					</mapResourceElement>
				</mapArrayMember>
			</mapResourceMember>
		</mapResource>
	</sourceMapping>

		<sourceGen forms="Dialog Container">
	
			<useTemplate ids="INIT_FROM_CONTAINER" />
			<useTemplate ids="INIT_FROM_DIALOG" />
			<useTemplateGroup ids="CLASS_CONTRIBS" />
			<useTemplate ids="LAYOUT_CONTROLS" />
			<useTemplate ids="INIT_FROM_SETTINGS_LIST" />

			<inline>
this.getCppSystemIncludes(contribs, [ "barsread.h", "stringloader.h",
									"aknpopupfieldtext.h", "eikenv.h" ]);
			</inline>

		<template phase="Initialize" forms="SettingsList"><![CDATA[
<% 		var el = instance.properties.items[instance.properties.active];
		var init = el ? "" + el.value : null;
		this.setupSettingItem(contribs, 0, instance, init); 
%>]]>	</template>

		<useTemplateGroup ids="GenerateCommonControlEvents GenerateStateChangedEvent"/>
		<useTemplateGroup ids="GenerateRequestingFocusEvent GenerateRequestingExitEvent"/>
		<useTemplateGroup ids="GenerateRequestingCancelEvent GenerateInteractionRefusedEvent"/>
		<useTemplateGroup ids="GeneratePrepareFocusTransitionEvent"/>

		<useTemplateGroup ids="GenerateEditingStartedEvent GenerateEditingStoppedEvent"/>
		
	</sourceGen>

	</component>
</componentDefinition>
		