uidesigner/com.nokia.sdt.series60.componentlibrary/components/transient/StylusPopup.component
author timkelly
Thu, 23 Apr 2009 08:52:08 -0500
branchRCL_2_0
changeset 117 bac3606e1ea9
parent 2 d760517a8095
permissions -rw-r--r--
fix bug 8914. endless sdk refresh when devices.xml is empty or has xml format error
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
	<component baseComponent="com.nokia.sdt.series60.NonLayoutBase" 
cawthron
parents:
diff changeset
    13
		friendlyName="%friendlyName" 
cawthron
parents:
diff changeset
    14
		qualifiedName="com.nokia.sdt.series60.StylusPopup" 
cawthron
parents:
diff changeset
    15
		category="Menu"
cawthron
parents:
diff changeset
    16
		instanceNameRoot="stylusPopup"
cawthron
parents:
diff changeset
    17
		version="1.0">
cawthron
parents:
diff changeset
    18
		
cawthron
parents:
diff changeset
    19
		<documentation>
cawthron
parents:
diff changeset
    20
			<information>%information</information>
cawthron
parents:
diff changeset
    21
		</documentation>
cawthron
parents:
diff changeset
    22
		
cawthron
parents:
diff changeset
    23
		<symbian sdkName="com.nokia.series60" minSDKVersion="5.0" 
cawthron
parents:
diff changeset
    24
			className="CAknStylusPopUpMenu" classHelpTopic=""
cawthron
parents:
diff changeset
    25
			resourceType="STYLUS_POPUP_MENU" resourceHelpTopic="" />
cawthron
parents:
diff changeset
    26
		
cawthron
parents:
diff changeset
    27
		<designerImages smallIconFile="StylusPopup_sm.png" 
cawthron
parents:
diff changeset
    28
			largeIconFile="StylusPopup.png" />
cawthron
parents:
diff changeset
    29
		
cawthron
parents:
diff changeset
    30
		<attributes>
cawthron
parents:
diff changeset
    31
			<attribute key="cpp-class-name">CAknStylusPopUpMenu</attribute>
cawthron
parents:
diff changeset
    32
			<attribute key="is-ccoecontrol-content">true</attribute>
cawthron
parents:
diff changeset
    33
			<attribute key="is-layout-container">true</attribute>
cawthron
parents:
diff changeset
    34
			<attribute key="is-transient-object">true</attribute>
cawthron
parents:
diff changeset
    35
			<attribute key="layout-type">ordered</attribute>
cawthron
parents:
diff changeset
    36
			<attribute key="ordered-layout-type">vertical-row</attribute>
cawthron
parents:
diff changeset
    37
			<attribute key="is-non-resizable-or-moveable-layout-object">true</attribute>
cawthron
parents:
diff changeset
    38
		</attributes>
cawthron
parents:
diff changeset
    39
		
cawthron
parents:
diff changeset
    40
		<properties>
cawthron
parents:
diff changeset
    41
			<compoundProperty category="Hidden" name="location" type="com.nokia.sdt.series60.locationProperty"
cawthron
parents:
diff changeset
    42
				editorClass="com.nokia.sdt.symbian.ui.editors.ReadOnlySummaryEditorFactory"/>
cawthron
parents:
diff changeset
    43
			<compoundProperty category="Hidden" name="size" type="com.nokia.sdt.series60.sizeProperty"
cawthron
parents:
diff changeset
    44
				editorClass="com.nokia.sdt.symbian.ui.editors.ReadOnlySummaryEditorFactory"/>
cawthron
parents:
diff changeset
    45
		</properties>
cawthron
parents:
diff changeset
    46
		
cawthron
parents:
diff changeset
    47
		<implementations>
cawthron
parents:
diff changeset
    48
			<implementation>
cawthron
parents:
diff changeset
    49
			    <interface id="com.nokia.sdt.datamodel.adapter.IVisualAppearance"/>
cawthron
parents:
diff changeset
    50
			    <interface id="com.nokia.sdt.datamodel.adapter.ILayout"/>
cawthron
parents:
diff changeset
    51
			    <interface id="com.nokia.sdt.datamodel.adapter.IDirectLabelEdit"/>
cawthron
parents:
diff changeset
    52
				<interface id="com.nokia.sdt.datamodel.adapter.IQueryContainment"/>
cawthron
parents:
diff changeset
    53
				<script file="StylusPopup.js" prototype="CAknStylusPopUpMenu"/>
cawthron
parents:
diff changeset
    54
			</implementation>
cawthron
parents:
diff changeset
    55
		</implementations>
cawthron
parents:
diff changeset
    56
		
cawthron
parents:
diff changeset
    57
		<sourceMapping>
cawthron
parents:
diff changeset
    58
			<mapResource struct="STYLUS_POPUP_MENU" headers="eikon.rh">
cawthron
parents:
diff changeset
    59
				<mapArrayMember property="." member="items"/>
cawthron
parents:
diff changeset
    60
			</mapResource>	
cawthron
parents:
diff changeset
    61
		</sourceMapping>
cawthron
parents:
diff changeset
    62
		
cawthron
parents:
diff changeset
    63
		<sourceGen>
cawthron
parents:
diff changeset
    64
		
cawthron
parents:
diff changeset
    65
			<template phase="HeaderIncludes"><![CDATA[
cawthron
parents:
diff changeset
    66
#include <AknStylusPopUpMenu.h>
cawthron
parents:
diff changeset
    67
]]>			</template>
cawthron
parents:
diff changeset
    68
cawthron
parents:
diff changeset
    69
			<template phase="InstanceVariables">
cawthron
parents:
diff changeset
    70
CAknStylusPopUpMenu* ${instanceMemberName};
cawthron
parents:
diff changeset
    71
			</template>	
cawthron
parents:
diff changeset
    72
			
cawthron
parents:
diff changeset
    73
			<template phase="ClassMethods">
cawthron
parents:
diff changeset
    74
void Show${instanceName$title}L( const TPoint&amp; point );
cawthron
parents:
diff changeset
    75
			</template>
cawthron
parents:
diff changeset
    76
			
cawthron
parents:
diff changeset
    77
			<template phase="Construct">
cawthron
parents:
diff changeset
    78
${instanceMemberName} = NULL;
cawthron
parents:
diff changeset
    79
				</template>
cawthron
parents:
diff changeset
    80
			
cawthron
parents:
diff changeset
    81
			<template phase="Destroy">
cawthron
parents:
diff changeset
    82
delete ${instanceMemberName};
cawthron
parents:
diff changeset
    83
${instanceMemberName} = NULL;
cawthron
parents:
diff changeset
    84
				</template>
cawthron
parents:
diff changeset
    85
			
cawthron
parents:
diff changeset
    86
			<inline scope="prototype">
cawthron
parents:
diff changeset
    87
${jsObject}.prototype.getCppClassName = function(instance) {
cawthron
parents:
diff changeset
    88
	return instance.properties.style;
cawthron
parents:
diff changeset
    89
}
cawthron
parents:
diff changeset
    90
			</inline>
cawthron
parents:
diff changeset
    91
		
cawthron
parents:
diff changeset
    92
			<template phase="ForwardDeclarations">
cawthron
parents:
diff changeset
    93
class CAknStylusPopUpMenu;
cawthron
parents:
diff changeset
    94
			</template>
cawthron
parents:
diff changeset
    95
			
cawthron
parents:
diff changeset
    96
			<defineLocation id="SHOW_STYLUS_MENU_METHOD" baseLocation="MAIN_FILE" 
cawthron
parents:
diff changeset
    97
			    realize="true"
cawthron
parents:
diff changeset
    98
				owned="true"
cawthron
parents:
diff changeset
    99
				location="function(${className}::Show${instanceName$title}L(const TPoint&amp;))">
cawthron
parents:
diff changeset
   100
				<template><![CDATA[
cawthron
parents:
diff changeset
   101
/**
cawthron
parents:
diff changeset
   102
 * Display the stylus popup menu for ${instanceName}. This method can be invoked
cawthron
parents:
diff changeset
   103
 * by your CCoeControl::HandlePointerEventL( const TPointerEvent& aPointerEvent ) function.
cawthron
parents:
diff changeset
   104
 *
cawthron
parents:
diff changeset
   105
 * For example:
cawthron
parents:
diff changeset
   106
 *		static_cast<${className}*>( iCommandObserver )->Show${instanceName$title}L( aPointerEvent.iParentPosition ); 
cawthron
parents:
diff changeset
   107
 *     
cawthron
parents:
diff changeset
   108
 * @param The location where the stylus was touched on the screen.
cawthron
parents:
diff changeset
   109
 */
cawthron
parents:
diff changeset
   110
void ${className}::Show${instanceName$title}L( const TPoint& point )
cawthron
parents:
diff changeset
   111
	{
cawthron
parents:
diff changeset
   112
	if ( ${instanceMemberName} == NULL ) 
cawthron
parents:
diff changeset
   113
		{
cawthron
parents:
diff changeset
   114
		// Construct the menu from resources
cawthron
parents:
diff changeset
   115
		${instanceMemberName} = CAknStylusPopUpMenu::NewL( ( MEikMenuObserver* )this, 
cawthron
parents:
diff changeset
   116
														point, NULL );
cawthron
parents:
diff changeset
   117
		TInt resourceReaderId = 0;
cawthron
parents:
diff changeset
   118
	    resourceReaderId = ${resourceName$upper};
cawthron
parents:
diff changeset
   119
	    TResourceReader reader;
cawthron
parents:
diff changeset
   120
	    iCoeEnv->CreateResourceReaderLC( reader , resourceReaderId );
cawthron
parents:
diff changeset
   121
	    ${instanceMemberName}->ConstructFromResourceL( reader );
cawthron
parents:
diff changeset
   122
	    CleanupStack::PopAndDestroy(); // reader
cawthron
parents:
diff changeset
   123
	    }
cawthron
parents:
diff changeset
   124
	${instanceMemberName}->SetPosition( point );
cawthron
parents:
diff changeset
   125
	${instanceMemberName}->ShowMenu();
cawthron
parents:
diff changeset
   126
	}
cawthron
parents:
diff changeset
   127
]]>	
cawthron
parents:
diff changeset
   128
				</template>
cawthron
parents:
diff changeset
   129
			</defineLocation>
cawthron
parents:
diff changeset
   130
cawthron
parents:
diff changeset
   131
			<inline >
cawthron
parents:
diff changeset
   132
contribs.addAll(Engine.generateChildContributions(form))
cawthron
parents:
diff changeset
   133
			</inline>
cawthron
parents:
diff changeset
   134
cawthron
parents:
diff changeset
   135
			
cawthron
parents:
diff changeset
   136
		</sourceGen>
cawthron
parents:
diff changeset
   137
cawthron
parents:
diff changeset
   138
	</component>
cawthron
parents:
diff changeset
   139
cawthron
parents:
diff changeset
   140
</componentDefinition>