uidesigner/com.nokia.sdt.component.symbian.test/data/display/script_queryContainment.js
author Ed Swartz <ed.swartz@nokia.com>
Fri, 28 May 2010 14:29:31 -0500
changeset 1416 809f579bf32c
parent 0 fb279309251b
permissions -rw-r--r--
Add temporary "USB (TCF)" connection type for accessing the target-side Symbian TCF agent.



function QueryContainment() {
}


function doComponentCheck(instance, componentId) {
	return instance.componentId == componentId;
}

function doComponentCheckStatus(instance, componentId) {
	if (doComponentCheck(instance, componentId))
		return null;
		
	statusBuilder = newStatusBuilder();
	params = new Array(1);
	params[0] = componentId;
	statusBuilder.add(4, "Test {0}", params);
	return statusBuilder.createStatus("", null);
}

QueryContainment.prototype.canContainComponent = function(instance, otherComponent) {
	return doComponentCheckStatus(instance, otherComponent.id);
}

QueryContainment.prototype.canContainChild = function(instance, child) {
	return this.canContainComponent(instance.attributes, child.componentId);
}

QueryContainment.prototype.canRemoveChild = function(instance, child) {
	return doComponentCheck(instance, child.componentId);
}