connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/ConnectionUiUtilitiesImpl.cpp
changeset 61 8b0c979bbe8c
parent 41 bbb64eb3bdee
equal deleted inserted replaced
59:2709c04a4af5 61:8b0c979bbe8c
    22 
    22 
    23 #include <bautils.h>
    23 #include <bautils.h>
    24 #include <StringLoader.h>
    24 #include <StringLoader.h>
    25 #include <commdb.h>
    25 #include <commdb.h>
    26 #include <aknnotewrappers.h>
    26 #include <aknnotewrappers.h>
    27 #include <AknGlobalNote.h>
       
    28 #include <aknradiobuttonsettingpage.h>
    27 #include <aknradiobuttonsettingpage.h>
    29 #include <ConnectionUiUtilities.h>
    28 #include <ConnectionUiUtilities.h>
    30 #include <AknsUtils.h>
    29 #include <AknsUtils.h>
    31 #include <featmgr.h>
    30 #include <featmgr.h>
    32 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
    31 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
    43 
    42 
    44 #include "ConnectionUiUtilitiesImpl.h"
    43 #include "ConnectionUiUtilitiesImpl.h"
    45 #include "ChangeConnectionDlg.h"
    44 #include "ChangeConnectionDlg.h"
    46 #include "ActiveCChangeConnectionDlg.h"
    45 #include "ActiveCChangeConnectionDlg.h"
    47 #include "connectionstatuspopup.h"
    46 #include "connectionstatuspopup.h"
       
    47 #include "cellulardataconfirmation.h"
    48 
    48 
    49 #include <connectionuiutilities.rsg>
    49 #include <connectionuiutilities.rsg>
    50 #include <data_caging_path_literals.hrh>
    50 #include <data_caging_path_literals.hrh>
    51 
    51 
    52 #include "ConnectionDialogsLogger.h"
    52 #include "ConnectionDialogsLogger.h"
    87 : iResOffset( 0 ),
    87 : iResOffset( 0 ),
    88   iIsWlanSupported( EFalse ),
    88   iIsWlanSupported( EFalse ),
    89   iDummy( EFalse ),
    89   iDummy( EFalse ),
    90   iDummySecMode( EWlanConnectionSecurityOpen ),
    90   iDummySecMode( EWlanConnectionSecurityOpen ),
    91   iDummyExtSecMode( EWlanConnectionExtentedSecurityModeOpen ),
    91   iDummyExtSecMode( EWlanConnectionExtentedSecurityModeOpen ),
    92   iConnStatusPopup( NULL )
    92   iConnStatusPopup( NULL ),
       
    93   iCellularConfirmation( NULL )
    93     {
    94     {
    94     for ( TInt i = 0; i < KNumberOfWrappedDialogs; i++ )
    95     for ( TInt i = 0; i < KNumberOfWrappedDialogs; i++ )
    95         {
    96         {
    96         iActiveWrapper[i] = NULL;
    97         iActiveWrapper[i] = NULL;
    97         }
    98         }
   109     FeatureManager::InitializeLibL();
   110     FeatureManager::InitializeLibL();
   110     iIsWlanSupported = 
   111     iIsWlanSupported = 
   111                 FeatureManager::FeatureSupported( KFeatureIdProtocolWlan );
   112                 FeatureManager::FeatureSupported( KFeatureIdProtocolWlan );
   112     FeatureManager::UnInitializeLib();
   113     FeatureManager::UnInitializeLib();
   113     iConnStatusPopup = CConnectionStatusPopup::NewL();
   114     iConnStatusPopup = CConnectionStatusPopup::NewL();
       
   115     iCellularConfirmation = CCellularDataConfirmation::NewL();
   114     }
   116     }
   115 
   117 
   116 
   118 
   117 // ---------------------------------------------------------
   119 // ---------------------------------------------------------
   118 // CConnectionUiUtilitiesImpl::~CConnectionUiUtilitiesImpl
   120 // CConnectionUiUtilitiesImpl::~CConnectionUiUtilitiesImpl
   130         {
   132         {
   131         delete iActiveWrapper[i];
   133         delete iActiveWrapper[i];
   132         }
   134         }
   133 
   135 
   134     delete iConnStatusPopup;
   136     delete iConnStatusPopup;
       
   137     delete iCellularConfirmation;
   135     }
   138     }
   136 
   139 
   137 // ---------------------------------------------------------
   140 // ---------------------------------------------------------
   138 // CConnectionUiUtilitiesImpl::LoadResourceFileL
   141 // CConnectionUiUtilitiesImpl::LoadResourceFileL
   139 // ---------------------------------------------------------
   142 // ---------------------------------------------------------
   161 //
   164 //
   162 
   165 
   163 TBool CConnectionUiUtilitiesImpl::AlwaysAskPageL( 
   166 TBool CConnectionUiUtilitiesImpl::AlwaysAskPageL( 
   164                                                 TCuuAlwaysAskResults& aResult )
   167                                                 TCuuAlwaysAskResults& aResult )
   165     {
   168     {
       
   169     // Not used
   166     LoadResourceFileL();
   170     LoadResourceFileL();
   167     // options array
   171     // options array
   168     CDesCArrayFlat* values = new( ELeave )CDesCArrayFlat( 1 );
   172     CDesCArrayFlat* values = new( ELeave )CDesCArrayFlat( 1 );
   169     CleanupStack::PushL( values );
   173     CleanupStack::PushL( values );
   170 
   174 
   368                                 TWlanConnectionMode& aConnectionMode,
   372                                 TWlanConnectionMode& aConnectionMode,
   369                                 TWlanConnectionSecurityMode& aSecurityMode,
   373                                 TWlanConnectionSecurityMode& aSecurityMode,
   370                                 TWlanConnectionExtentedSecurityMode& aExtSecurityMode, 
   374                                 TWlanConnectionExtentedSecurityMode& aExtSecurityMode, 
   371                                 TBool& aProtectedSetupSupported )
   375                                 TBool& aProtectedSetupSupported )
   372     {
   376     {
       
   377     // Used only in to-be-removed apengine
   373     TBool result( EFalse );
   378     TBool result( EFalse );
   374     
   379     
   375     if ( iIsWlanSupported )
   380     if ( iIsWlanSupported )
   376         {
   381         {
   377         iNetworkPrefs();
   382         iNetworkPrefs();
   516 // CConnectionUiUtilitiesImpl::OffLineWlanNote
   521 // CConnectionUiUtilitiesImpl::OffLineWlanNote
   517 // ---------------------------------------------------------
   522 // ---------------------------------------------------------
   518 //
   523 //
   519 TBool CConnectionUiUtilitiesImpl::OffLineWlanNote()
   524 TBool CConnectionUiUtilitiesImpl::OffLineWlanNote()
   520     { 
   525     { 
       
   526     // Maps to KUidCOfflineWlanNoteDlg
       
   527     // Not used
       
   528 
   521     CLOG_ENTERFN( "CConnectionUiUtilitiesImpl::OffLineWlanNote" );    
   529     CLOG_ENTERFN( "CConnectionUiUtilitiesImpl::OffLineWlanNote" );    
   522 
   530 
   523     if ( iIsWlanSupported )
   531     if ( iIsWlanSupported )
   524         {
   532         {
   525         if ( !iActiveWrapper[EOffLineWlan] )
   533         if ( !iActiveWrapper[EOffLineWlan] )
   550 // ---------------------------------------------------------
   558 // ---------------------------------------------------------
   551 //
   559 //
   552 void CConnectionUiUtilitiesImpl::OffLineWlanNote( TRequestStatus& aStatus )
   560 void CConnectionUiUtilitiesImpl::OffLineWlanNote( TRequestStatus& aStatus )
   553     { 
   561     { 
   554     CLOG_ENTERFN( "CConnectionUiUtilitiesImpl::OffLineWlanNote Async" );    
   562     CLOG_ENTERFN( "CConnectionUiUtilitiesImpl::OffLineWlanNote Async" );    
   555 
   563     // Not used
   556     if ( iIsWlanSupported )
   564     if ( iIsWlanSupported )
   557         {
   565         {
   558         if ( iActiveWrapper[EOffLineWlan] )
   566         if ( iActiveWrapper[EOffLineWlan] )
   559             {   // deleting, to be sure to call the right Cancel function
   567             {   // deleting, to be sure to call the right Cancel function
   560             delete iActiveWrapper[EOffLineWlan];
   568             delete iActiveWrapper[EOffLineWlan];
   571 // CConnectionUiUtilitiesImpl::CancelOffLineWlanNote
   579 // CConnectionUiUtilitiesImpl::CancelOffLineWlanNote
   572 // ---------------------------------------------------------
   580 // ---------------------------------------------------------
   573 //
   581 //
   574 void CConnectionUiUtilitiesImpl::CancelOffLineWlanNote()
   582 void CConnectionUiUtilitiesImpl::CancelOffLineWlanNote()
   575     {
   583     {
       
   584     // Not used
   576     if ( iIsWlanSupported )    
   585     if ( iIsWlanSupported )    
   577         {
   586         {
   578         if ( iActiveWrapper[EOffLineWlan] )
   587         if ( iActiveWrapper[EOffLineWlan] )
   579             {
   588             {
   580             iActiveWrapper[EOffLineWlan]->Cancel();
   589             iActiveWrapper[EOffLineWlan]->Cancel();
   590 // CConnectionUiUtilitiesImpl::OffLineWlanDisabledNote
   599 // CConnectionUiUtilitiesImpl::OffLineWlanDisabledNote
   591 // ---------------------------------------------------------
   600 // ---------------------------------------------------------
   592 //
   601 //
   593 void CConnectionUiUtilitiesImpl::OffLineWlanDisabledNote()
   602 void CConnectionUiUtilitiesImpl::OffLineWlanDisabledNote()
   594     {
   603     {
       
   604     // Maps to KUidCOfflineWlanNoteDlg
       
   605     // Not used
   595     if ( iIsWlanSupported )    
   606     if ( iIsWlanSupported )    
   596         {
   607         {
   597         if ( !iActiveWrapper[EWlanDisabled] )
   608         if ( !iActiveWrapper[EWlanDisabled] )
   598             {
   609             {
   599             TRAP_IGNORE( iActiveWrapper[EWlanDisabled] = 
   610             TRAP_IGNORE( iActiveWrapper[EWlanDisabled] = 
   611 // CConnectionUiUtilitiesImpl::EasyWepDlg
   622 // CConnectionUiUtilitiesImpl::EasyWepDlg
   612 // ---------------------------------------------------------
   623 // ---------------------------------------------------------
   613 //
   624 //
   614 TBool CConnectionUiUtilitiesImpl::EasyWepDlg( TDes* aKey, TBool& aHex )
   625 TBool CConnectionUiUtilitiesImpl::EasyWepDlg( TDes* aKey, TBool& aHex )
   615     {
   626     {
       
   627     // Not used
   616     TInt status = KErrNone;
   628     TInt status = KErrNone;
   617     
   629     
   618     if ( iIsWlanSupported )    
   630     if ( iIsWlanSupported )    
   619         {
   631         {
   620         iWepKey().iKey.Copy( *aKey );
   632         iWepKey().iKey.Copy( *aKey );
   638 // CConnectionUiUtilitiesImpl::EasyWepDlgAsync
   650 // CConnectionUiUtilitiesImpl::EasyWepDlgAsync
   639 // ---------------------------------------------------------
   651 // ---------------------------------------------------------
   640 //
   652 //
   641 void CConnectionUiUtilitiesImpl::EasyWepDlgAsync( TRequestStatus& aStatus, TDes* aKey, TBool& aHex )
   653 void CConnectionUiUtilitiesImpl::EasyWepDlgAsync( TRequestStatus& aStatus, TDes* aKey, TBool& aHex )
   642     {
   654     {
       
   655     // Not used
   643     if ( iIsWlanSupported )    
   656     if ( iIsWlanSupported )    
   644         {
   657         {
   645         if ( !iActiveWrapper[EWlanEasyWep] )
   658         if ( !iActiveWrapper[EWlanEasyWep] )
   646             {
   659             {
   647             TRAP_IGNORE( iActiveWrapper[EWlanEasyWep] = 
   660             TRAP_IGNORE( iActiveWrapper[EWlanEasyWep] = 
   673 // CConnectionUiUtilitiesImpl::EasyWpaDlg
   686 // CConnectionUiUtilitiesImpl::EasyWpaDlg
   674 // ---------------------------------------------------------
   687 // ---------------------------------------------------------
   675 //
   688 //
   676 TBool CConnectionUiUtilitiesImpl::EasyWpaDlg( TDes* aKey )
   689 TBool CConnectionUiUtilitiesImpl::EasyWpaDlg( TDes* aKey )
   677     { 
   690     { 
       
   691     // Not used
   678     TInt status = KErrNone;
   692     TInt status = KErrNone;
   679     if ( iIsWlanSupported )    
   693     if ( iIsWlanSupported )    
   680         {
   694         {
   681         iWpaKey().Copy( *aKey );
   695         iWpaKey().Copy( *aKey );
   682         if ( !iActiveWrapper[EWlanEasyWpa] )
   696         if ( !iActiveWrapper[EWlanEasyWpa] )
   719 // CConnectionUiUtilitiesImpl::CancelEasyWpaDlg
   733 // CConnectionUiUtilitiesImpl::CancelEasyWpaDlg
   720 // ---------------------------------------------------------
   734 // ---------------------------------------------------------
   721 //
   735 //
   722 void CConnectionUiUtilitiesImpl::CancelEasyWpaDlg()
   736 void CConnectionUiUtilitiesImpl::CancelEasyWpaDlg()
   723     {
   737     {
       
   738     // Not used
   724     if ( iIsWlanSupported )    
   739     if ( iIsWlanSupported )    
   725         {
   740         {
   726         iActiveWrapper[EWlanEasyWpa]->Cancel();         
   741         iActiveWrapper[EWlanEasyWpa]->Cancel();         
   727         }
   742         }
   728     }
   743     }
   731 // CConnectionUiUtilitiesImpl::WLANNetworkUnavailableNote
   746 // CConnectionUiUtilitiesImpl::WLANNetworkUnavailableNote
   732 // ---------------------------------------------------------
   747 // ---------------------------------------------------------
   733 //
   748 //
   734 void CConnectionUiUtilitiesImpl::WLANNetworkUnavailableNote()
   749 void CConnectionUiUtilitiesImpl::WLANNetworkUnavailableNote()
   735     {
   750     {
       
   751     // Maps to KUidCOfflineWlanNoteDlg
       
   752     // Not used
       
   753 
   736     if ( iIsWlanSupported )    
   754     if ( iIsWlanSupported )    
   737         {
   755         {
   738         if ( !iActiveWrapper[EWlanNetwUnavail] )
   756         if ( !iActiveWrapper[EWlanNetwUnavail] )
   739             {
   757             {
   740             TRAP_IGNORE( iActiveWrapper[EWlanNetwUnavail] = 
   758             TRAP_IGNORE( iActiveWrapper[EWlanNetwUnavail] = 
   769 TBool CConnectionUiUtilitiesImpl::SearchWLANNetworkSync( TWlanSsid& aSSID,
   787 TBool CConnectionUiUtilitiesImpl::SearchWLANNetworkSync( TWlanSsid& aSSID,
   770                                 TWlanConnectionMode& aConnectionMode,
   788                                 TWlanConnectionMode& aConnectionMode,
   771                                 TWlanConnectionSecurityMode& aSecurityMode, 
   789                                 TWlanConnectionSecurityMode& aSecurityMode, 
   772                                 TBool& aProtectedSetupSupported )
   790                                 TBool& aProtectedSetupSupported )
   773     {
   791     {
       
   792     // Not used
   774     TBool result( EFalse );
   793     TBool result( EFalse );
   775     
   794     
   776     if ( iIsWlanSupported )
   795     if ( iIsWlanSupported )
   777         {
   796         {
   778         TRequestStatus status;
   797         TRequestStatus status;
   881                                 TWlanConnectionMode& aConnectionMode,
   900                                 TWlanConnectionMode& aConnectionMode,
   882                                 TWlanConnectionSecurityMode& aSecurityMode,
   901                                 TWlanConnectionSecurityMode& aSecurityMode,
   883                                 TWlanConnectionExtentedSecurityMode& aExtSecurityMode, 
   902                                 TWlanConnectionExtentedSecurityMode& aExtSecurityMode, 
   884                                 TBool& aProtectedSetupSupported )
   903                                 TBool& aProtectedSetupSupported )
   885     {
   904     {
       
   905     // Not used
   886     CLOG_ENTERFN( "CConnectionUiUtilitiesImpl::SearchWLANNetworkAsync" );    
   906     CLOG_ENTERFN( "CConnectionUiUtilitiesImpl::SearchWLANNetworkAsync" );    
   887 
   907 
   888     if ( iIsWlanSupported )
   908     if ( iIsWlanSupported )
   889         {
   909         {
   890         if ( !iActiveWrapper[ESearchWlan] )
   910         if ( !iActiveWrapper[ESearchWlan] )
   914 //
   934 //
   915 void CConnectionUiUtilitiesImpl::ConfirmMethodUsageQuery( 
   935 void CConnectionUiUtilitiesImpl::ConfirmMethodUsageQuery( 
   916                                                TMsgQueryLinkedResults& aResult,
   936                                                TMsgQueryLinkedResults& aResult,
   917                                                const TBool aHomeNetwork,
   937                                                const TBool aHomeNetwork,
   918                                                TRequestStatus& aStatus )
   938                                                TRequestStatus& aStatus )
   919     { 
   939     {
   920     iNotif.ConfirmMethodUsageQuery( aResult, aHomeNetwork, aStatus );
   940     TRAP_IGNORE( iCellularConfirmation->StartL( aResult, aHomeNetwork, aStatus ) );
   921     }
   941     }
   922 
   942 
   923 // ---------------------------------------------------------
   943 // ---------------------------------------------------------
   924 // CConnectionUiUtilitiesImpl::CancelConfirmMethodUsageQuery
   944 // CConnectionUiUtilitiesImpl::CancelConfirmMethodUsageQuery
   925 // ---------------------------------------------------------
   945 // ---------------------------------------------------------
   926 //
   946 //
   927 void CConnectionUiUtilitiesImpl::CancelConfirmMethodUsageQuery()
   947 void CConnectionUiUtilitiesImpl::CancelConfirmMethodUsageQuery()
   928     {
   948     {
   929     iNotif.CancelConfirmMethodUsageQuery();
   949     iCellularConfirmation->Cancel();
   930     }
   950     }
   931 
   951 
   932     
   952     
   933 // ---------------------------------------------------------
   953 // ---------------------------------------------------------
   934 // CConnectionUiUtilitiesImpl::WlanPowerSaveTestNote
   954 // CConnectionUiUtilitiesImpl::WlanPowerSaveTestNote
   936 //
   956 //
   937 void CConnectionUiUtilitiesImpl::WlanPowerSaveTestNote( 
   957 void CConnectionUiUtilitiesImpl::WlanPowerSaveTestNote( 
   938                                                     TBool&          aDisable,
   958                                                     TBool&          aDisable,
   939                                                     TRequestStatus& aStatus )
   959                                                     TRequestStatus& aStatus )
   940     {
   960     {
       
   961     // Not used
   941     iNotif.WlanPowerSaveTestNote( aDisable, aStatus );
   962     iNotif.WlanPowerSaveTestNote( aDisable, aStatus );
   942     }
   963     }
   943 
   964 
   944         
   965         
   945 // ---------------------------------------------------------
   966 // ---------------------------------------------------------
   955 // CConnectionUiUtilitiesImpl::EasyWapiDlg
   976 // CConnectionUiUtilitiesImpl::EasyWapiDlg
   956 // ---------------------------------------------------------
   977 // ---------------------------------------------------------
   957 //
   978 //
   958 TBool CConnectionUiUtilitiesImpl::EasyWapiDlg( TDes* aKey )
   979 TBool CConnectionUiUtilitiesImpl::EasyWapiDlg( TDes* aKey )
   959     { 
   980     { 
       
   981     // Not used
   960     TInt status( KErrNone );
   982     TInt status( KErrNone );
   961     
   983     
   962     if ( iIsWlanSupported )    
   984     if ( iIsWlanSupported )    
   963         {
   985         {
   964         iWapiKey().Copy( *aKey );
   986         iWapiKey().Copy( *aKey );