uidesigner/com.nokia.sdt.series60.componentlibrary/components/transient/SingleLineDataQuery.inc
author Frank Turovich <frank.turovich@nokia.com>
Thu, 02 Apr 2009 15:09:04 -0500
changeset 24 f2ad263823f3
parent 2 d760517a8095
permissions -rw-r--r--
added DS_Store to hgignore list
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
cawthron
parents:
diff changeset
     1
			<inline scope="prototype">
cawthron
parents:
diff changeset
     2
include("popupDialogLibrary.js");
cawthron
parents:
diff changeset
     3
${jsObject}.prototype.getStrings = function(instance) {
cawthron
parents:
diff changeset
     4
	this.dialogClassName = getChildAttribute(instance, 0, "dataquery-className"); 
cawthron
parents:
diff changeset
     5
	this.methodType = getChildAttribute(instance, 0, "data-model-cpp-type");
cawthron
parents:
diff changeset
     6
}
cawthron
parents:
diff changeset
     7
			</inline>
cawthron
parents:
diff changeset
     8
			
cawthron
parents:
diff changeset
     9
			<inline>
cawthron
parents:
diff changeset
    10
this.getStrings(instance);			
cawthron
parents:
diff changeset
    11
			</inline>
cawthron
parents:
diff changeset
    12
			
cawthron
parents:
diff changeset
    13
			<template phase="ClassMethods"><![CDATA[
cawthron
parents:
diff changeset
    14
static TInt Run${instanceName$title}L( 
cawthron
parents:
diff changeset
    15
		${this.methodType}& aData, 
cawthron
parents:
diff changeset
    16
		TBool aUseDefaults = ETrue, 
cawthron
parents:
diff changeset
    17
		const TDesC* aOverridePrompt = NULL );
cawthron
parents:
diff changeset
    18
]]>			</template>
cawthron
parents:
diff changeset
    19
cawthron
parents:
diff changeset
    20
			<defineLocation id="METHOD_LOCATION" baseLocation="MAIN_FILE" 
cawthron
parents:
diff changeset
    21
				owned="true"
cawthron
parents:
diff changeset
    22
				location="function(${className}::Run${instanceName$title}L(...))">
cawthron
parents:
diff changeset
    23
				<template><![CDATA[
cawthron
parents:
diff changeset
    24
/**
cawthron
parents:
diff changeset
    25
 * Show the popup dialog for ${instanceName}
cawthron
parents:
diff changeset
    26
 * @param aData in-out ${this.methodType} data
cawthron
parents:
diff changeset
    27
 * @param aUseDefaults TBool use designer default editor data if ETrue
cawthron
parents:
diff changeset
    28
 * @param aOverridePrompt optional override prompt text
cawthron
parents:
diff changeset
    29
 * @return EAknSoftkeyOk (left soft key id) or 0
cawthron
parents:
diff changeset
    30
 */
cawthron
parents:
diff changeset
    31
TInt ${className}::Run${instanceName$title}L( 
cawthron
parents:
diff changeset
    32
		${this.methodType}& aData, 
cawthron
parents:
diff changeset
    33
		TBool aUseDefaults, 
cawthron
parents:
diff changeset
    34
		const TDesC* aOverridePrompt )
cawthron
parents:
diff changeset
    35
	{
cawthron
parents:
diff changeset
    36
	}
cawthron
parents:
diff changeset
    37
]]>				</template>
cawthron
parents:
diff changeset
    38
				
cawthron
parents:
diff changeset
    39
			</defineLocation>
cawthron
parents:
diff changeset
    40
			<template location="METHOD_LOCATION"><![CDATA[
cawthron
parents:
diff changeset
    41
if ( aUseDefaults )
cawthron
parents:
diff changeset
    42
	{
cawthron
parents:
diff changeset
    43
<%		var setDataContribs = Engine.generateChildContributions("AknDataQuerySetData");
cawthron
parents:
diff changeset
    44
		// resolve the contents to this method
cawthron
parents:
diff changeset
    45
		Engine.assignLocationsForPhase(setDataContribs, "SetData", "METHOD_LOCATION")
cawthron
parents:
diff changeset
    46
		contribs.addAll(setDataContribs);
cawthron
parents:
diff changeset
    47
%>	}
cawthron
parents:
diff changeset
    48
<% // EFixedPointLayout case added because CAknFixedPointQueryDialog::NewL does not have default argument
cawthron
parents:
diff changeset
    49
if ((properties.tone != "ENoTone") || (properties.type == "EFixedPointLayout")) { %>
cawthron
parents:
diff changeset
    50
${this.dialogClassName}* queryDialog = ${this.dialogClassName}::NewL( 
cawthron
parents:
diff changeset
    51
		aData, 
cawthron
parents:
diff changeset
    52
		CAknQueryDialog::${properties.tone} );	
cawthron
parents:
diff changeset
    53
<% } else { %>			
cawthron
parents:
diff changeset
    54
${this.dialogClassName}* queryDialog = ${this.dialogClassName}::NewL( aData );	
cawthron
parents:
diff changeset
    55
<% } %>
cawthron
parents:
diff changeset
    56
if ( aOverridePrompt != NULL )
cawthron
parents:
diff changeset
    57
	{
cawthron
parents:
diff changeset
    58
	CleanupStack::PushL( queryDialog );
cawthron
parents:
diff changeset
    59
	queryDialog->SetPromptL( *aOverridePrompt );
cawthron
parents:
diff changeset
    60
	CleanupStack::Pop(); // queryDialog
cawthron
parents:
diff changeset
    61
	}
cawthron
parents:
diff changeset
    62
cawthron
parents:
diff changeset
    63
return queryDialog->ExecuteLD( ${resourceName$upper} );
cawthron
parents:
diff changeset
    64
]]>			</template>
cawthron
parents:
diff changeset
    65
cawthron
parents:
diff changeset
    66
			<template phase="MainSystemIncludes"><![CDATA[
cawthron
parents:
diff changeset
    67
#include <aknquerydialog.h>
cawthron
parents:
diff changeset
    68
]]>			</template>
cawthron
parents:
diff changeset
    69
	
cawthron
parents:
diff changeset
    70
	<inline>
cawthron
parents:
diff changeset
    71
		if (Engine.formMatches(form, [""]))
cawthron
parents:
diff changeset
    72
			contribs.addAll(Engine.generateChildContributions("AknDataQuery"))
cawthron
parents:
diff changeset
    73
	</inline>	
cawthron
parents:
diff changeset
    74