uidesigner/com.nokia.sdt.series60.componentlibrary/components/containers/CAknDialog_queryContainment.js
changeset 2 d760517a8095
equal deleted inserted replaced
-1:000000000000 2:d760517a8095
       
     1 /*
       
     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 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 include("containerLibrary.js")
       
    20 
       
    21 function CAknDialogQueryContainment() {
       
    22 }
       
    23 
       
    24 function hasDialogContentAttribute(componentAttributes) {
       
    25 	return hasAttributeValue(componentAttributes, "is-dialog-content", "true");
       
    26 }
       
    27 
       
    28 CAknDialogQueryContainment.prototype.canContainComponent = function(instance, otherComponent) {
       
    29 	if (!hasDialogContentAttribute(otherComponent.attributes))
       
    30 		return buildSimpleContainmentErrorStatus(
       
    31 			lookupString("generalContainmentError"), 
       
    32 			new Array( otherComponent.friendlyName ));
       
    33 		
       
    34 	return null;
       
    35 }
       
    36 
       
    37 CAknDialogQueryContainment.prototype.canContainChild = function(instance, child) {
       
    38 	if (!hasDialogContentAttribute(child.component.attributes))
       
    39 		return buildSimpleContainmentErrorStatus(
       
    40 			lookupString("generalContainmentError"), 
       
    41 			new Array( child.component.friendlyName ));
       
    42 	
       
    43 	return null;
       
    44 }
       
    45 
       
    46 CAknDialogQueryContainment.prototype.canRemoveChild = function(instance, child) {
       
    47 	return true; // everything can be removed
       
    48 }
       
    49 
       
    50 CAknDialogQueryContainment.prototype.isValidComponentInPalette = function(instance, otherComponent) {
       
    51 	return hasDialogContentAttribute(otherComponent.attributes);
       
    52 }
       
    53 
       
    54