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