wlansecuritysettings/wlaneapsettingsui/EapSim/ConfigUi/src/EapSimUi.cpp
branchRCL_3
changeset 46 c74b3d9f6b9e
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
       
     1 /*
       
     2 * Copyright (c) 2001-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 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: Implementation of EAP SIM UI class
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 15 %
       
    20 */
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include "EapSimUi.h"
       
    24 #include <EapSimUiConnection.h>
       
    25 #include "EapSimUiView.h"
       
    26 #include <eapsimui.rsg>
       
    27 #include <bautils.h>
       
    28 #include <coemain.h>
       
    29 #include <aknnotewrappers.h>
       
    30 #include <data_caging_path_literals.hrh>
       
    31 
       
    32 
       
    33 // CONSTANTS
       
    34 _LIT( KDriveZ, "z:" );                               // ROM folder
       
    35 _LIT( KResourceFileName, "eapsimui.rsc" );
       
    36 
       
    37 
       
    38 // CLASS DECLARATION
       
    39 class TResourceFileCleanupItem
       
    40     {
       
    41     public:
       
    42         CCoeEnv* iCoeEnv;
       
    43         TInt iResourceFileOffset;
       
    44     }; 
       
    45 
       
    46 
       
    47 // ============================= LOCAL FUNCTIONS ===============================
       
    48 
       
    49 // -----------------------------------------------------------------------------
       
    50 // CleanupResourceFile
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 static void CleanupResourceFile( TAny* aObject )
       
    54     {
       
    55     TResourceFileCleanupItem* item = 
       
    56                         REINTERPRET_CAST( TResourceFileCleanupItem*, aObject );
       
    57     item->iCoeEnv->DeleteResourceFile( item->iResourceFileOffset );
       
    58     delete item;
       
    59     }
       
    60 
       
    61 
       
    62 // ============================ MEMBER FUNCTIONS ===============================
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CEapSimUi::CEapSimUi
       
    66 // -----------------------------------------------------------------------------
       
    67 //
       
    68 CEapSimUi::CEapSimUi( CEapSimUiConnection* aConnection ) 
       
    69 : iConnection( aConnection )
       
    70     {
       
    71     }
       
    72 
       
    73 
       
    74 // -----------------------------------------------------------------------------
       
    75 // CEapSimUi::NewL
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 CEapSimUi* CEapSimUi::NewL( CEapSimUiConnection* aConnection )
       
    79     {
       
    80     CEapSimUi* self = new ( ELeave ) CEapSimUi( aConnection );
       
    81     CleanupStack::PushL( self );
       
    82     self->ConstructL();
       
    83     CleanupStack::Pop( self );    
       
    84     return self;
       
    85     }
       
    86 
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // CEapSimUi::ConstructL
       
    90 // -----------------------------------------------------------------------------
       
    91 //
       
    92 void CEapSimUi::ConstructL()
       
    93     {
       
    94     }
       
    95 
       
    96 
       
    97 // -----------------------------------------------------------------------------
       
    98 // CEapSimUi::~CEapSimUi
       
    99 // -----------------------------------------------------------------------------
       
   100 //
       
   101 CEapSimUi::~CEapSimUi()
       
   102     {
       
   103     }
       
   104 
       
   105 
       
   106 // -----------------------------------------------------------------------------
       
   107 // CEapSimUi::InvokeUiL
       
   108 // -----------------------------------------------------------------------------
       
   109 //
       
   110 TInt CEapSimUi::InvokeUiL()
       
   111     {
       
   112     TFileName fileName;
       
   113 
       
   114     fileName.Append( KDriveZ );
       
   115     fileName.Append( KDC_RESOURCE_FILES_DIR );
       
   116     fileName.Append( KResourceFileName );
       
   117 
       
   118     CCoeEnv* coeEnv = CCoeEnv::Static();
       
   119     BaflUtils::NearestLanguageFile( coeEnv->FsSession(), fileName );
       
   120 
       
   121     TResourceFileCleanupItem* item = new( ELeave ) TResourceFileCleanupItem;
       
   122 
       
   123     item->iCoeEnv = coeEnv;
       
   124     CleanupStack::PushL( TCleanupItem( CleanupResourceFile, item ) );
       
   125     item->iResourceFileOffset = coeEnv->AddResourceFileL( fileName );
       
   126 
       
   127     TInt buttonId;
       
   128     CEapSimUiDialog* settingsDlg = new( ELeave ) CEapSimUiDialog( iConnection,
       
   129                                                                   buttonId );
       
   130     settingsDlg->ConstructAndRunLD( R_SIM_SETTING_DIALOG );
       
   131 
       
   132     CleanupStack::PopAndDestroy();  // For resource file
       
   133 
       
   134     return buttonId;
       
   135     }
       
   136 
       
   137 
       
   138 //  End of File