wlansecuritysettings/wifiprotectedsetup/src/wifiprotuiclientimpl.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 class CWiFiProtUiClientImpl.     
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include <bautils.h>
       
    22 #include <StringLoader.h>
       
    23 #include <commdb.h>
       
    24 #include <aknnotewrappers.h>
       
    25 #include <wifiprotuiclient.h>
       
    26 #include <AknsUtils.h>
       
    27 
       
    28 #ifndef __WINS__
       
    29 #include <wlanmgmtclient.h>
       
    30 #include <WlanCdbCols.h>
       
    31 #endif  // ! __WINS__
       
    32 #include <data_caging_path_literals.hrh>
       
    33 
       
    34 #include "wifiprotuiclientimpl.h"
       
    35 #include "wifiprotlogger.h"
       
    36 
       
    37 
       
    38 // ================= MEMBER FUNCTIONS =======================
       
    39 
       
    40 // --------------------------------------------------------------------------
       
    41 // CWiFiProtUiClientImpl::NewL
       
    42 // --------------------------------------------------------------------------
       
    43 //
       
    44 CWiFiProtUiClientImpl* CWiFiProtUiClientImpl::NewL()
       
    45     {
       
    46     CLOG_ENTERFN( "CWiFiProtUiClientImpl::NewL" );
       
    47     CWiFiProtUiClientImpl* clientImpl = 
       
    48                                 new ( ELeave ) CWiFiProtUiClientImpl();
       
    49     CleanupStack::PushL( clientImpl );
       
    50     clientImpl->ConstructL();
       
    51     CleanupStack::Pop( clientImpl );
       
    52     CLOG_LEAVEFN( "CWiFiProtUiClientImpl::NewL" );
       
    53     return clientImpl;
       
    54     }
       
    55 
       
    56 // --------------------------------------------------------------------------
       
    57 // CWiFiProtUiClientImpl::~CWiFiProtUiClientImpl
       
    58 // --------------------------------------------------------------------------
       
    59 //
       
    60 CWiFiProtUiClientImpl::~CWiFiProtUiClientImpl()
       
    61     {  
       
    62     CLOG_ENTERFN( "CWiFiProtUiClientImpl::~CWiFiProtUiClientImpl" );  
       
    63     delete iWiFiProtSyncClient;
       
    64     iNotif.Close();
       
    65     CLOG_LEAVEFN( "CWiFiProtUiClientImpl::~CWiFiProtUiClientImpl" );
       
    66     }
       
    67     
       
    68 // --------------------------------------------------------------------------
       
    69 // CWiFiProtUiClientImpl::StartWiFiProtL
       
    70 // --------------------------------------------------------------------------
       
    71 //
       
    72 void CWiFiProtUiClientImpl::StartWiFiProtL( const TWlanSsid& aSSid,
       
    73                                          TBool aConnectionNeeded,
       
    74                                          RArray<TUint32>& aUidsReturned,
       
    75                                          WiFiProt::TWiFiReturn& aReturnValue,
       
    76                                          TRequestStatus& aStatus )
       
    77     {
       
    78     CLOG_ENTERFN( "CWiFiProtUiClientImpl::StartWiFiProtL" );
       
    79     iNotif.StartWiFiProtL( aSSid, aConnectionNeeded,
       
    80                            aUidsReturned, aReturnValue, aStatus );
       
    81     CLOG_LEAVEFN( "CWiFiProtUiClientImpl::StartWiFiProtL" );        
       
    82     }
       
    83     
       
    84  // --------------------------------------------------------------------------
       
    85 // CWiFiProtUiClientImpl::StartWiFiProtSyncL
       
    86 // --------------------------------------------------------------------------
       
    87 //
       
    88 WiFiProt::TWiFiReturn 
       
    89 CWiFiProtUiClientImpl::StartWiFiProtSyncL( const TWlanSsid& aSSid,
       
    90                                          TBool aConnectionNeeded,
       
    91                                          RArray<TUint32>& aUidsReturned )
       
    92     {
       
    93     CLOG_WRITE( "CWiFiProtUiClientImpl::StartWiFiProtSyncL" );
       
    94     if (iWiFiProtSyncClient == NULL)
       
    95         {
       
    96         iWiFiProtSyncClient = CWiFiProtSyncClient::NewL( iNotif );
       
    97         }
       
    98     return iWiFiProtSyncClient->StartWiFiProtL( aSSid,
       
    99                                          aConnectionNeeded, aUidsReturned );
       
   100     }
       
   101 
       
   102 // ---------------------------------------------------------
       
   103 // CWiFiProtUiClientImpl::StartWiFiProtConnL
       
   104 // ---------------------------------------------------------
       
   105 //
       
   106 void CWiFiProtUiClientImpl::StartWiFiProtConnL( const TWlanSsid& aSSid,
       
   107                                       TWlanProtectedSetupCredentialAttribute&
       
   108                                         aNetworkSettings,
       
   109                                       WiFiProt::TWiFiReturn& aReturnValue,
       
   110                                       TRequestStatus& aStatus )
       
   111     {
       
   112     CLOG_ENTERFN( "CWiFiProtUiClientImpl::StartWiFiProtConnL" );
       
   113     iNotif.StartWiFiProtConnL( aSSid, aNetworkSettings, aReturnValue, aStatus );
       
   114     CLOG_LEAVEFN( "CWiFiProtUiClientImpl::StartWiFiProtConnL" );
       
   115     }
       
   116     
       
   117 // --------------------------------------------------------------------------
       
   118 // CWiFiProtUiClientImpl::CancelWiFiProt
       
   119 // --------------------------------------------------------------------------
       
   120 //
       
   121 void CWiFiProtUiClientImpl::CancelWiFiProt(  )
       
   122     {
       
   123     CLOG_ENTERFN( "CWiFiProtUiClientImpl::CancelWiFiProt()" );
       
   124     iNotif.CancelWiFiProt( );
       
   125     CLOG_LEAVEFN( "CWiFiProtUiClientImpl::CancelWiFiProt()" );        
       
   126     }
       
   127 
       
   128 // --------------------------------------------------------------------------
       
   129 // CWiFiProtUiClientImpl::CWiFiProtUiClientImpl
       
   130 // --------------------------------------------------------------------------
       
   131 //
       
   132 CWiFiProtUiClientImpl::CWiFiProtUiClientImpl()
       
   133     {
       
   134     }
       
   135 
       
   136 // --------------------------------------------------------------------------
       
   137 // CWiFiProtUiClientImpl::ConstructL
       
   138 // --------------------------------------------------------------------------
       
   139 //
       
   140 void CWiFiProtUiClientImpl::ConstructL()
       
   141     {
       
   142     CLOG_ENTERFN( "CWiFiProtUiClientImpl::ConstructL" );
       
   143     User::LeaveIfError( iNotif.Connect() );
       
   144     CLOG_LEAVEFN( "CWiFiProtUiClientImpl::ConstructL" ); 
       
   145     }    
       
   146 // End of File