uidesigner/com.nokia.sdt.series60.componentlibrary/components/statuspane/StatusPaneContextAppIcon_2.x.js
changeset 0 fb279309251b
equal deleted inserted replaced
-1:000000000000 0:fb279309251b
       
     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("../implLibrary.js")
       
    20 include("../renderLibrary.js")
       
    21 include("../srcgenLibrary.js")
       
    22 
       
    23 function StatusPaneAppIcon() {
       
    24 }
       
    25 
       
    26 StatusPaneAppIcon.prototype.draw = function(instance, laf, graphics) {
       
    27 	var properties = instance.properties;
       
    28 	
       
    29 	if (laf.getBoolean("show.context.icon", true)) {
       
    30 		graphics.setBackground(getBackgroundColor(instance, laf));
       
    31 
       
    32 		// get image from primary AIF file
       
    33 		var imageAIFRendering = createSymbianImageAIFRendering();
       
    34 		imageAIFRendering.setImageFromAIF(instance, "image", laf, null, 1);
       
    35 	
       
    36 		imageAIFRendering.setTransparencyHandling(
       
    37 			imageAIFRendering.TRANSPARENCY_FLATTEN_AND_BLEND);
       
    38 		imageAIFRendering.render(graphics.getWrappedGC(), 0, 0);
       
    39 	}
       
    40 	
       
    41 }
       
    42 
       
    43 StatusPaneAppIcon.prototype.getViewableSize = function(instance, propertyId, laf) {
       
    44 	var	size = instance.properties.size;
       
    45 	return new Point(size.width, size.height);
       
    46 }
       
    47 
       
    48 StatusPaneAppIcon.prototype.isScaling = function(instance, propertyId, laf) {
       
    49 	return isScalingIcons();
       
    50 }
       
    51 
       
    52 StatusPaneAppIcon.prototype.getAlignmentWeights = function(instance, propertyId, laf) {
       
    53 	return new Point(ImageUtils.ALIGN_CENTER_OR_LEFT, ImageUtils.ALIGN_CENTER_OR_TOP);
       
    54 }
       
    55 
       
    56 StatusPaneAppIcon.prototype.isPreservingAspectRatio = function(instance, propertyId, laf) {
       
    57 	return true;
       
    58 }
       
    59 
       
    60 
       
    61 StatusPaneAppIcon.prototype.getPreferredSize = function(instance, laf, wHint, hHint) {
       
    62 	return null; // needs implementation	
       
    63 }