javauis/coreui_qt/javasrc/com/nokia/mj/impl/coreuiqt/CoreUiImpl.java
changeset 79 2f468c1958d0
child 80 d6dafc5d983f
equal deleted inserted replaced
76:4ad59aaee882 79:2f468c1958d0
       
     1 /*
       
     2 * Copyright (c) 2009 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 "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: Java side Core UI accessor.
       
    15 *
       
    16 */
       
    17 package com.nokia.mj.impl.coreuiqt;
       
    18 
       
    19 import com.nokia.mj.impl.utils.Uid;
       
    20 import com.nokia.mj.impl.rt.support.Jvm;
       
    21 import com.nokia.mj.impl.rt.support.ApplicationUtils;
       
    22 import com.nokia.mj.impl.rt.support.ApplicationInfo;
       
    23 import com.nokia.mj.impl.coreui.CoreUi;
       
    24 
       
    25 
       
    26 /**
       
    27  * A gate to CoreUi Qt implementation.
       
    28  */
       
    29 public class CoreUiImpl extends CoreUi
       
    30 {
       
    31 
       
    32     public CoreUiImpl()
       
    33     {
       
    34         // Load the native.
       
    35         Jvm.loadSystemLibrary("javacoreui");
       
    36     }
       
    37 
       
    38     /**
       
    39      * Connects to the already created CoreUi.
       
    40      * @return permission to start the application. There is a small time
       
    41      *         window where user is able to cancel the application
       
    42      *         start. In this case the CoreUi stores the request and
       
    43      *         informs the caller of this method that the application
       
    44      *         should not be started.
       
    45      */
       
    46     protected boolean connectToUiImpl()
       
    47     {
       
    48         return true;
       
    49     }
       
    50 
       
    51     /**
       
    52      * For creating the UI from Java side. This is meant for the pre-warmed
       
    53      * VM use case. Calling this method will lead creation of the CoreUI.
       
    54      * @param uid The UID of the application.
       
    55      * @param backGroundStart Should the UI be put into background.
       
    56      */
       
    57     protected void createUiImpl(Uid uid, boolean backGroundStart)
       
    58     {
       
    59         // CoreUiStartScreen.showStartScreen(backGroundStart);
       
    60     }
       
    61 
       
    62     /**
       
    63      * For asking the runtime to do the shutdown of the application.
       
    64      */
       
    65     protected void shutdownRequestImpl()
       
    66     {
       
    67         ApplicationUtils.getInstance().notifyExitCmd();
       
    68     }
       
    69 
       
    70     /**
       
    71      * For asking the runtime to bring the application to foreground.
       
    72      */
       
    73     protected void foregroundRequestImpl()
       
    74     {
       
    75     }
       
    76 
       
    77     /**
       
    78      * For asking if the UI is in foreground.
       
    79      */
       
    80     protected boolean isUiInForegroundImpl()
       
    81     {
       
    82         return true;
       
    83     }
       
    84 
       
    85     /**
       
    86      * For asking if the UI to remove the icon from the task manager.
       
    87      */
       
    88     protected void hideApplicationImpl(boolean hide)
       
    89     {
       
    90         // Native logic is reversed between Symbian^3 and Symbian^4.
       
    91         // platform specific part.
       
    92         _hideApplication(!hide);
       
    93     }
       
    94 
       
    95     private native void _hideApplication(boolean hide);
       
    96 }