phoneapp/phoneuivoipextension/src/cphoneviewcustomizationvoip.cpp
changeset 72 c76a0b1755b9
parent 0 5f000ab63145
child 76 cfea66083b62
equal deleted inserted replaced
64:6aaf0276100e 72:c76a0b1755b9
    13 *
    13 *
    14 * Description: VoIP-specific view customization implementation.
    14 * Description: VoIP-specific view customization implementation.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <cconvergedserviceselector.h>
       
    19 #include "cphoneviewcustomizationvoip.h"
    18 #include "cphoneviewcustomizationvoip.h"
    20 #include "mphoneviewblockingdialogobserver.h"
    19 #include "mphoneviewblockingdialogobserver.h"
    21 #include "phonestatedefinitionsvoip.h"
    20 #include "phonestatedefinitionsvoip.h"
    22 #include "tphonecmdparamselector.h"
    21 #include "tphonecmdparamselector.h"
    23 #include "tphonecommandparam.h"
    22 #include "tphonecommandparam.h"
    44 // CPhoneViewCustomizationVoip::ConstructL
    43 // CPhoneViewCustomizationVoip::ConstructL
    45 // ---------------------------------------------------------------------------
    44 // ---------------------------------------------------------------------------
    46 //
    45 //
    47 void CPhoneViewCustomizationVoip::ConstructL()
    46 void CPhoneViewCustomizationVoip::ConstructL()
    48     {
    47     {
    49     iServiceSelector = CConvergedServiceSelector::NewL();
       
    50     }
    48     }
    51 
    49 
    52 
    50 
    53 // ---------------------------------------------------------------------------
    51 // ---------------------------------------------------------------------------
    54 // CPhoneViewCustomizationVoip::NewL
    52 // CPhoneViewCustomizationVoip::NewL
    84 // Destructor.
    82 // Destructor.
    85 // ---------------------------------------------------------------------------
    83 // ---------------------------------------------------------------------------
    86 //
    84 //
    87 CPhoneViewCustomizationVoip::~CPhoneViewCustomizationVoip()
    85 CPhoneViewCustomizationVoip::~CPhoneViewCustomizationVoip()
    88     {
    86     {
    89     delete iServiceSelector;
       
    90     }
    87     }
    91 
    88 
    92 
    89 
    93 // ---------------------------------------------------------------------------
    90 // ---------------------------------------------------------------------------
    94 // From class MPhoneViewCustomization.
    91 // From class MPhoneViewCustomization.
   136 //
   133 //
   137 void CPhoneViewCustomizationVoip::RemoveDialog()
   134 void CPhoneViewCustomizationVoip::RemoveDialog()
   138     {
   135     {
   139     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   136     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   140         "CPhoneViewCustomizationVoip::RemoveDialog" );
   137         "CPhoneViewCustomizationVoip::RemoveDialog" );
   141     
       
   142     // Dismiss service selector queries, if necessary
       
   143     iServiceSelector->CancelSelection();
       
   144     }
   138     }
   145 
   139 
   146 
   140 
   147 // ---------------------------------------------------------------------------
   141 // ---------------------------------------------------------------------------
   148 // CPhoneViewCustomizationVoip::SelectVoipService
   142 // CPhoneViewCustomizationVoip::SelectVoipService
   153         TPhoneCommandParam* aCommandParam )
   147         TPhoneCommandParam* aCommandParam )
   154     {
   148     {
   155     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   149     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   156         "CPhoneViewCustomizationVoip::SelectVoipService" );
   150         "CPhoneViewCustomizationVoip::SelectVoipService" );
   157     
   151     
   158     // Indicate that the service selection is blocking key events 
   152     return ETrue;
   159     // from the Phone.
       
   160     aBlockingObserver.SetBlockingDialogIsDisplayed( ETrue );
       
   161     
       
   162     CConvergedServiceSelector::TSsResult results;
       
   163     TInt selectionResult = iServiceSelector->GetCallingServiceByCallType( 
       
   164         results, CConvergedServiceSelector::ESsVoipCall, 0, EFalse );
       
   165     
       
   166     if ( KErrNone == selectionResult )
       
   167         {
       
   168         TPhoneCmdParamSelector* selectorContent =
       
   169             static_cast<TPhoneCmdParamSelector*>( aCommandParam );
       
   170         selectorContent->SetRegStatus( results.iServiceEnabled );
       
   171         selectorContent->SetServiceId( results.iServiceId );
       
   172         }
       
   173     
       
   174     // Reset the flag
       
   175     aBlockingObserver.SetBlockingDialogIsDisplayed( EFalse );
       
   176     
       
   177     return ( KErrNone == selectionResult );
       
   178     }
   153     }