javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/internal/extension/DisplayExtension.java
branchRCL_3
changeset 19 04becd199f91
child 60 6c158198356e
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*******************************************************************************
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved. This program and the accompanying materials
       
     4  * are made available under the terms of the Eclipse Public License v1.0
       
     5  * which accompanies this distribution, and is available at
       
     6  * http://www.eclipse.org/legal/epl-v10.html
       
     7  *
       
     8  * Contributors:
       
     9  *     Nokia Corporation - initial implementation
       
    10  *******************************************************************************/
       
    11 
       
    12 package org.eclipse.swt.internal.extension;
       
    13 
       
    14 import org.eclipse.swt.graphics.Point;
       
    15 import org.eclipse.swt.internal.symbian.OS;
       
    16 import org.eclipse.swt.widgets.Display;
       
    17 
       
    18 public final class DisplayExtension extends Display
       
    19 {
       
    20 
       
    21     /* Image types, same values as MIDP */
       
    22     public static final int LIST_ELEMENT = 1;
       
    23     public static final int CHOICE_GROUP_ELEMENT = 2;
       
    24     public static final int ALERT = 3;
       
    25 
       
    26     public DisplayExtension()
       
    27     {
       
    28         super();
       
    29     }
       
    30 
       
    31     /**
       
    32      * Determine the best width for the given image type.
       
    33      * @param imageType
       
    34      * @return Best height or -1 if invalid image type given.
       
    35      */
       
    36     public int getBestImageWidth(int imageType)
       
    37     {
       
    38         checkDevice();
       
    39         return getBestImageSize(imageType).x;
       
    40     }
       
    41 
       
    42     /**
       
    43      * Determine the best height for the given image type.
       
    44      * @param imageType
       
    45      * @return Best height or -1 if invalid image type given.
       
    46      */
       
    47     public int getBestImageHeight(int imageType)
       
    48     {
       
    49         checkDevice();
       
    50         return getBestImageSize(imageType).y;
       
    51     }
       
    52 
       
    53     private Point getBestImageSize(int imageType)
       
    54     {
       
    55         return OS.DisplayExtension_getBestImageSize(imageType);
       
    56     }
       
    57 
       
    58 }