javauis/lcdui_akn/lcdui/src/CMIDApplication.cpp
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2003-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 "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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32def.h>
       
    20 #include <s60commonutils.h>
       
    21 
       
    22 #include "CMIDAppUi.h"
       
    23 // using GetResourceFileName function
       
    24 
       
    25 #include "coreuiavkonlcdui.h"
       
    26 
       
    27 _LIT(KLcduiResourceFileName, "lcdui.rsc");
       
    28 
       
    29 void doCreateAppL()
       
    30 {
       
    31     CMIDAppUi* appui = new(ELeave) CMIDAppUi();
       
    32     appui->ConstructL();
       
    33     CCoeEnv* env = CCoeEnv::Static();
       
    34 
       
    35     TFileName fileName;
       
    36     fileName.Append(KLcduiResourceFileName);
       
    37     fileName = java::util::S60CommonUtils::ResourceLanguageFileNameL(fileName);
       
    38 
       
    39     int offset = 0;
       
    40     TRAP_IGNORE(offset = env->AddResourceFileL(fileName));
       
    41     // The CoreUi owns now the appui.
       
    42     java::ui::CoreUiAvkonLcdui::getInstance().getJavaUiAppUi()->setLcduiChild(appui, offset);
       
    43 }
       
    44 
       
    45 EXPORT_C int createApp()
       
    46 {
       
    47     TRAPD(err, doCreateAppL());
       
    48     return err;
       
    49 }