javauis/coreui_qt/src/coreuiqtimpl.cpp
changeset 79 2f468c1958d0
equal deleted inserted replaced
76:4ad59aaee882 79:2f468c1958d0
       
     1 /*
       
     2 * Copyright (c) 2010 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: A CoreUi QT implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #include <string.h>
       
    19 // #include <hbsplashscreen.h>
       
    20 
       
    21 #include "logger.h"
       
    22 #include "coreuiqtimpl.h"
       
    23 #include "runtimeexception.h"
       
    24 #include "javacommonutils.h"
       
    25 
       
    26 using namespace java::ui;
       
    27 using namespace java::util;
       
    28 
       
    29 // ======== STATIC VARIABLES ========
       
    30 
       
    31 /**
       
    32 * Singleton
       
    33 */
       
    34 static CoreUiQtImpl* sCoreUiQtImpl = 0;
       
    35 
       
    36 CoreUiQtImpl* getCoreUi()
       
    37 {
       
    38     if (sCoreUiQtImpl == 0)
       
    39     {
       
    40         sCoreUiQtImpl = new CoreUiQtImpl(); // codescanner::nonleavenew
       
    41     }
       
    42     return sCoreUiQtImpl;
       
    43 }
       
    44 
       
    45 #ifndef __SYMBIAN32__
       
    46 extern_c
       
    47 #endif // __SYMBIAN32__
       
    48 CoreUi& getUiInstance()
       
    49 {
       
    50     JELOG2(EJavaUI);
       
    51     return *getCoreUi();
       
    52 }
       
    53 
       
    54 #ifndef __SYMBIAN32__
       
    55 extern_c
       
    56 #endif // __SYMBIAN32__
       
    57 void releaseUi()
       
    58 {
       
    59     JELOG2(EJavaUI);
       
    60     ELOG(EJavaUI, "CoreUiQtImpl::releaseUi -->");
       
    61 }
       
    62 
       
    63 #ifdef __SYMBIAN32__
       
    64 EXPORT_C FuncPtr findDllMethod(const char* funcName)
       
    65 {
       
    66     JELOG2(EJavaUI);
       
    67     FuncPtr ptr = 0;
       
    68     if (strcmp(funcName, "getUiInstance") == 0)
       
    69     {
       
    70         ptr = (FuncPtr)getUiInstance;
       
    71     }
       
    72     else if (strcmp(funcName, "releaseUi") == 0)
       
    73     {
       
    74         ptr = (FuncPtr)releaseUi;
       
    75     }
       
    76     return ptr;
       
    77 }
       
    78 #endif // __SYMBIAN32__
       
    79 
       
    80 CoreUiQtImpl::CoreUiQtImpl()
       
    81 {
       
    82     JELOG2(EJavaUI);
       
    83 }
       
    84 
       
    85 
       
    86 CoreUiQtImpl::~CoreUiQtImpl()
       
    87 {
       
    88     JELOG2(EJavaUI);
       
    89 }
       
    90 
       
    91 
       
    92 void CoreUiQtImpl::start(const java::util::Uid& /*midletUid*/,
       
    93                             CoreUiParams* /*uiParams*/)
       
    94 {
       
    95     JELOG2(EJavaUI);
       
    96     ELOG(EJavaUI, "CoreUiQtImpl::start -->");
       
    97 
       
    98 /*
       
    99     ELOG(EJavaUI, "HbSplashScreen::start() -->");
       
   100     QString uid = "10104305";
       
   101     __BREAKPOINT();
       
   102     HbSplashScreen::setAppId(uid);
       
   103     HbSplashScreen::start();
       
   104     User::After(5 * 1000 * 1000); // UID = 10104305
       
   105     ELOG(EJavaUI, "HbSplashScreen::start() <--");
       
   106 */
       
   107 }