uidesigner/com.nokia.sdt.series60.componentlibrary/components/menu/MenuItemBase.component
changeset 2 d760517a8095
equal deleted inserted replaced
-1:000000000000 2:d760517a8095
       
     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.series60.MenuItemCommands">
       
    13 		<enumElement value="UNIQUE"/>
       
    14 		<enumElement value="NONE"/>
       
    15 
       
    16 	    <enumElement value="EAknFormCmdEdit" />
       
    17 	    <enumElement value="EAknFormCmdAdd" />
       
    18 	    <enumElement value="EAknFormCmdSave" />
       
    19 	    <enumElement value="EAknFormCmdLabel" />
       
    20 	    <enumElement value="EAknFormCmdDelete" />
       
    21 
       
    22 	    <enumElement value="EAknCmdMark" />
       
    23 	    <enumElement value="EAknCmdUnmark" />
       
    24 		<enumElement value="EAknMarkAll" />
       
    25 		<enumElement value="EAknUnmarkAll" />
       
    26 
       
    27 	    <enumElement value="EAknCmdExit" />
       
    28 		<enumElement value="EEikCmdExit" />
       
    29 		
       
    30 	    <enumElement value="EAknCmdHelp" />
       
    31 	    
       
    32 	    <enumElement value="EAknCmdAddToPinboard" />
       
    33 	    <enumElement value="EAknCmdFindPopupActivated" />
       
    34 	    <enumElement value="EAknCmdEditModeT9" />
       
    35 	    <enumElement value="EAknCmdEditModeMultitap" />
       
    36 	    <enumElement value="EAknCmdEditModeNumber" />
       
    37 	    <enumElement value="EAknCmdEditInsertNumber" />
       
    38 	    <enumElement value="EAknCmdEditInsertSymbol" />
       
    39 	    <enumElement value="EAknCmdInputLanguage" />
       
    40 	    <enumElement value="EAknCmdPredictiveTextCascade" />
       
    41 	    <enumElement value="EAknCmdT9PredictiveMatches" />
       
    42 	    <enumElement value="EAknCmdT9PredictiveInsertWord" />
       
    43 	    <enumElement value="EAknCmdT9PredictiveEditWord" />
       
    44 	    <enumElement value="EAknCmdT9PredictiveT9Off" />
       
    45 	    <enumElement value="EAknCmdMultitapPredictiveT9On" />
       
    46 	    <enumElement value="EAknCmdEditTextMenu" />
       
    47 	    <enumElement value="EAknCmdEditListMenu" />
       
    48 	    <enumElement value="EAknCmdOpen" />
       
    49 
       
    50 		<enumElement value="EEikCmdFileOpen" />
       
    51 		<enumElement value="EEikCmdFileOpenAnother" />
       
    52 		<enumElement value="EEikCmdFileSaveAs" />
       
    53 		<enumElement value="EEikCmdFileNew" />
       
    54 		<enumElement value="EEikCmdFileSave" />
       
    55 		<enumElement value="EEikCmdFileImport" />
       
    56 		<enumElement value="EEikCmdFileExport" />
       
    57 		<enumElement value="EEikCmdFileRevert" />
       
    58 		<enumElement value="EEikCmdFileMerge" />
       
    59 		
       
    60 		<enumElement value="EEikCmdHelpContents" />
       
    61 		<enumElement value="EEikCmdHelpSearch" />
       
    62 		<enumElement value="EEikCmdHelpAbout" />
       
    63 		
       
    64 		<enumElement value="EEikCmdEditCut" />
       
    65 		<enumElement value="EEikCmdEditCopy" />
       
    66 		<enumElement value="EEikCmdEditPaste" />
       
    67 		<enumElement value="EEikCmdEditUndo" />
       
    68 		<enumElement value="EEikCmdEditRedo" />
       
    69 		<enumElement value="EEikCmdEditSelectAll" />
       
    70 		<enumElement value="EEikCmdEditPicture" />
       
    71 		<enumElement value="EEikCmdEditPictureFormat" />
       
    72 		<enumElement value="EEikCmdEditUpdateCurrentField" />
       
    73 		<enumElement value="EEikCmdEditUpdateAllFields" />
       
    74 		
       
    75 		<enumElement value="EEikCmdIrdaSend" />
       
    76 		<enumElement value="EEikCmdIrdaReceive" />
       
    77 		
       
    78 		<enumElement value="EEikCmdZoomNormal" />
       
    79 		<enumElement value="EEikCmdZoomIn" />
       
    80 		<enumElement value="EEikCmdZoomOut" />
       
    81 		
       
    82 		<enumElement value="EEikCmdInsertSymbol" />
       
    83 		<enumElement value="EEikCmdInsertField" />
       
    84 		<enumElement value="EEikCmdInsertPicture" />
       
    85 		
       
    86 		<enumElement value="EEikCmdSearchFind" />
       
    87 		<enumElement value="EEikCmdSearchFindAgain" />
       
    88 		<enumElement value="EEikCmdSearchReplace" />
       
    89 		
       
    90 		<enumElement value="EEikCmdPrintSetup" />
       
    91 		<enumElement value="EEikCmdPrintPreview" />
       
    92 		<enumElement value="EEikCmdPrintPrint" />
       
    93 		<enumElement value="EEikCmdPrintPaginate" />
       
    94 		
       
    95 		<enumElement value="EEikCmdFontChange" />
       
    96 		<enumElement value="EEikCmdFontBold" />
       
    97 		<enumElement value="EEikCmdFontItalic" />
       
    98 		<enumElement value="EEikCmdFontUnderline" />
       
    99 		
       
   100 		<enumElement value="EEikCmdParaAlign" />
       
   101 		<enumElement value="EEikCmdParaBorder" />
       
   102 		<enumElement value="EEikCmdParaSpacing" />
       
   103 		<enumElement value="EEikCmdParaIndent" />
       
   104 		<enumElement value="EEikCmdParaTabs" />
       
   105 		<enumElement value="EEikCmdFormatObject" />
       
   106 		
       
   107 		<enumElement value="EEikCmdFieldFileName" />
       
   108 		<enumElement value="EEikCmdFieldPageNumber" />
       
   109 		<enumElement value="EEikCmdFieldCurrentTime" />
       
   110 		<enumElement value="EEikCmdFieldCurrentDate" />
       
   111 		<enumElement value="EEikCmdFieldNumberOfPages" />
       
   112 		<enumElement value="EEikCmdFieldInsertObject" />
       
   113 		
       
   114 		<enumElement value="EEikBidYes" />
       
   115 
       
   116 		<!-- ...................... -->	
       
   117 		
       
   118 	    <enumElement value="EChinFepCmdInstructions" />
       
   119 	    <enumElement value="EChinFepCmdModePinyin" />
       
   120 	    <enumElement value="EChinFepCmdModeZhuyin" />
       
   121 	    <enumElement value="EChinFepCmdModeStroke" />
       
   122 	    <enumElement value="EChinFepCmdModeLatinUpper" />
       
   123 	    <enumElement value="EChinFepCmdModeLatinLower" />
       
   124 	    <enumElement value="EChinFepCmdModeNumber" />
       
   125 	    <enumElement value="EChinFepCmdModeZhuyinFind" />
       
   126 	    <enumElement value="EChinFepCmdModeStrokeFind" />
       
   127 	
       
   128 	    <enumElement value="EAknCmdEditModeArabicIndicNumber" />
       
   129 	    <enumElement value="EAknCmdEditModeAlpha" />
       
   130 	    <enumElement value="EAknCmdEditModeLatinText" />
       
   131 	
       
   132 	    <enumElement value="EJapanFepCmdModeHiragana" />
       
   133 	    <enumElement value="EJapanFepCmdModeKatakana" />
       
   134 	    <enumElement value="EJapanFepCmdModePictographs" />
       
   135 	    <enumElement value="EJapanFepCmdModeFullWidth" />
       
   136 	    <enumElement value="EJapanFepCmdModeHalfWidth" />
       
   137 	    <enumElement value="EJapanFepCmdModePredictiveOn" />
       
   138 	    <enumElement value="EJapanFepCmdModePredictiveOff" />
       
   139 	    <enumElement value="EJapanFepCmdModeUserDic" />
       
   140 	    <enumElement value="EJapanFepCmdModeKutenCodeInput" />
       
   141 	    <enumElement value="EAknCmdEditInsertPictograph" />
       
   142 	    <enumElement value="EJapanFepCmdPredictiveTextCascade" />
       
   143 	    <enumElement value="EJapanFepCmdMultitapPredictiveT9On" />
       
   144 	    <enumElement value="EJapanFepCmdEditModeAlpha" />
       
   145 	    <enumElement value="EJapanFepCmdEditModeNumber" />
       
   146 
       
   147 		<!-- 3.0 -->	
       
   148 	
       
   149 	    <enumElement value="EAknCmdInputMethod" />
       
   150 	    <enumElement value="EChinFepCmdModeCangJie" />
       
   151 	    <enumElement value="EChinFepCmdModeCangJieOption" />
       
   152 	    
       
   153 	    <enumElement value="EAknCmdEditMenuSctSelected" />
       
   154 
       
   155 	</enumPropertyDeclaration>
       
   156 
       
   157 	<component baseComponent="com.nokia.sdt.series60.MenuBase" 
       
   158 		friendlyName="%friendlyName" 
       
   159 		qualifiedName="com.nokia.sdt.series60.MenuItemBase" 
       
   160 		category="Menu"
       
   161 		abstract="true"
       
   162 		instanceNameRoot="menuItem"
       
   163 		version="1.0">
       
   164 		
       
   165 		<documentation>
       
   166 			<information>%information</information>
       
   167 		</documentation>
       
   168 		
       
   169 		<symbian sdkName="com.nokia.series60" minSDKVersion="2.0" 
       
   170 			className="CEikMenuPaneItem" classHelpTopic=""
       
   171 			resourceType="MENU_ITEM" resourceHelpTopic="" />
       
   172 			
       
   173 		<attributes>
       
   174 			<attribute key="layout-type">ordered</attribute>
       
   175 			<attribute key="never-add-component">true</attribute>
       
   176 		</attributes>
       
   177 
       
   178 		<designerImages smallIconFile="MenuItem_sm.png" largeIconFile="MenuItem.png"/>
       
   179 
       
   180 		<properties>
       
   181 			<!-- no text property -->
       
   182 			<enumProperty category="Behavior" name="command" 
       
   183 				type="com.nokia.sdt.series60.MenuItemCommands" 
       
   184 				descriptionKey="commandDescription" />
       
   185 		</properties>
       
   186 		
       
   187 		<events defaultEventName="selected">
       
   188 		<event name="selected" displayName="%selected" category="Menu" 
       
   189 		    handlerNameTemplate="Handle{title(name)}SelectedL"
       
   190 		    descriptionKey="selectedDescription"
       
   191 		/>
       
   192 		</events>
       
   193 
       
   194 		<implementations>
       
   195 			<implementation>
       
   196 				<interface id="com.nokia.sdt.datamodel.adapter.IVisualAppearance"/>
       
   197 				<interface id="com.nokia.sdt.datamodel.adapter.ILayout"/>
       
   198 				<interface id="com.nokia.sdt.datamodel.adapter.IDirectLabelEdit"/>
       
   199 				<interface id="com.nokia.sdt.editor.IComponentEditor"/>
       
   200 				<code class="com.nokia.sdt.series60.component.menu.MenuItemImplFactory"/>
       
   201 			</implementation>
       
   202 			<implementation>
       
   203 				<!-- broken out to allow independent overriding -->
       
   204 				<interface id="com.nokia.sdt.datamodel.adapter.IQueryContainment"/>
       
   205 				<code class="com.nokia.sdt.series60.component.menu.MenuItemImplFactory"/>
       
   206 			</implementation>
       
   207 			<implementation>
       
   208 				<interface id="com.nokia.sdt.datamodel.adapter.IComponentValidator"/>
       
   209 				<script file="MenuItemBase.js" prototype="MenuItemBase" />
       
   210 			</implementation>
       
   211 		</implementations>
       
   212 
       
   213 		<sourceMapping>
       
   214 			<mapResource struct="MENU_ITEM" headers="uikon.rh eikon.rh">
       
   215 				<select property="[com.nokia.sdt.series60.SystemMenuPane]">
       
   216 					<choice value="">
       
   217 						<!-- no system menu -->
       
   218 						<select property="[com.nokia.sdt.series60.MenuPane]">
       
   219 							<choice value="">
       
   220 								<!-- No sub-MenuPane -->
       
   221 								<select property="command">
       
   222 									<choice value="NONE" />
       
   223 									<choice>
       
   224 										<mapEnumMember property="command" member="command" uniqueValue="UNIQUE"
       
   225 											nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_COMMANDS"/>
       
   226 									</choice>
       
   227 								</select>
       
   228 							</choice>
       
   229 							<choice>
       
   230 								<!-- Existing sub-MenuPane -->
       
   231 								<mapReferenceMember property="[com.nokia.sdt.series60.MenuPane]" member="cascade"/>
       
   232 							</choice>
       
   233 						</select>
       
   234 					</choice>
       
   235 					
       
   236 					<!-- else, not a submenu with resources -->
       
   237 					<choice>
       
   238 						<select property="[com.nokia.sdt.series60.SystemMenuPane].systemResourceName">
       
   239 							<choice value="">
       
   240 								<!-- nothing -->
       
   241 							</choice>
       
   242 							<choice>
       
   243 								<!-- pane refers to existing resource -->
       
   244 								<mapIdentifierMember property="[com.nokia.sdt.series60.SystemMenuPane].systemResourceName" member="cascade"/>
       
   245 							</choice>
       
   246 						</select>
       
   247 					</choice>
       
   248 				</select>
       
   249 				<mapSimpleMember property="text" member="txt" />
       
   250 			</mapResource>
       
   251 		</sourceMapping>
       
   252 		
       
   253 	<sourceGen forms="RootAppUi AknView Container HandleCommandSwitchDispatch">
       
   254 		
       
   255 		<templateGroup id="HandleSelectedEvent" ifEvents="selected">
       
   256 			<template id="0" phase="UserHandlers">
       
   257 TBool ${event.handlerName}( TInt aCommand );
       
   258 			</template>
       
   259 
       
   260 			<defineLocation id="SelectedMethod" baseLocation="MAIN_FILE"
       
   261 					owned="false"
       
   262 					isEventHandler="true"
       
   263 					location="function(${handlerClassName}::${event.handlerName}(TInt))">
       
   264 					<template id="2"><![CDATA[
       
   265 /** 
       
   266  * Handle the ${event.eventName} event.
       
   267  * @param aCommand the command id invoked
       
   268  * @return ETrue if the command was handled, EFalse if not
       
   269  */
       
   270 TBool ${handlerClassName}::${event.handlerName}( TInt aCommand )
       
   271 	{
       
   272 	// TODO: implement ${event.eventName} event handler
       
   273 	return ETrue;
       
   274 	}
       
   275 ]]>				
       
   276 					</template>
       
   277 				</defineLocation>
       
   278 			
       
   279 				<template id="3" location="SelectedMethod" />
       
   280 	
       
   281 			<template id="4" form="HandleCommandSwitchDispatch" phase="SwitchContents" ifEvents="selected"><![CDATA[
       
   282 <% var commandId = Engine.findBuiltinOrGeneratedEnumeratorForAlgorithm(instance, "command", "com.nokia.sdt.component.symbian.NAME_ALG_COMMANDS");
       
   283 	if (commandId != null) { 
       
   284 %>	case ${commandId}:
       
   285 		commandHandled = ${event.handlerName}( aCommand );
       
   286 		break;
       
   287 <% } %> ]]>	</template>
       
   288 		</templateGroup>
       
   289 	
       
   290 		
       
   291 	</sourceGen>
       
   292 		
       
   293 	</component>
       
   294 </componentDefinition>