phoneapp/phoneuivoipextension/src/cphonevoiperrormessageshandler.cpp
branchRCL_3
changeset 25 5266b1f337bd
parent 24 41a7f70b3818
equal deleted inserted replaced
24:41a7f70b3818 25:5266b1f337bd
    18 // INCLUDES
    18 // INCLUDES
    19 
    19 
    20 #include <ccpdefs.h>
    20 #include <ccpdefs.h>
    21 #include <mpeengineinfo.h>
    21 #include <mpeengineinfo.h>
    22 #include <StringLoader.h>
    22 #include <StringLoader.h>
       
    23 
       
    24 #include <ccherror.h>
       
    25 
    23 #include <spsettings.h>
    26 #include <spsettings.h>
    24 #include <spentry.h>
    27 #include <spentry.h>
       
    28 
    25 #include <telephonydomainpskeys.h>
    29 #include <telephonydomainpskeys.h>
    26 #include <UikonInternalPSKeys.h>
    30 #include <UikonInternalPSKeys.h>
    27 #include <aknnotedialog.h>
    31 #include <aknnotedialog.h>
       
    32 
    28 #include "cphonevoiperrormessageshandler.h"
    33 #include "cphonevoiperrormessageshandler.h"
    29 #include "cphonemainerrormessageshandler.h"
    34 #include "cphonemainerrormessageshandler.h"
    30 #include "cphoneerrormessageshandler.h"
    35 #include "cphoneerrormessageshandler.h"
    31 #include "cphonestatehandle.h"
    36 #include "cphonestatehandle.h"
    32 #include "phonerssvoip.h"
    37 #include "phonerssvoip.h"
   292                 CCoeEnv::Static() ); // Load new buffer
   297                 CCoeEnv::Static() ); // Load new buffer
   293 
   298 
   294         }
   299         }
   295      
   300      
   296     globalNoteParam.SetText( *text );
   301     globalNoteParam.SetText( *text );
   297     globalNoteParam.SetType( EPhoneMessageBoxInformation );
   302     globalNoteParam.SetType( EAknGlobalConfirmationNote );
   298 
   303     globalNoteParam.SetTone( EAvkonSIDInformationTone );
   299             
   304             
   300     iViewCommandHandle->ExecuteCommandL( 
   305     iViewCommandHandle->ExecuteCommandL( 
   301             EPhoneViewShowGlobalNote, &globalNoteParam );
   306             EPhoneViewShowGlobalNote, &globalNoteParam );
   302     
   307     
   303     CleanupStack::PopAndDestroy( text );
   308     CleanupStack::PopAndDestroy( text );
   368 // -----------------------------------------------------------
   373 // -----------------------------------------------------------
   369 // CPhoneVoIPErrorMessagesHandler::ShowRegistrationErrorNotesL
   374 // CPhoneVoIPErrorMessagesHandler::ShowRegistrationErrorNotesL
   370 // -----------------------------------------------------------
   375 // -----------------------------------------------------------
   371 //
   376 //
   372 void CPhoneVoIPErrorMessagesHandler::ShowRegistrationErrorNotesL( 
   377 void CPhoneVoIPErrorMessagesHandler::ShowRegistrationErrorNotesL( 
   373     TInt /*aErrorCode*/ )
   378     TInt aErrorCode )
   374     {
   379     {
   375     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   380     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   376               "CPhoneVoIPErrorMessagesHandler::ShowRegistrationErrorNotesL()" );
   381               "CPhoneVoIPErrorMessagesHandler::ShowRegistrationErrorNotesL()" );
   377     // Dismiss service enabling wait note
   382     // Dismiss service enabling wait note
   378     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalWaitNote );    
   383     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalWaitNote );
       
   384     
       
   385     switch ( aErrorCode )
       
   386         {
       
   387         case KCCHErrorAccessPointNotDefined:
       
   388             {
       
   389             TUint32 serviceId = 
       
   390                 iStateMachine->PhoneEngineInfo()->ServiceIdCommand();
       
   391             ShowErrorNoteWithServiceNameL( EPhoneVoIPNoConnectionsDefined,
       
   392                 serviceId );
       
   393             break;
       
   394             }
       
   395         case KCCHErrorBandwidthInsufficient:   
       
   396             {
       
   397             TUint32 serviceId = 
       
   398                 iStateMachine->PhoneEngineInfo()->ServiceIdCommand();
       
   399             ShowErrorNoteWithServiceNameL( EPhoneVoIPCallsNotSupported,
       
   400                 serviceId );
       
   401             break;
       
   402             }
       
   403         case KCCHErrorInvalidSettings:
       
   404             {
       
   405             TUint32 serviceId = 
       
   406                 iStateMachine->PhoneEngineInfo()->ServiceIdCommand();
       
   407             ShowErrorNoteWithServiceNameL( EPhoneVoIPDefectiveSettings,
       
   408                 serviceId );
       
   409             break;
       
   410             }
       
   411         case KCCHErrorAuthenticationFailed:
       
   412             {
       
   413             SendGlobalErrorNoteL( EPhoneVoIPAuthenticationFailed );
       
   414             break;
       
   415             }
       
   416         case KCCHErrorInvalidIap:
       
   417         case KCCHErrorNetworkLost:
       
   418         case KCCHErrorServiceNotResponding:
       
   419             {
       
   420             TUint32 serviceId = 
       
   421                 iStateMachine->PhoneEngineInfo()->ServiceIdCommand();
       
   422             ShowErrorNoteWithServiceNameL( EPhoneVoIPNoConnectionsAvailable,
       
   423                 serviceId );
       
   424             break;
       
   425             }
       
   426         case KCCHErrorLoginFailed: 
       
   427         default:
       
   428             {
       
   429             TUint32 serviceId = 
       
   430                iStateMachine->PhoneEngineInfo()->ServiceIdCommand();
       
   431             ShowErrorNoteWithServiceNameL( EPhoneVoIPServiceUnavailable,
       
   432                serviceId );
       
   433             break;
       
   434             }
       
   435         }
   379     }
   436     }
   380 
   437 
   381 // ---------------------------------------------------------
   438 // ---------------------------------------------------------
   382 //  CPhoneVoIPErrorMessagesHandler::SendGlobalErrorNoteWithTextL
   439 //  CPhoneVoIPErrorMessagesHandler::SendGlobalErrorNoteWithTextL
   383 // ---------------------------------------------------------
   440 // ---------------------------------------------------------
   399         iViewCommandHandle->ExecuteCommandL( 
   456         iViewCommandHandle->ExecuteCommandL( 
   400              EPhoneViewSetGlobalNotifiersDisabled,
   457              EPhoneViewSetGlobalNotifiersDisabled,
   401             &globalNotifierParam );
   458             &globalNotifierParam );
   402             
   459             
   403         TPhoneCmdParamGlobalNote globalNoteParam;
   460         TPhoneCmdParamGlobalNote globalNoteParam;
   404         globalNoteParam.SetType( EPhoneMessageBoxInformation );
   461         globalNoteParam.SetType( EAknGlobalErrorNote );
   405         globalNoteParam.SetTextResourceId( 
   462         globalNoteParam.SetTextResourceId( 
   406             CPhoneMainResourceResolver::Instance()->
   463             CPhoneMainResourceResolver::Instance()->
   407             ResolveResourceID( aResourceId ) );
   464             ResolveResourceID( aResourceId ) );
   408         globalNoteParam.SetText( aText );
   465         globalNoteParam.SetText( aText );
       
   466         globalNoteParam.SetTone( CAknNoteDialog::EErrorTone );
   409 
   467 
   410         iViewCommandHandle->ExecuteCommandL(  
   468         iViewCommandHandle->ExecuteCommandL(  
   411             EPhoneViewShowGlobalNote, &globalNoteParam );
   469             EPhoneViewShowGlobalNote, &globalNoteParam );
   412         } 
   470         } 
   413     }
   471     }