phoneapp/phoneuiview/src/cphoneviewcontroller.cpp
branchRCL_3
changeset 6 38529f706030
parent 5 2a26698d78ba
child 7 544e34b3255a
equal deleted inserted replaced
5:2a26698d78ba 6:38529f706030
   978 
   978 
   979         case EPhoneViewSetTitlePanePicture:
   979         case EPhoneViewSetTitlePanePicture:
   980             iStatusPane->SetTitlePanePictureL( aCommandParam );
   980             iStatusPane->SetTitlePanePictureL( aCommandParam );
   981             break;
   981             break;
   982 
   982 
   983        case EPhoneViewSetSecurityMode:
       
   984             SetSecurityMode( aCommandParam );
       
   985             break;
       
   986 
       
   987        case EPhoneViewGetSecurityModeStatus:
       
   988             GetSecurityModeStatus( aCommandParam );
       
   989             break;
       
   990 
       
   991        case EPhoneViewSetStatusPaneVisible:
   983        case EPhoneViewSetStatusPaneVisible:
   992             SetStatusPaneVisible( aCommandParam );
   984             SetStatusPaneVisible( aCommandParam );
   993             break;
   985             break;
   994 
   986 
   995         case EPhoneViewSetBackgroundImageBitmap:
   987         case EPhoneViewSetBackgroundImageBitmap:
  1086                     }
  1078                     }
  1087                  }
  1079                  }
  1088             break;
  1080             break;
  1089             }
  1081             }
  1090 
  1082 
  1091         case EPhoneViewSetRestrictedDialer:
  1083          case EPhoneViewSetDtmfOptionsFlag:
  1092             {
       
  1093             if ( iDialer )
       
  1094                 {
       
  1095                 TPhoneCmdParamBoolean* booleanParam =
       
  1096                     static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
       
  1097                 iDialerController->SetRestrictedDialer(
       
  1098                                                 booleanParam->Boolean() );
       
  1099                 }
       
  1100             break;
       
  1101             }
       
  1102         case EPhoneViewSetDtmfOptionsFlag:
       
  1103             {
  1084             {
  1104             TPhoneCmdParamBoolean*  booleanParam =
  1085             TPhoneCmdParamBoolean*  booleanParam =
  1105                 static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
  1086                 static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
  1106             iMenuController->SetAllowDtmfOptionsFlag(
  1087             iMenuController->SetAllowDtmfOptionsFlag(
  1107                                                 booleanParam->Boolean() );
  1088                                                 booleanParam->Boolean() );
  1509             TPhoneCmdParamInteger*  integerParam =
  1490             TPhoneCmdParamInteger*  integerParam =
  1510                 static_cast<TPhoneCmdParamInteger*>( aCommandParam );
  1491                 static_cast<TPhoneCmdParamInteger*>( aCommandParam );
  1511             iToolbarController->SetToolbarButtonDimmed( integerParam->Integer(), EFalse );
  1492             iToolbarController->SetToolbarButtonDimmed( integerParam->Integer(), EFalse );
  1512             }
  1493             }
  1513             break;
  1494             break;
       
  1495             
       
  1496         case EPhoneViewGetQwertyModeObserver:
       
  1497             {
       
  1498             TPhoneCmdParamPointer* ptrParam = static_cast<TPhoneCmdParamPointer*>( aCommandParam );
       
  1499             ptrParam->SetPointer( static_cast<TAny*>( iDialer ) );
       
  1500             }
       
  1501             break;
  1514 
  1502 
  1515         default:
  1503         default:
  1516             __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneViewController::ExecuteCommand -> UnHandledMessage !!! " );
  1504             __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneViewController::ExecuteCommand -> UnHandledMessage !!! " );
  1517             break;
  1505             break;
  1518         }
  1506         }
  1686                      // Create and launch dialer.
  1674                      // Create and launch dialer.
  1687                     ExecuteCommandL( EPhoneViewCreateNumberEntry, &booleanParam );
  1675                     ExecuteCommandL( EPhoneViewCreateNumberEntry, &booleanParam );
  1688                     }
  1676                     }
  1689                 // Set Number Entry CBA
  1677                 // Set Number Entry CBA
  1690                 TPhoneCmdParamInteger integerParam;
  1678                 TPhoneCmdParamInteger integerParam;
  1691                 integerParam.SetInteger( CPhoneMainResourceResolver::Instance()->
  1679                 if ( iSecurityMode )
  1692                     ResolveResourceID( EPhoneNumberAcqCBA ) );
  1680                 	{
       
  1681                     iNoteController->DestroyNote();
       
  1682                     integerParam.SetInteger(
       
  1683                     CPhoneMainResourceResolver::Instance()->
       
  1684                               		ResolveResourceID( EPhoneEmergencyModeNoteCBA ) );
       
  1685                               	}
       
  1686                               else
       
  1687                               	{
       
  1688                               	integerParam.SetInteger(
       
  1689                               		CPhoneMainResourceResolver::Instance()->
       
  1690                               		ResolveResourceID( EPhoneNumberAcqCBA ) );
       
  1691                               	}
  1693                 ExecuteCommandL( EPhoneViewUpdateCba, &integerParam );
  1692                 ExecuteCommandL( EPhoneViewUpdateCba, &integerParam );
  1694                 // Set flag to false because dialler is set to open status.
  1693                 // Set flag to false because dialler is set to open status.
  1695                 iPhoneView->SetPhoneAppViewToDialer( EFalse );
  1694                 iPhoneView->SetPhoneAppViewToDialer( EFalse );
  1696               }
  1695               }
  1697           break;
  1696           break;
  1894                 {
  1893                 {
  1895                 viewResponse = EPhoneViewResponseFailed;
  1894                 viewResponse = EPhoneViewResponseFailed;
  1896                 }
  1895                 }
  1897             else
  1896             else
  1898                 {
  1897                 {
  1899                 TBool status;
  1898                 TBool status( EFalse );
  1900                 TRAP( err, status = GetNumberFromSpeedDialLocationL( aCommandParam ))
  1899                 TRAP( err, status = GetNumberFromSpeedDialLocationL( aCommandParam ))
  1901                 if ( err )
  1900                 if ( err )
  1902                     {
  1901                     {
  1903                     viewResponse = EPhoneViewResponseFailed;
  1902                     viewResponse = EPhoneViewResponseFailed;
  1904                     // Set and reset in GetNumberFromSpeedDialLocationL when not leave
  1903                     // Set and reset in GetNumberFromSpeedDialLocationL when not leave
  2149     {
  2148     {
  2150     return  CPhoneStatusPane::Instance()->IsVisible();
  2149     return  CPhoneStatusPane::Instance()->IsVisible();
  2151     }
  2150     }
  2152 
  2151 
  2153 // ---------------------------------------------------------------------------
  2152 // ---------------------------------------------------------------------------
       
  2153 // CPhoneViewController::HandleSecurityModeChanged
       
  2154 // ---------------------------------------------------------------------------
       
  2155 //
       
  2156 EXPORT_C void CPhoneViewController::HandleSecurityModeChanged( TBool aIsEnabled )
       
  2157 	{
       
  2158 	 __PHONELOG1( EBasic, EPhoneUIView,
       
  2159             "CPhoneViewController::SetSecurityMode Mode = (%d)", aIsEnabled );
       
  2160     iToolbarController->DimToolbar( aIsEnabled );			
       
  2161 	iPhoneView->SetSecurityMode( aIsEnabled );
       
  2162 	iMenuController->SetSecurityMode( aIsEnabled );
       
  2163 	if ( iDialer )
       
  2164 		{
       
  2165 		iDialerController->SetRestrictedDialer( aIsEnabled );
       
  2166 		if ( iSecurityMode != aIsEnabled )
       
  2167 			{
       
  2168 			iDialer->RelayoutAndDraw();
       
  2169 			}
       
  2170 		}
       
  2171 	iSecurityMode = aIsEnabled;
       
  2172 	}
       
  2173 
       
  2174 // ---------------------------------------------------------------------------
  2154 // CPhoneViewController::IdleAppUid
  2175 // CPhoneViewController::IdleAppUid
  2155 // ---------------------------------------------------------------------------
  2176 // ---------------------------------------------------------------------------
  2156 //
  2177 //
  2157 TInt CPhoneViewController::IdleAppUid()
  2178 TInt CPhoneViewController::IdleAppUid()
  2158     {
  2179     {
  2206             static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
  2227             static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
  2207         booleanValue->SetBoolean( iBlockingDialogIsDisplayed );
  2228         booleanValue->SetBoolean( iBlockingDialogIsDisplayed );
  2208         }
  2229         }
  2209     }
  2230     }
  2210 
  2231 
  2211 // ---------------------------------------------------------------------------
  2232 
  2212 // CPhoneViewController::GetSecurityModeStatus
       
  2213 // ---------------------------------------------------------------------------
       
  2214 //
       
  2215 void CPhoneViewController::GetSecurityModeStatus(
       
  2216     TPhoneCommandParam* aCommandParam )
       
  2217     {
       
  2218     if( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
       
  2219         {
       
  2220         TPhoneCmdParamBoolean* booleanValue =
       
  2221             static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
       
  2222         booleanValue->SetBoolean( iPhoneView->IsSecurityMode() );
       
  2223         }
       
  2224     }
       
  2225 
  2233 
  2226 // ---------------------------------------------------------------------------
  2234 // ---------------------------------------------------------------------------
  2227 // CPhoneViewController::SendToBackgroundL
  2235 // CPhoneViewController::SendToBackgroundL
  2228 // ---------------------------------------------------------------------------
  2236 // ---------------------------------------------------------------------------
  2229 //
  2237 //
  3457 
  3465 
  3458     CleanupStack::PopAndDestroy( messageData );
  3466     CleanupStack::PopAndDestroy( messageData );
  3459     CleanupStack::PopAndDestroy( phoneNumber );
  3467     CleanupStack::PopAndDestroy( phoneNumber );
  3460     }
  3468     }
  3461 
  3469 
  3462 // ---------------------------------------------------------------------------
       
  3463 // CPhoneViewController::SetSecurityMode
       
  3464 // ---------------------------------------------------------------------------
       
  3465 //
       
  3466 void CPhoneViewController::SetSecurityMode(
       
  3467                                         TPhoneCommandParam* aCommandParam )
       
  3468     {
       
  3469     __LOGMETHODSTARTEND(EPhoneUIView,
       
  3470         "CPhoneViewController::SetSecurityMode()" );
       
  3471     TPhoneCmdParamBoolean* booleanParam = static_cast<TPhoneCmdParamBoolean*>(
       
  3472         aCommandParam );
       
  3473     iPhoneView->SetSecurityMode( booleanParam->Boolean() );
       
  3474     iStatusPane->StatusPane().MakeVisible( !booleanParam->Boolean() );
       
  3475     }
       
  3476 
       
  3477 // -----------------------------------------------------------
  3470 // -----------------------------------------------------------
  3478 // CPhoneViewController::SetStatusPaneVisible
  3471 // CPhoneViewController::SetStatusPaneVisible
  3479 // -----------------------------------------------------------
  3472 // -----------------------------------------------------------
  3480 //
  3473 //
  3481 void CPhoneViewController::SetStatusPaneVisible(
  3474 void CPhoneViewController::SetStatusPaneVisible(
  3686 void CPhoneViewController::SwapEmptyIndicatorPaneInSecureStateL(
  3679 void CPhoneViewController::SwapEmptyIndicatorPaneInSecureStateL(
  3687                                     const TBool aSwapEmpty )
  3680                                     const TBool aSwapEmpty )
  3688     {
  3681     {
  3689     __LOGMETHODSTARTEND(EPhoneUIView,
  3682     __LOGMETHODSTARTEND(EPhoneUIView,
  3690         "CPhoneViewController::SwapEmptyIndicatorPaneInSecureStateL()" );
  3683         "CPhoneViewController::SwapEmptyIndicatorPaneInSecureStateL()" );
  3691 
  3684     if ( iSecurityMode )
  3692     TPhoneCmdParamBoolean security;
       
  3693     GetSecurityModeStatus( &security );
       
  3694 
       
  3695     if ( security.Boolean() )
       
  3696         {
  3685         {
  3697         if ( aSwapEmpty )
  3686         if ( aSwapEmpty )
  3698             {
  3687             {
  3699             if ( !iIndiContainer )
  3688             if ( !iIndiContainer )
  3700                 {
  3689                 {
  3798         iAppui->RemoveFromStack( iPhoneView );
  3787         iAppui->RemoveFromStack( iPhoneView );
  3799 
  3788 
  3800         // Don't make dialer view visible before status pane is updated.
  3789         // Don't make dialer view visible before status pane is updated.
  3801         // This prevents unnecessary resizings.
  3790         // This prevents unnecessary resizings.
  3802         iDialerView->MakeVisible( ETrue );
  3791         iDialerView->MakeVisible( ETrue );
  3803         iDialerView->DrawDeferred();
  3792         // Number entry is emptied when dialer is hidden but drawing doesn't
       
  3793         // succeed at that point as dialer is hidden first. So must draw
       
  3794         // dialer as soon as it becomes visible to prevent the flashing of
       
  3795         // number entry (DrawDeferred() isn't fast enough here).
       
  3796         iDialerView->DrawNow();
  3804         }
  3797         }
  3805     }
  3798     }
  3806 
  3799 
  3807 // ---------------------------------------------------------------------------
  3800 // ---------------------------------------------------------------------------
  3808 // CPhoneViewController::SetControltoCallHandlingL
  3801 // CPhoneViewController::SetControltoCallHandlingL
  3811 void CPhoneViewController::SetControltoCallHandlingL()
  3804 void CPhoneViewController::SetControltoCallHandlingL()
  3812     {
  3805     {
  3813     __PHONELOG1( EBasic, EPhoneUIView,
  3806     __PHONELOG1( EBasic, EPhoneUIView,
  3814         "CPhoneViewController::SetControltoCallHandlingL iDialerActive (%d)", iDialerActive );
  3807         "CPhoneViewController::SetControltoCallHandlingL iDialerActive (%d)", iDialerActive );
  3815 
  3808 
  3816     // Do not show toolbar if securitymode or emergency call active
  3809     // Do not show toolbar if emergency call is active
  3817     if ( !iPhoneView->IsSecurityMode() && 
  3810     if ( !iIncallIndicator->IsEmergencyCall() )
  3818          !iIncallIndicator->IsEmergencyCall() )
       
  3819         {
  3811         {
  3820         iToolbarController->ShowToolbar();
  3812         iToolbarController->ShowToolbar();
  3821         }
  3813         }
  3822     if ( iDialerActive )
  3814     if ( iDialerActive )
  3823         {
  3815         {