phoneapp/phoneuicontrol/src/cphonestate.cpp
changeset 50 377c906a8701
parent 46 bc5a64e5bc3c
child 53 22cc52eade9b
equal deleted inserted replaced
46:bc5a64e5bc3c 50:377c906a8701
   215             //SendGlobalInfoNoteL( EPhoneWaitingText, ETrue );
   215             //SendGlobalInfoNoteL( EPhoneWaitingText, ETrue );
   216             break;
   216             break;
   217 
   217 
   218         case MEngineMonitor::EPEMessageProfileChanged:
   218         case MEngineMonitor::EPEMessageProfileChanged:
   219             {
   219             {
   220             TPhoneCmdParamBoolean keypadVolumeParam;
       
   221             if ( iStateMachine->PhoneEngineInfo()->KeypadVolume() == 0 )
       
   222                 {
       
   223                 iViewCommandHandle->ExecuteCommandL( EPhoneViewKeypadAudioDisabled );
       
   224                 }
       
   225             else
       
   226                 {
       
   227                 iViewCommandHandle->ExecuteCommandL( EPhoneViewKeypadAudioEnabled );
       
   228                 }
       
   229             UpdateProfileDisplayL();
       
   230             }
   220             }
   231             break;
   221             break;
   232 
   222 
   233         case MEngineMonitor::EPEMessageRemoteTerminated:
   223         case MEngineMonitor::EPEMessageRemoteTerminated:
   234             // Close menu bar, if it is displayed, for call ending note
       
   235             iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   236             /* Flow through */
   224             /* Flow through */
   237         case MEngineMonitor::EPEMessageDisconnecting:
   225         case MEngineMonitor::EPEMessageDisconnecting:
   238             HandleDisconnectingL( aCallId );
   226             HandleDisconnectingL( aCallId );
   239             break;
   227             break;
   240 
   228 
   605 // -----------------------------------------------------------------------------
   593 // -----------------------------------------------------------------------------
   606 //
   594 //
   607 TBool CPhoneState::IsTouchDTmfDialerOn() const
   595 TBool CPhoneState::IsTouchDTmfDialerOn() const
   608     {
   596     {
   609     TBool status( EFalse );
   597     TBool status( EFalse );
   610     if ( IsOnScreenDialerSupported() )
       
   611         {
       
   612         TBool isDialerVisible( EFalse );
       
   613         TRAP_IGNORE( isDialerVisible = IsDTMFEditorVisibleL() );
       
   614 
       
   615         if ( isDialerVisible )
       
   616             {
       
   617             status = ETrue;
       
   618             }
       
   619         }
       
   620     return status;
   598     return status;
   621     }
   599     }
   622 // -----------------------------------------------------------------------------
   600 // -----------------------------------------------------------------------------
   623 // CPhoneState::SendDtmfKeyEventL
   601 // CPhoneState::SendDtmfKeyEventL
   624 // send dtmf event when,
   602 // send dtmf event when,
   630 void CPhoneState::SendDtmfKeyEventL( const TKeyEvent& aKeyEvent,
   608 void CPhoneState::SendDtmfKeyEventL( const TKeyEvent& aKeyEvent,
   631                TEventCode aEventCode  )
   609                TEventCode aEventCode  )
   632     {
   610     {
   633 
   611 
   634     if ( !IsTouchDTmfDialerOn()
   612     if ( !IsTouchDTmfDialerOn()
   635         && !IsAnyQueryActiveL()
   613         && !IsAnyQueryActiveL() )
   636         && !IsMenuBarVisibleL() )
       
   637         {
   614         {
   638         // Send the key event to the phone engine.
   615         // Send the key event to the phone engine.
   639         SendKeyEventL( aKeyEvent, aEventCode );
   616         SendKeyEventL( aKeyEvent, aEventCode );
   640         }
   617         }
   641     }
   618     }
   642 
   619 
   643 // -----------------------------------------------------------------------------
   620 // -----------------------------------------------------------------------------
   644 // CPhoneState::IsKeyEventFurtherProcessed
   621 // CPhoneState::IsKeyEventFurtherProcessed
   645 // -----------------------------------------------------------------------------
   622 // -----------------------------------------------------------------------------
   646 //
   623 //
   647 TBool CPhoneState::IsKeyEventFurtherProcessedL( const TKeyEvent& aKeyEvent ) const
   624 TBool CPhoneState::IsKeyEventFurtherProcessedL( const TKeyEvent& /*aKeyEvent*/ ) const
   648     {
   625     {
   649     // While being in some special keyboard mode (Full Screen&mini QWERTY,
       
   650     // handwriting mode) FEP sends only EEventKey -event and thus manual
       
   651     // DTMFs can not be played with the user specified tone lengths. Also,
       
   652     // in general, DTMFs are tried to play only in numeric mode.
       
   653     TBool numericMode = iViewCommandHandle->HandleCommandL(
       
   654       EPhoneViewIsNumberEntryNumericMode ) == EPhoneViewResponseSuccess;
       
   655 
       
   656     if ( ( aKeyEvent.iModifiers & EModifierSpecial ) != 0 || !numericMode )
       
   657         {
       
   658         return EFalse;
       
   659         }
       
   660 
       
   661     return ETrue;
   626     return ETrue;
   662     }
   627     }
   663 
   628 
   664 // -----------------------------------------------------------
   629 // -----------------------------------------------------------
   665 // CPhoneState::HandleErrorL
   630 // CPhoneState::HandleErrorL
   677 
   642 
   678     __PHONELOG1( EBasic, EPhoneControl,
   643     __PHONELOG1( EBasic, EPhoneControl,
   679         "PhoneUIControl: CPhoneState::HandleErrorL - aErrorInfo.iCallId =%d ",
   644         "PhoneUIControl: CPhoneState::HandleErrorL - aErrorInfo.iCallId =%d ",
   680         aErrorInfo.iCallId );
   645         aErrorInfo.iCallId );
   681 
   646 
   682 
       
   683     // Sets touch buttons to correct status if error has occured.
       
   684     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
       
   685         {
       
   686         iViewCommandHandle->ExecuteCommand( EPhoneResetTouchButtons );
       
   687         }
       
   688 
   647 
   689     // Do the common error handling (display proper notes etc)
   648     // Do the common error handling (display proper notes etc)
   690     CPhoneMainErrorMessagesHandler::Instance()->ShowErrorSpecificNoteL( aErrorInfo );
   649     CPhoneMainErrorMessagesHandler::Instance()->ShowErrorSpecificNoteL( aErrorInfo );
   691 
   650 
   692     switch( aErrorInfo.iErrorCode )
   651     switch( aErrorInfo.iErrorCode )
   863 // -----------------------------------------------------------
   822 // -----------------------------------------------------------
   864 //
   823 //
   865 EXPORT_C void CPhoneState::HandleDisconnectingL( TInt aCallId )
   824 EXPORT_C void CPhoneState::HandleDisconnectingL( TInt aCallId )
   866     {
   825     {
   867     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleDisconnectingL( ) ");
   826     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleDisconnectingL( ) ");
   868     // If there is no call in connected state then EPhoneDtmfTextQuery and EPhoneDtmfListQueryDialog
       
   869     // must be dismmissed from UI, therefore we must set EPhoneViewSetNoConnectedCalls to ETrue this
       
   870     // way we can ensure that CPhoneQueryController doesnt relaunch EPhoneDtmfListQueryDialog.
       
   871     if ( !IsAnyConnectedCalls() )
       
   872         {
       
   873         TPhoneCmdParamBoolean booleanParam;
       
   874         booleanParam.SetBoolean(ETrue);
       
   875         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNoConnectedCalls, &booleanParam );
       
   876         }
       
   877 
   827 
   878     TPhoneCmdParamCallHeaderData callHeaderParam;
   828     TPhoneCmdParamCallHeaderData callHeaderParam;
   879     callHeaderParam.SetCallState( EPEStateDisconnecting );
   829     callHeaderParam.SetCallState( EPEStateDisconnecting );
   880 
   830 
   881     TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
   831     TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
   989             }
   939             }
   990         }
   940         }
   991     }
   941     }
   992 
   942 
   993 // -----------------------------------------------------------
   943 // -----------------------------------------------------------
   994 // CPhoneState::IsNoteVisibleL
       
   995 // -----------------------------------------------------------
       
   996 //
       
   997 EXPORT_C TBool CPhoneState::IsNoteVisibleL()
       
   998     {
       
   999     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNoteVisibleL( ) ");
       
  1000     TPhoneCmdParamBoolean booleanParam;
       
  1001     iViewCommandHandle->ExecuteCommandL(
       
  1002         EPhoneViewGetIsNoteVisible, &booleanParam );
       
  1003     return booleanParam.Boolean();
       
  1004     }
       
  1005 
       
  1006 // -----------------------------------------------------------
       
  1007 // CPhoneState::IsMenuBarVisibleL
       
  1008 // -----------------------------------------------------------
       
  1009 //
       
  1010 EXPORT_C TBool CPhoneState::IsMenuBarVisibleL() const
       
  1011     {
       
  1012     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsMenuBarVisibleL( ) ");
       
  1013     return iViewCommandHandle->HandleCommandL(
       
  1014         EPhoneViewIsMenuBarVisible ) ==
       
  1015         EPhoneViewResponseSuccess;
       
  1016     }
       
  1017 
       
  1018 // -----------------------------------------------------------
       
  1019 // CPhoneState::HandleNumericKeyEventL
   944 // CPhoneState::HandleNumericKeyEventL
  1020 // -----------------------------------------------------------
   945 // -----------------------------------------------------------
  1021 //
   946 //
  1022 EXPORT_C void CPhoneState::HandleNumericKeyEventL(
   947 EXPORT_C void CPhoneState::HandleNumericKeyEventL(
  1023     const TKeyEvent& aKeyEvent,
   948     const TKeyEvent& /*aKeyEvent*/,
  1024     TEventCode aEventCode )
   949     TEventCode /*aEventCode*/ )
  1025     {
   950     {
  1026     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleNumericKeyEventL( ) ");
   951     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleNumericKeyEventL( ) ");
  1027 
       
  1028     TBool numberEntryUsed = IsNumberEntryUsedL();
       
  1029 
       
  1030     if ( numberEntryUsed && ( aKeyEvent.iRepeats == 0 ||
       
  1031               aKeyEvent.iScanCode == EStdKeyBackspace ||
       
  1032               aKeyEvent.iScanCode ==EStdKeyLeftArrow  ||
       
  1033               aKeyEvent.iScanCode ==EStdKeyRightArrow ))
       
  1034         {
       
  1035         // Number entry exists but may be hidden
       
  1036         KeyEventForExistingNumberEntryL( aKeyEvent, aEventCode );
       
  1037         }
       
  1038 
   952 
  1039     }
   953     }
  1040 
   954 
  1041 // -----------------------------------------------------------------------------
   955 // -----------------------------------------------------------------------------
  1042 // CPhoneState::IsAnyQueryActiveL
   956 // CPhoneState::IsAnyQueryActiveL
  1174         }
  1088         }
  1175     }
  1089     }
  1176 
  1090 
  1177 // <------------------------------ SYSTEM EVENTS ----------------------------->
  1091 // <------------------------------ SYSTEM EVENTS ----------------------------->
  1178 
  1092 
  1179 // -----------------------------------------------------------
       
  1180 // CPhoneState::DynInitMenuPaneL
       
  1181 // -----------------------------------------------------------
       
  1182 //
       
  1183 EXPORT_C void CPhoneState::DynInitMenuPaneL(
       
  1184     TInt aResourceId,
       
  1185     CEikMenuPane* aMenuPane )
       
  1186     {
       
  1187     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DynInitMenuPaneL( ) ");
       
  1188     __ASSERT_DEBUG( aMenuPane && aResourceId,
       
  1189         Panic( EPhoneCtrlParameterNotInitialized ) );
       
  1190 
       
  1191     // Save the number of digits in the number entry before processing
       
  1192     // the menu pane
       
  1193     if ( IsNumberEntryUsedL() )
       
  1194         {
       
  1195         TPhoneCmdParamBoolean serviceCodeParam;
       
  1196             serviceCodeParam.SetBoolean(
       
  1197             iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() );
       
  1198         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetServiceCodeFlag,
       
  1199             &serviceCodeParam );
       
  1200         }
       
  1201 
       
  1202     // Process the menu pane
       
  1203     TPhoneCmdParamDynMenu dynMenuPane;
       
  1204     dynMenuPane.SetResourceId( aResourceId );
       
  1205     dynMenuPane.SetDynMenu( aMenuPane );
       
  1206     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuPane, &dynMenuPane );
       
  1207 
       
  1208     if ( iCustomization )
       
  1209         {
       
  1210         // Menu pane is customized after default items are decided
       
  1211         iCustomization->CustomizeMenuPaneL(aResourceId, aMenuPane);
       
  1212         }
       
  1213     }
       
  1214 
       
  1215 // -----------------------------------------------------------
       
  1216 // CPhoneState::DynInitMenuBarL
       
  1217 // -----------------------------------------------------------
       
  1218 //
       
  1219 EXPORT_C void CPhoneState::DynInitMenuBarL(
       
  1220     TInt aResourceId,
       
  1221     CEikMenuBar* aMenuBar )
       
  1222     {
       
  1223     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DynInitMenuBarL( ) ");
       
  1224     __ASSERT_DEBUG( aMenuBar && aResourceId,
       
  1225         Panic( EPhoneCtrlParameterNotInitialized ) );
       
  1226 
       
  1227     TPhoneCmdParamDynMenu dynMenuBar;
       
  1228     dynMenuBar.SetResourceId( aResourceId );
       
  1229     dynMenuBar.SetDynMenu( aMenuBar );
       
  1230     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBar, &dynMenuBar );
       
  1231 
       
  1232     if ( iCustomization )
       
  1233         {
       
  1234         // Menu bar is customized after default items are decided
       
  1235         iCustomization->CustomizeMenuBarL(aResourceId, aMenuBar);
       
  1236         }
       
  1237 
       
  1238     }
       
  1239 
  1093 
  1240 // -----------------------------------------------------------
  1094 // -----------------------------------------------------------
  1241 // CPhoneState::HandleSystemEventL
  1095 // CPhoneState::HandleSystemEventL
  1242 // -----------------------------------------------------------
  1096 // -----------------------------------------------------------
  1243 //
  1097 //
  1277     {
  1131     {
  1278     // Notify that this method is called always when Idle is brought to foreground
  1132     // Notify that this method is called always when Idle is brought to foreground
  1279     // See implementation in CPhoneAppUI::HandleWsEventL
  1133     // See implementation in CPhoneAppUI::HandleWsEventL
  1280 
  1134 
  1281     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneFocusLostEventL( ) ");
  1135     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneFocusLostEventL( ) ");
  1282     // Phone app focus lost -> close Dtmf dialer when visible
       
  1283     if ( IsOnScreenDialerSupported() && IsDTMFEditorVisibleL() )
       
  1284         {
       
  1285         CloseDTMFEditorL();
       
  1286         }
       
  1287     else if ( IsOnScreenDialerSupported() && IsCustomizedDialerVisibleL() )
       
  1288         {
       
  1289         CloseCustomizedDialerL();
       
  1290         }
       
  1291     }
  1136     }
  1292 // ---------------------------------------------------------
  1137 // ---------------------------------------------------------
  1293 // CPhoneState::HandleIdleForegroundEventL
  1138 // CPhoneState::HandleIdleForegroundEventL
  1294 // ---------------------------------------------------------
  1139 // ---------------------------------------------------------
  1295 //
  1140 //
  1341             "CPhoneState::HandlePropertyChangedL - aCategory= %d", aCategory  );
  1186             "CPhoneState::HandlePropertyChangedL - aCategory= %d", aCategory  );
  1342     __PHONELOG1( EBasic, EPhoneControl,
  1187     __PHONELOG1( EBasic, EPhoneControl,
  1343             "CPhoneState::HandlePropertyChangedL - aKey= %d", aKey  );
  1188             "CPhoneState::HandlePropertyChangedL - aKey= %d", aKey  );
  1344     __PHONELOG1( EBasic, EPhoneControl,
  1189     __PHONELOG1( EBasic, EPhoneControl,
  1345             "CPhoneState::HandlePropertyChangedL - aValue= %d", aValue  );
  1190             "CPhoneState::HandlePropertyChangedL - aValue= %d", aValue  );
  1346     if ( aCategory == KPSUidCtsyCallInformation )
  1191     if ( aCategory == KPSUidTelInformation
  1347         {
       
  1348         // Call state event
       
  1349         if ( aKey == KCTsyCallState )
       
  1350             {
       
  1351             // Update the incall indicator
       
  1352             UpdateIncallIndicatorL( aValue );
       
  1353             }
       
  1354         }
       
  1355 
       
  1356     // Telephony information category
       
  1357     else if ( aCategory == KPSUidTelInformation
       
  1358               && SimState() == EPESimUsable )
  1192               && SimState() == EPESimUsable )
  1359         {
  1193         {
  1360         // Telephony display event
  1194         // Telephony display event
  1361         if ( aKey == KTelDisplayInfo )
  1195         if ( aKey == KTelDisplayInfo )
  1362             {
  1196             {
  1412     return iViewCommandHandle->HandleCommandL(
  1246     return iViewCommandHandle->HandleCommandL(
  1413         EPhoneViewGetTopApplicationIsDisplayedStatus ) ==
  1247         EPhoneViewGetTopApplicationIsDisplayedStatus ) ==
  1414         EPhoneViewResponseSuccess;
  1248         EPhoneViewResponseSuccess;
  1415     }
  1249     }
  1416 
  1250 
  1417 // -----------------------------------------------------------
       
  1418 // CPhoneState::TitlePaneIsVisibleL
       
  1419 // -----------------------------------------------------------
       
  1420 //
       
  1421 TBool CPhoneState::TitlePaneIsVisibleL() const
       
  1422     {
       
  1423     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::TitlePaneIsVisibleL( ) ");
       
  1424     return iViewCommandHandle->HandleCommandL(
       
  1425         EPhoneViewGetTitlePaneIsVisibleStatus ) ==
       
  1426         EPhoneViewResponseSuccess;
       
  1427     }
       
  1428 
       
  1429 // <---------------------------- MENU AND CBA EVENTS ------------------------->
  1251 // <---------------------------- MENU AND CBA EVENTS ------------------------->
  1430 
  1252 
  1431 EXPORT_C TBool CPhoneState::HandleCommandL( TInt aCommand )
  1253 EXPORT_C TBool CPhoneState::HandleCommandL( TInt aCommand )
  1432     {
  1254     {
  1433     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCommandL( ) ");
  1255     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCommandL( ) ");
  1434     TBool commandStatus = ETrue;
  1256     TBool commandStatus = ETrue;
  1435     switch( aCommand )
  1257     switch( aCommand )
  1436         {
  1258         {
  1437         case EPhoneEmergencyCmdExit:
  1259         case EPhoneEmergencyCmdExit:
  1438             {
  1260             {
  1439             //cancel emergency mode.
       
  1440             TPhoneCmdParamBoolean booleanParam;
       
  1441             booleanParam.SetBoolean( EFalse );
       
  1442             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetRetrictedDialer,&booleanParam );
       
  1443             }
  1261             }
  1444             // this should be bypasses?
  1262             // this should be bypasses?
  1445         case EPhoneDialerCallHandling:
  1263         case EPhoneDialerCallHandling:
  1446         case EPhoneCmdBack:
  1264         case EPhoneCmdBack:
  1447             BeginTransEffectLC( ENumberEntryClose );
       
  1448             // Remove number entry from screen
  1265             // Remove number entry from screen
  1449             iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
  1266             iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
  1450             // Do state-specific behaviour if number entry is cleared
  1267             // Do state-specific behaviour if number entry is cleared
  1451             HandleNumberEntryClearedL();
  1268             HandleNumberEntryClearedL();
  1452             EndTransEffect();
       
  1453             break;
  1269             break;
  1454 
  1270 
  1455         case EPhoneDialerCmdTouchInput:
  1271         case EPhoneDialerCmdTouchInput:
  1456             OpenVkbL();
       
  1457             break;
  1272             break;
  1458 
  1273 
  1459         case EPhoneNumberAcqCmdSendMessage:
  1274         case EPhoneNumberAcqCmdSendMessage:
  1460             // Open the mms editor
       
  1461             iViewCommandHandle->ExecuteCommandL(
       
  1462                 EPhoneViewSendMessage );
       
  1463             if ( !IsOnScreenDialerSupported() )
       
  1464                 {
       
  1465                 // Remove number entry from screen
       
  1466                 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
  1467                 // Do state-specific behaviour if number entry is cleared
       
  1468                 HandleNumberEntryClearedL();
       
  1469                 }
       
  1470             break;
  1275             break;
  1471 
  1276 
  1472         case EPhoneNumberAcqCmdSave:
  1277         case EPhoneNumberAcqCmdSave:
  1473             // Open Create contact
       
  1474             iViewCommandHandle->ExecuteCommandL(
       
  1475                 EPhoneViewAddContact );
       
  1476             break;
  1278             break;
  1477 
  1279 
  1478         case EPhoneNumberAcqCmdAddToName:
  1280         case EPhoneNumberAcqCmdAddToName:
  1479             // Open the message editor
       
  1480             iViewCommandHandle->ExecuteCommandL(
       
  1481                 EPhoneViewUpdateContact );
       
  1482             break;
  1281             break;
  1483 
  1282 
  1484         case EPhoneNumberAcqCmdAddToContacts:
  1283         case EPhoneNumberAcqCmdAddToContacts:
  1485             {
  1284             {
  1486             if ( IsOnScreenDialerSupported() )
  1285             if ( IsOnScreenDialerSupported() )
  1549                  aCommand == EPhoneInCallCmdBtHandsfree );
  1348                  aCommand == EPhoneInCallCmdBtHandsfree );
  1550             break;
  1349             break;
  1551 
  1350 
  1552         case EPhoneInCallCmdActivatEPhonebook:
  1351         case EPhoneInCallCmdActivatEPhonebook:
  1553             {
  1352             {
  1554             // Launch Phonebook application
       
  1555             TPhoneCmdParamAppInfo appInfoParam;
       
  1556             appInfoParam.SetAppUid( KPhoneUidAppPhonebook );
       
  1557             iViewCommandHandle->ExecuteCommandL(
       
  1558                 EPhoneViewActivateApp, &appInfoParam );
       
  1559             }
  1353             }
  1560             break;
  1354             break;
  1561 
  1355 
  1562         case EPhoneNumberAcqSecurityDialer:
  1356         case EPhoneNumberAcqSecurityDialer:
  1563             {
  1357             {
  1564             if ( IsOnScreenDialerSupported() && !IsNumberEntryUsedL() )
  1358 
  1565                 {
       
  1566                 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
       
  1567                 TPhoneCmdParamBoolean visibleMode;
       
  1568                 visibleMode.SetBoolean( ETrue );
       
  1569                 iViewCommandHandle->ExecuteCommandL(
       
  1570                             EPhoneViewSetStatusPaneVisible, &visibleMode );
       
  1571 
       
  1572 
       
  1573                 // Set emergency CBA, empty - exit
       
  1574                 iCbaManager->SetCbaL( EPhoneEmergencyModeNoteCBA );
       
  1575 
       
  1576                 // Set dialer to restricted mode.
       
  1577                 TPhoneCmdParamBoolean booleanParam;
       
  1578                 booleanParam.SetBoolean( ETrue );
       
  1579                 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetRetrictedDialer,&booleanParam );
       
  1580 
       
  1581                 NumberEntryManagerL()->CreateNumberEntryL();
       
  1582                 }
       
  1583             }
  1359             }
  1584             break;
  1360             break;
  1585 
  1361 
  1586         case EPhoneDialerCmdContacts:
  1362         case EPhoneDialerCmdContacts:
  1587             {
  1363             {
  1588             // Launch Phonebook application
  1364             }
  1589             TPhoneCmdParamAppInfo appInfoParam;
  1365             break;
  1590             appInfoParam.SetAppUid( KPhoneUidAppPhonebook );
  1366 
  1591             iViewCommandHandle->ExecuteCommandL(
       
  1592                 EPhoneViewActivateApp, &appInfoParam );
       
  1593             }
       
  1594             break;
       
  1595 
       
  1596         case EPhoneViewYesSingleItemFetch:
       
  1597             {
       
  1598             if ( IsOnScreenDialerSupported() )
       
  1599                 {
       
  1600                 TBuf<KPhoneNumberEntryBufferSize> fetchContent;
       
  1601                 fetchContent = iViewCommandHandle->FetchContent();
       
  1602                 if ( fetchContent.Length() )
       
  1603                     {
       
  1604                     iViewCommandHandle->ExecuteCommandL(
       
  1605                                             EPhoneViewSetNumberEntryContent,
       
  1606                                             0,
       
  1607                                             fetchContent );
       
  1608 
       
  1609                     CallFromNumberEntryL();
       
  1610                     }
       
  1611                 }
       
  1612             }
       
  1613             break;
       
  1614         case EPhoneNumberAcqCmdToggleNeAlphaMode:
  1367         case EPhoneNumberAcqCmdToggleNeAlphaMode:
  1615         case EPhoneNumberAcqCmdToggleNeNumericMode:
  1368         case EPhoneNumberAcqCmdToggleNeNumericMode:
  1616             {
  1369             {
  1617             // Toggle mode
  1370 
  1618             NumberEntryManagerL()->NumberEntryToggleAlphaNumericModeL();
       
  1619             }
  1371             }
  1620             break;
  1372             break;
  1621 
  1373 
  1622         case EPhoneCmdYesVideoFailedNoMemorySwitchToVoice:
  1374         case EPhoneCmdYesVideoFailedNoMemorySwitchToVoice:
  1623             DialVoiceCallL();
  1375             DialVoiceCallL();
  1648             // value to control (second parameter set false).
  1400             // value to control (second parameter set false).
  1649             ChangeAudioVolumeL( GetVolumeLevel(), EFalse );
  1401             ChangeAudioVolumeL( GetVolumeLevel(), EFalse );
  1650             }
  1402             }
  1651             break;
  1403             break;
  1652 
  1404 
  1653         case EPhoneDialerCmdHelp:
       
  1654             if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
       
  1655                 {
       
  1656                 TPtrC contextName;
       
  1657                 contextName.Set( KDATA_DIALER_HLP_MAIN() );
       
  1658                 iViewCommandHandle->ExecuteCommandL(
       
  1659                     EPhoneViewLaunchHelpApplication, 0, contextName );
       
  1660                 }
       
  1661             break;
       
  1662 
       
  1663         case EPhoneCmdVideoCallOutOfMemory:
  1405         case EPhoneCmdVideoCallOutOfMemory:
  1664             ShowVideoCallOutOfMemoryNoteL();
  1406             ShowVideoCallOutOfMemoryNoteL();
  1665             DisconnectCallL();
  1407             DisconnectCallL();
  1666             break;
  1408             break;
  1667             
  1409             
  1977     __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
  1719     __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
  1978         Panic( EPhoneCtrlInvariant ) );
  1720         Panic( EPhoneCtrlInvariant ) );
  1979 
  1721 
  1980     if ( IsOnScreenDialerSupported() )
  1722     if ( IsOnScreenDialerSupported() )
  1981         {
  1723         {
  1982         if ( IsDTMFEditorVisibleL() ||
  1724         if ( IsCustomizedDialerVisibleL() )
  1983              IsCustomizedDialerVisibleL() )
       
  1984             {
  1725             {
  1985             return;
  1726             return;
  1986             }
  1727             }
  1987 
  1728 
  1988         else if( IsNumberEntryUsedL() )
  1729         else if( IsNumberEntryUsedL() )
  1989             {
  1730             {
  1990             // Query on top of dialer
  1731             // Query on top of dialer
  1991             if ( IsAnyQueryActiveL() )
  1732             if ( IsAnyQueryActiveL() )
  1992                 {
  1733                 {
  1993                 return;
       
  1994                 }
       
  1995             else if ( IsMenuBarVisibleL() )
       
  1996                 {
       
  1997                 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
  1998                 return;
  1734                 return;
  1999                 }
  1735                 }
  2000             // Open recent calls list when the number entry is empty
  1736             // Open recent calls list when the number entry is empty
  2001             TPhoneCmdParamInteger numberEntryCountParam;
  1737             TPhoneCmdParamInteger numberEntryCountParam;
  2002             iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
  1738             iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
  2019     // Call the number
  1755     // Call the number
  2020     iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
  1756     iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
  2021 
  1757 
  2022     if ( phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength )
  1758     if ( phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength )
  2023         {
  1759         {
  2024         // Closing effect is shown when dialer exist.
       
  2025         BeginTransEffectLC( ENumberEntryClose );
       
  2026         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
  1760         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
  2027         EndTransEffect();
       
  2028 
  1761 
  2029         HandleNumberEntryClearedL();
  1762         HandleNumberEntryClearedL();
  2030         }
  1763         }
  2031 
  1764 
  2032     CleanupStack::PopAndDestroy( phoneNumber );
  1765     CleanupStack::PopAndDestroy( phoneNumber );
  2114     EndUiUpdate();
  1847     EndUiUpdate();
  2115 
  1848 
  2116      // Go to current state implementation
  1849      // Go to current state implementation
  2117     iCbaManager->UpdateInCallCbaL();
  1850     iCbaManager->UpdateInCallCbaL();
  2118 
  1851 
  2119     //Update state of switch to video or voice call touch button.
       
  2120     TPECallType type = iStateMachine->PhoneEngineInfo()->CallType( aCallId );
       
  2121 
       
  2122     if( type == EPECallTypeVideo )
       
  2123         {
       
  2124         TPhoneCmdParamBoolean booleanParam;
       
  2125         booleanParam.SetBoolean( ETrue );
       
  2126         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVideoCallFlag, &booleanParam );
       
  2127         }
       
  2128     else
       
  2129         {
       
  2130         TPhoneCmdParamBoolean booleanParam;
       
  2131         booleanParam.SetBoolean( EFalse );
       
  2132         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVideoCallFlag, &booleanParam );
       
  2133         }
       
  2134 
       
  2135     // Go to background if necessary
  1852     // Go to background if necessary
  2136     if ( NeedToSendToBackgroundL() ||  IsAutoLockOn() )
  1853     if ( NeedToSendToBackgroundL() ||  IsAutoLockOn() )
  2137         {
  1854         {
  2138         // If number entry is used set control and visibility.
       
  2139         if ( IsNumberEntryUsedL() )
       
  2140            {
       
  2141            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
       
  2142            }
       
  2143         }
  1855         }
  2144     // If there is no need to send back ground and number entry is used then
  1856     // If there is no need to send back ground and number entry is used then
  2145     // we must show number entry.
  1857     // we must show number entry.
  2146     else if ( !NeedToSendToBackgroundL() && IsNumberEntryUsedL() )
  1858     else if ( !NeedToSendToBackgroundL() && IsNumberEntryUsedL() )
  2147         {
  1859         {
  2272     if ( incomingCall > KErrNotFound )
  1984     if ( incomingCall > KErrNotFound )
  2273         {
  1985         {
  2274        if( activeCallCount.Integer() == ENoActiveCalls )
  1986        if( activeCallCount.Integer() == ENoActiveCalls )
  2275             {
  1987             {
  2276             iCbaManager->UpdateIncomingCbaL( incomingCall );
  1988             iCbaManager->UpdateIncomingCbaL( incomingCall );
  2277             UpdateSilenceButtonDimming();
       
  2278             }
  1989             }
  2279         else
  1990         else
  2280             {
  1991             {
  2281             iCbaManager->UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
  1992             iCbaManager->UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
  2282             }
  1993             }
  2307         return EFalse;
  2018         return EFalse;
  2308         }
  2019         }
  2309     }
  2020     }
  2310 
  2021 
  2311 // <-------------------------- CONTEXT MENU ------------------------->
  2022 // <-------------------------- CONTEXT MENU ------------------------->
  2312 
       
  2313 // -----------------------------------------------------------------------------
       
  2314 // CPhoneState::SetContextMenu
       
  2315 // -----------------------------------------------------------------------------
       
  2316 //
       
  2317 EXPORT_C void CPhoneState::SetContextMenuL( TInt aResourceId )
       
  2318     {
       
  2319     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetContextMenuL() ");
       
  2320 
       
  2321     TPhoneCmdParamInteger integerParam;
       
  2322     TInt resId( CPhoneMainResourceResolver::Instance()->
       
  2323                             ResolveResourceID( aResourceId ) );
       
  2324     integerParam.SetInteger( resId );
       
  2325     __PHONELOG1( EBasic, EPhoneControl,
       
  2326                   "CPhoneState::SetContextMenuL : resId =%d",resId );
       
  2327 
       
  2328     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateContextMenu,
       
  2329                                       &integerParam );
       
  2330     }
       
  2331 // -----------------------------------------------------------------------------
       
  2332 // CPhoneState::UpdateInCallContextMenuL
       
  2333 // -----------------------------------------------------------------------------
       
  2334 //
       
  2335 EXPORT_C void CPhoneState::UpdateInCallContextMenuL()
       
  2336     {
       
  2337     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateInCallContextMenuL() ");
       
  2338 
       
  2339     SetContextMenuL( EPhoneNumberAcqMenubar );
       
  2340 
       
  2341     }
       
  2342 
       
  2343 // -----------------------------------------------------------------------------
       
  2344 // CPhoneState::UpdateIncomingContextMenuL
       
  2345 // -----------------------------------------------------------------------------
       
  2346 //
       
  2347 EXPORT_C void CPhoneState::UpdateIncomingContextMenuL( TInt aCallId )
       
  2348     {
       
  2349     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateIncomingContextMenuL() ");
       
  2350 
       
  2351     if( CPhoneState::IsVideoCall ( aCallId ) )
       
  2352         {
       
  2353         SetContextMenuL( EPhoneIncomingVideoCallMenubar );
       
  2354         }
       
  2355     else
       
  2356         {
       
  2357         SetContextMenuL( EPhoneIncomingCallMenubar );
       
  2358         }
       
  2359 
       
  2360     }
       
  2361 
  2023 
  2362 // -----------------------------------------------------------
  2024 // -----------------------------------------------------------
  2363 // CPhoneState::ShowNoteL
  2025 // CPhoneState::ShowNoteL
  2364 // -----------------------------------------------------------
  2026 // -----------------------------------------------------------
  2365 //
  2027 //
  2599     }
  2261     }
  2600 
  2262 
  2601 // <-------------------------- INTERNAL FUNCTIONS ------------------------>
  2263 // <-------------------------- INTERNAL FUNCTIONS ------------------------>
  2602 
  2264 
  2603 // -----------------------------------------------------------
  2265 // -----------------------------------------------------------
  2604 // CPhoneState::UpdateIncallIndicatorL
       
  2605 // -----------------------------------------------------------
       
  2606 //
       
  2607 void CPhoneState::UpdateIncallIndicatorL( TInt aCallState )
       
  2608     {
       
  2609     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateIncallIndicatorL( ) ");
       
  2610     TPhoneCmdParamIncallIndicatorData incallIndicatorParam;
       
  2611 
       
  2612     // Set the state
       
  2613     incallIndicatorParam.SetCallState( aCallState );
       
  2614 
       
  2615     // Set mode
       
  2616     incallIndicatorParam.SetMode(
       
  2617        CPhonePubSubProxy::Instance()->Value(
       
  2618             KPSUidCtsyCallInformation,
       
  2619             KCTsyCallType ) );
       
  2620 
       
  2621     TInt activeCallId = GetActiveCallIdL();
       
  2622     if ( activeCallId > KErrNotFound )
       
  2623         {
       
  2624         if ( iStateMachine->PhoneEngineInfo()->CallALSLine( activeCallId )
       
  2625              == CCCECallParameters::ECCELineTypeAux )
       
  2626             {
       
  2627             incallIndicatorParam.SetLine2( ETrue );
       
  2628             }
       
  2629         }
       
  2630 
       
  2631     // Set the mute status
       
  2632     const TBool audioMute = iStateMachine->PhoneEngineInfo()->AudioMute();
       
  2633     incallIndicatorParam.SetMute( audioMute );
       
  2634 
       
  2635     // Set the voice privacy status
       
  2636     if ( activeCallId > KErrNotFound &&
       
  2637          activeCallId != KConferenceCallId  )
       
  2638         {
       
  2639         incallIndicatorParam.SetCiphering(
       
  2640             iStateMachine->PhoneEngineInfo()->IsSecureCall( activeCallId ) );
       
  2641         }
       
  2642     else
       
  2643         {
       
  2644         incallIndicatorParam.SetCiphering( ETrue );
       
  2645         }
       
  2646 
       
  2647     incallIndicatorParam.SetCipheringIndicatorAllowed(
       
  2648         iStateMachine->PhoneEngineInfo()->SecureSpecified() );
       
  2649 
       
  2650     // Set the emergency status
       
  2651     if( EPEStateIdle != iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) )
       
  2652         {
       
  2653         incallIndicatorParam.SetEmergency( ETrue );
       
  2654         }
       
  2655 
       
  2656     if( aCallState == EPSCTsyCallStateDisconnecting )
       
  2657         {
       
  2658         if ( TopAppIsDisplayedL() )
       
  2659             {
       
  2660             if ( ( !IsOnScreenDialerSupported() ) ||
       
  2661                  ( IsOnScreenDialerSupported() && !IsNumberEntryVisibleL() ) )
       
  2662                 {
       
  2663                 // Phone application is in the foreground so we don't need to
       
  2664                 // display the little bubble. If we don't hide it here then
       
  2665                 // it will appear for a short time. We don't want that.
       
  2666                 incallIndicatorParam.SetLittleBubbleVisible( EFalse );
       
  2667                 }
       
  2668             }
       
  2669         }
       
  2670 
       
  2671     // Update the in-call indicator
       
  2672     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateIncallIndicator,
       
  2673         &incallIndicatorParam );
       
  2674     }
       
  2675 
       
  2676 // -----------------------------------------------------------
       
  2677 // CPhoneState::UpdateProfileDisplayL
  2266 // CPhoneState::UpdateProfileDisplayL
  2678 // -----------------------------------------------------------
  2267 // -----------------------------------------------------------
  2679 //
  2268 //
  2680 void CPhoneState::UpdateProfileDisplayL()
  2269 void CPhoneState::UpdateProfileDisplayL()
  2681     {
  2270     {
  2682     }
  2271     }
  2683 
  2272 
  2684 // -----------------------------------------------------------
       
  2685 // CPhoneState::UpdateOperatorDisplayL
       
  2686 // -----------------------------------------------------------
       
  2687 //
       
  2688 void CPhoneState::UpdateOperatorDisplayL()
       
  2689     {
       
  2690     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateOperatorDisplayL( ) ");
       
  2691     __PHONELOG( EBasic, EPhoneControl, "CPhoneState::UpdateOperatorDisplayL" );
       
  2692     // Get current title pane content.
       
  2693     TTelTitleDisplay titleContent;
       
  2694     titleContent.iDisplayTag.Zero();
       
  2695     titleContent.iLogoHandle = 0;
       
  2696     TPckg<TTelTitleDisplay> titlePckg( titleContent );
       
  2697 
       
  2698     RProperty::Get(
       
  2699         KPSUidTelInformation,
       
  2700         KTelDisplayInfo,
       
  2701         titlePckg );
       
  2702 
       
  2703     if ( TitlePaneIsVisibleL() )
       
  2704         {
       
  2705         // There is a title pane icon.
       
  2706         if ( titleContent.iLogoHandle != 0 )
       
  2707             {
       
  2708             // Set new logo.
       
  2709             __PHONELOG( EBasic, EPhoneControl,
       
  2710                 "CPhoneState::UpdateOperatorDisplayL - logo found" );
       
  2711 
       
  2712             if( iLogoHandle != titleContent.iLogoHandle )
       
  2713                 {
       
  2714                  __PHONELOG( EBasic, EPhoneControl,
       
  2715                   "CPhoneState::UpdateOperatorDisplayL - set new logo" );
       
  2716 
       
  2717                  TPhoneCmdParamBitmap bitmapParam;
       
  2718 
       
  2719                  // Duplicate bitmap from handle.
       
  2720                  CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
       
  2721                  CleanupStack::PushL( bitmap );
       
  2722                  User::LeaveIfError(
       
  2723                          bitmap->Duplicate( titleContent.iLogoHandle ) );
       
  2724                  bitmapParam.SetBitmap( bitmap );
       
  2725 
       
  2726                  // Duplicate and set bitmap mask if needed
       
  2727                  CFbsBitmap* maskBitmap = NULL;
       
  2728                  if( titleContent.iLogoMaskHandle != 0 )
       
  2729                      {
       
  2730                      maskBitmap = new( ELeave )CFbsBitmap;
       
  2731                      CleanupStack::PushL( maskBitmap );
       
  2732                      User::LeaveIfError( maskBitmap->Duplicate(
       
  2733                              titleContent.iLogoMaskHandle ) );
       
  2734                      bitmapParam.SetMaskBitmap( maskBitmap );
       
  2735                      }
       
  2736 
       
  2737                  iViewCommandHandle->ExecuteCommandL(
       
  2738                          EPhoneViewSetTitlePanePicture,
       
  2739                          &bitmapParam );
       
  2740 
       
  2741                  // The title pane takes ownership of the bitmaps so no need
       
  2742                  // to destroy it here.
       
  2743                  if( maskBitmap )
       
  2744                      {
       
  2745                      // Pop maskBitmap only, if it has been created
       
  2746                      CleanupStack::Pop( maskBitmap );
       
  2747                      }
       
  2748                  CleanupStack::Pop( bitmap );
       
  2749                 }
       
  2750             }
       
  2751         else
       
  2752             {
       
  2753             __PHONELOG1( EBasic, EPhoneControl,
       
  2754             "CPhoneState::UpdateOperatorDisplayL - set text=%S", &titleContent.iDisplayTag );
       
  2755             iLogoHandle = titleContent.iLogoHandle;
       
  2756 
       
  2757             iViewCommandHandle->ExecuteCommandL(
       
  2758                 EPhoneViewSetTitlePaneContent,
       
  2759                 0,
       
  2760                 titleContent.iDisplayTag );
       
  2761             }
       
  2762         }
       
  2763 
       
  2764     // Check background image.
       
  2765     TPhoneCmdParamBitmap savedBitmapParam;
       
  2766     iViewCommandHandle->ExecuteCommandL(
       
  2767         EPhoneViewGetBackgroundImageBitmap,
       
  2768         &savedBitmapParam );
       
  2769 
       
  2770     if ( titleContent.iBackgroundImageHandle !=
       
  2771         savedBitmapParam.Bitmap()->Handle() )
       
  2772         {
       
  2773         __PHONELOG2( EBasic, EPhoneControl,
       
  2774         "CPhoneState::UpdateOperatorDisplayL - update background image since different titleContent(%d), saved(%d)",
       
  2775             titleContent.iBackgroundImageHandle, savedBitmapParam.Bitmap()->Handle() );
       
  2776         // Background image has changed. Duplicate bitmap from handle if
       
  2777         // available; otherwise reset the background image
       
  2778         CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
       
  2779         CleanupStack::PushL( bitmap );
       
  2780         TInt err = KErrNone;
       
  2781         if ( titleContent.iBackgroundImageHandle != 0 )
       
  2782             {
       
  2783             err = bitmap->Duplicate( titleContent.iBackgroundImageHandle );
       
  2784             }
       
  2785         else
       
  2786             {
       
  2787             bitmap->Reset();
       
  2788             }
       
  2789 
       
  2790         if ( err == KErrNone )
       
  2791             {
       
  2792             iBitmapRedrawCounter = titleContent.iBackgroundImageRedrawCounter;
       
  2793             TPhoneCmdParamBitmap bitmapParam;
       
  2794             bitmapParam.SetBitmap( bitmap );
       
  2795             iViewCommandHandle->ExecuteCommandL(
       
  2796                 EPhoneViewSetBackgroundImageBitmap,
       
  2797                 &bitmapParam );
       
  2798             }
       
  2799 
       
  2800         CleanupStack::PopAndDestroy( bitmap );
       
  2801         }
       
  2802     else if ( titleContent.iBackgroundImageRedrawCounter !=
       
  2803                   iBitmapRedrawCounter  )
       
  2804         {
       
  2805         iBitmapRedrawCounter = titleContent.iBackgroundImageRedrawCounter;
       
  2806         iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateView );
       
  2807         }
       
  2808     }
       
  2809 
  2273 
  2810 // -----------------------------------------------------------
  2274 // -----------------------------------------------------------
  2811 // CPhoneState::HandleInitiatedEmergencyCallL
  2275 // CPhoneState::HandleInitiatedEmergencyCallL
  2812 // Default handling for EPEMessageInitiatedEmergencyCallL message
  2276 // Default handling for EPEMessageInitiatedEmergencyCallL message
  2813 // (other items were commented in a header).
  2277 // (other items were commented in a header).
  2824 
  2288 
  2825     // Reset Hold flag to view
  2289     // Reset Hold flag to view
  2826     TPhoneCmdParamBoolean holdFlag;
  2290     TPhoneCmdParamBoolean holdFlag;
  2827     holdFlag.SetBoolean( EFalse );
  2291     holdFlag.SetBoolean( EFalse );
  2828     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
  2292     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
  2829 
       
  2830     // Undim Answer button for sure.
       
  2831     SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
       
  2832 
  2293 
  2833     // Go to emergency call state
  2294     // Go to emergency call state
  2834     // No need update cba
  2295     // No need update cba
  2835     iStateMachine->ChangeState( EPhoneStateEmergency );
  2296     iStateMachine->ChangeState( EPhoneStateEmergency );
  2836     }
  2297     }
  3110     securityMode.SetBoolean( ETrue );
  2571     securityMode.SetBoolean( ETrue );
  3111     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSecurityMode, &securityMode );
  2572     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSecurityMode, &securityMode );
  3112 
  2573 
  3113     // Remove number entry from screen
  2574     // Remove number entry from screen
  3114     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
  2575     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
  3115 
       
  3116     TPhoneCmdParamBoolean visibleMode;
       
  3117     visibleMode.SetBoolean( EFalse );
       
  3118     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetStatusPaneVisible, &visibleMode );
       
  3119     
  2576     
  3120     iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
  2577     iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
  3121 
  2578 
  3122     TPhoneCmdParamInteger uidParam;
  2579     TPhoneCmdParamInteger uidParam;
  3123     // Bring Phone app in the foreground
  2580     // Bring Phone app in the foreground
  3459         booleanParam.SetBoolean( emergency );
  2916         booleanParam.SetBoolean( emergency );
  3460 
  2917 
  3461         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
  2918         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
  3462                      EPhoneViewSetTouchPaneButtons,
  2919                      EPhoneViewSetTouchPaneButtons,
  3463                      &booleanParam ) );
  2920                      &booleanParam ) );
  3464         SetTouchPaneVisible( ETrue );
       
  3465         }
  2921         }
  3466     }
  2922     }
  3467 
  2923 
  3468 // ---------------------------------------------------------
  2924 // ---------------------------------------------------------
  3469 // CPhoneState::DeleteTouchPaneButtons
  2925 // CPhoneState::DeleteTouchPaneButtons
  3475         {
  2931         {
  3476         TPhoneCmdParamBoolean boolParam;
  2932         TPhoneCmdParamBoolean boolParam;
  3477         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
  2933         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
  3478                         EPhoneViewSetTouchPaneButtons,
  2934                         EPhoneViewSetTouchPaneButtons,
  3479                         &boolParam ) );
  2935                         &boolParam ) );
  3480         SetTouchPaneVisible( EFalse );
       
  3481         }
       
  3482     }
       
  3483 
       
  3484 // ---------------------------------------------------------
       
  3485 // CPhoneState::SetTouchPaneVisible
       
  3486 // ---------------------------------------------------------
       
  3487 //
       
  3488 EXPORT_C void CPhoneState::SetTouchPaneVisible( TBool aVisible )
       
  3489     {
       
  3490     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
       
  3491         {
       
  3492         TPhoneCmdParamBoolean booleanParam;
       
  3493         booleanParam.SetBoolean( aVisible );
       
  3494         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
       
  3495                         EPhoneViewSetTouchPaneVisible,
       
  3496                         &booleanParam ) );
       
  3497         }
       
  3498     }
       
  3499 
       
  3500 // ----------------------------------------------------------------------------
       
  3501 // CPhoneState::SetTouchButtonEnabled
       
  3502 // ----------------------------------------------------------------------------
       
  3503 //
       
  3504 EXPORT_C void CPhoneState::SetTouchPaneButtonEnabled( TInt aCommandId )
       
  3505     {
       
  3506     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
       
  3507         {
       
  3508         TPhoneCmdParamInteger commandParam;
       
  3509         commandParam.SetInteger( aCommandId );
       
  3510         iViewCommandHandle->ExecuteCommand( EPhoneViewEnableTouchButton,
       
  3511                                             &commandParam );
       
  3512         }
       
  3513     }
       
  3514 
       
  3515 // ----------------------------------------------------------------------------
       
  3516 // CPhoneState::SetTouchButtonDisabled
       
  3517 // ----------------------------------------------------------------------------
       
  3518 //
       
  3519 EXPORT_C void CPhoneState::SetTouchPaneButtonDisabled( TInt aCommandId )
       
  3520     {
       
  3521     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
       
  3522         {
       
  3523         TPhoneCmdParamInteger commandParam;
       
  3524         commandParam.SetInteger( aCommandId );
       
  3525 
       
  3526         iViewCommandHandle->ExecuteCommand( EPhoneViewDisableTouchButton,
       
  3527                                             &commandParam );
       
  3528         }
  2936         }
  3529     }
  2937     }
  3530 
  2938 
  3531 // ---------------------------------------------------------
  2939 // ---------------------------------------------------------
  3532 // CPhoneState::HandleLongHashL
  2940 // CPhoneState::HandleLongHashL
  3534 //
  2942 //
  3535 EXPORT_C void CPhoneState::HandleLongHashL()
  2943 EXPORT_C void CPhoneState::HandleLongHashL()
  3536     {
  2944     {
  3537     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleLongHashL() ");
  2945     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleLongHashL() ");
  3538 
  2946 
  3539     TPhoneCmdParamInteger numberEntryCountParam;
       
  3540     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
       
  3541             &numberEntryCountParam );
       
  3542     TInt neLength( numberEntryCountParam.Integer() );
       
  3543 
       
  3544     if( iCustomization && iCustomization->AllowAlphaNumericMode() )
       
  3545         {
       
  3546         if ( NumberEntryManagerL()->NumberEntryInNumericModeL() )
       
  3547             {
       
  3548             if ( neLength == 0 )
       
  3549                 {
       
  3550                 OnlyHashInNumberEntryL();
       
  3551                 }
       
  3552 
       
  3553             if ( neLength == 1 )
       
  3554                 {
       
  3555                 NumberEntryClearL();
       
  3556                 }
       
  3557             }
       
  3558         NumberEntryManagerL()->NumberEntryToggleAlphaNumericModeL();
       
  3559         }
       
  3560     else
       
  3561         {
       
  3562         if( neLength == 1 )
       
  3563             {
       
  3564             TPhoneCmdParamBoolean isSecurityMode;
       
  3565             iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
       
  3566 
       
  3567             if ( !isSecurityMode.Boolean() )
       
  3568                 {
       
  3569                 OnlyHashInNumberEntryL();
       
  3570                 }
       
  3571             }
       
  3572         }
       
  3573     }
       
  3574 
       
  3575 // -----------------------------------------------------------
       
  3576 // CPhoneState::OpenVKBL
       
  3577 // -----------------------------------------------------------
       
  3578 //
       
  3579 void CPhoneState::OpenVkbL()
       
  3580     {
       
  3581     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::OpenVKB() ");
       
  3582     iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenVirtualKeyBoard );
       
  3583     }
  2947     }
  3584 
  2948 
  3585 // -----------------------------------------------------------
  2949 // -----------------------------------------------------------
  3586 // CPhoneState::BeginUiUpdateLC
  2950 // CPhoneState::BeginUiUpdateLC
  3587 // -----------------------------------------------------------
  2951 // -----------------------------------------------------------
  3594     TCleanupItem operation( UiUpdateCleanup, this );
  2958     TCleanupItem operation( UiUpdateCleanup, this );
  3595     CleanupStack::PushL( operation );
  2959     CleanupStack::PushL( operation );
  3596     }
  2960     }
  3597 
  2961 
  3598 // -----------------------------------------------------------
  2962 // -----------------------------------------------------------
  3599 // CPhoneState::BeginTransEffectLC
       
  3600 // -----------------------------------------------------------
       
  3601 //
       
  3602 EXPORT_C void CPhoneState::BeginTransEffectLC(  TStateTransEffectType aType )
       
  3603     {
       
  3604     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::BeginTransEffectLC( ) ");
       
  3605     TPhoneCmdParamTransEffect effectParam;
       
  3606 
       
  3607     switch ( aType )
       
  3608         {
       
  3609         case ENumberEntryOpen:
       
  3610             effectParam.SetType( EPhoneTransEffectDialerOpen );
       
  3611             break;
       
  3612         case ENumberEntryClose:
       
  3613             effectParam.SetType( EPhoneTransEffectDialerClose );
       
  3614             break;
       
  3615         case ENumberEntryCreate:
       
  3616             effectParam.SetType( EPhoneTransEffectDialerCreate );
       
  3617             break;
       
  3618         default:
       
  3619             effectParam.SetType( EPhoneTransEffectNone );
       
  3620         }
       
  3621 
       
  3622     iViewCommandHandle->ExecuteCommand( EPhoneViewBeginTransEffect,  &effectParam );
       
  3623 
       
  3624     TCleanupItem operation( EffectCleanup, this );
       
  3625     CleanupStack::PushL( operation );
       
  3626     }
       
  3627 
       
  3628 // -----------------------------------------------------------
       
  3629 // CPhoneState::EndUiUpdate
  2963 // CPhoneState::EndUiUpdate
  3630 // -----------------------------------------------------------
  2964 // -----------------------------------------------------------
  3631 //
  2965 //
  3632 EXPORT_C void CPhoneState::EndUiUpdate()
  2966 EXPORT_C void CPhoneState::EndUiUpdate()
  3633     {
  2967     {
  3634     CleanupStack::PopAndDestroy(); // Call UiUpdateCleanup
  2968     CleanupStack::PopAndDestroy(); // Call UiUpdateCleanup
  3635     }
       
  3636 
       
  3637 // -----------------------------------------------------------
       
  3638 // CPhoneState::EndTransEffect
       
  3639 // -----------------------------------------------------------
       
  3640 //
       
  3641 EXPORT_C void CPhoneState::EndTransEffect()
       
  3642     {
       
  3643     CleanupStack::PopAndDestroy(); // Call EffectCleanup
       
  3644     }
  2969     }
  3645 
  2970 
  3646 // -----------------------------------------------------------
  2971 // -----------------------------------------------------------
  3647 // CPhoneState::CheckIfShowTerminationNote
  2972 // CPhoneState::CheckIfShowTerminationNote
  3648 // This method is intended to be overridden in states
  2973 // This method is intended to be overridden in states
  3686 //
  3011 //
  3687 void CPhoneState::UiUpdateCleanup(TAny* aThis )
  3012 void CPhoneState::UiUpdateCleanup(TAny* aThis )
  3688     {
  3013     {
  3689     static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand(
  3014     static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand(
  3690         EPhoneViewEndUpdate );
  3015         EPhoneViewEndUpdate );
  3691     }
       
  3692 
       
  3693 // -----------------------------------------------------------------------------
       
  3694 // CPhoneState::EffectCleanup
       
  3695 // -----------------------------------------------------------------------------
       
  3696 //
       
  3697 void CPhoneState::EffectCleanup(TAny* aThis )
       
  3698     {
       
  3699     TPhoneCmdParamTransEffect effectParam;
       
  3700     effectParam.SetType( EPhoneTransEffectStop );
       
  3701 
       
  3702     static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand(
       
  3703         EPhoneViewEndTransEffect, &effectParam );
       
  3704     }
       
  3705 
       
  3706 // -----------------------------------------------------------------------------
       
  3707 // CPhoneState::IsDTMFEditorVisibleL
       
  3708 // -----------------------------------------------------------------------------
       
  3709 //
       
  3710 EXPORT_C TBool CPhoneState::IsDTMFEditorVisibleL() const
       
  3711     {
       
  3712     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsDTMFEditorVisibleL( ) ");
       
  3713     return iViewCommandHandle->HandleCommandL(
       
  3714         EPhoneViewIsDTMFEditorVisible ) ==
       
  3715         EPhoneViewResponseSuccess;
       
  3716     }
       
  3717 
       
  3718 // -----------------------------------------------------------------------------
       
  3719 // CPhoneState::CloseDTMFEditorL
       
  3720 // -----------------------------------------------------------------------------
       
  3721 //
       
  3722 EXPORT_C void CPhoneState::CloseDTMFEditorL()
       
  3723     {
       
  3724     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseDTMFEditorL()");
       
  3725     if ( iOnScreenDialer ) // Touch
       
  3726         {
       
  3727         TPhoneCmdParamBoolean booleanParam;
       
  3728         booleanParam.SetBoolean( EFalse );
       
  3729         // Disable dialer DTMF mode
       
  3730         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfDialerViewVisible,
       
  3731                                              &booleanParam );
       
  3732 
       
  3733         // Closing effect is shown when DTMF dialer exist.
       
  3734         BeginTransEffectLC( ENumberEntryClose );
       
  3735         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
  3736         EndTransEffect();
       
  3737         }
       
  3738     else // Non-Touch
       
  3739         {
       
  3740         // If dtmf query is visible then remove number entry
       
  3741         // because it should not be shown if user has pressed end key.
       
  3742         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
  3743         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
       
  3744         }
       
  3745 
       
  3746     // Do state-specific behaviour if number entry is cleared
       
  3747     HandleNumberEntryClearedL();
       
  3748     }
  3016     }
  3749 
  3017 
  3750 // -----------------------------------------------------------
  3018 // -----------------------------------------------------------
  3751 // CPhoneState::SetDefaultFlagsL()
  3019 // CPhoneState::SetDefaultFlagsL()
  3752 // -----------------------------------------------------------
  3020 // -----------------------------------------------------------
  4059                 iCustomization );
  3327                 iCustomization );
  4060         }
  3328         }
  4061     return iCallHeaderManager;
  3329     return iCallHeaderManager;
  4062     }
  3330     }
  4063 
  3331 
  4064 // -----------------------------------------------------------------------------
       
  4065 // CPhoneState::CloseCustomizedDialerL
       
  4066 // -----------------------------------------------------------------------------
       
  4067 //
       
  4068 EXPORT_C void CPhoneState::CloseCustomizedDialerL()
       
  4069     {
       
  4070     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseCustomizedDialerL( ) ");
       
  4071 
       
  4072     // Set dialer back to default mode.
       
  4073     iViewCommandHandle->HandleCommandL( EPhoneViewHideCustomizedDialer );
       
  4074 
       
  4075     // Closing effect is shown when customized dialer exist.
       
  4076     BeginTransEffectLC( ENumberEntryClose );
       
  4077 
       
  4078     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
  4079 
       
  4080     EndTransEffect();
       
  4081     // Do state-specific behaviour if number entry is cleared
       
  4082     HandleNumberEntryClearedL();
       
  4083     }
       
  4084 
       
  4085 // -----------------------------------------------------------------------------
       
  4086 // CPhoneState::CustomizedDialerMenuResourceId
       
  4087 // -----------------------------------------------------------------------------
       
  4088 //
       
  4089 EXPORT_C TInt CPhoneState::CustomizedDialerMenuResourceIdL()
       
  4090     {
       
  4091     __LOGMETHODSTARTEND(EPhoneControl,
       
  4092         "CPhoneState::CustomizedDialerMenuResourceId( ) ");
       
  4093     // Get and return customized dialer menu resource id
       
  4094     TPhoneCmdParamInteger integerParam;
       
  4095     iViewCommandHandle->HandleCommandL(
       
  4096         EPhoneViewGetCustomizedDialerMenuResourceId,
       
  4097         &integerParam );
       
  4098     return integerParam.Integer();
       
  4099     }
       
  4100 
       
  4101 // -----------------------------------------------------------------------------
       
  4102 // CPhoneState::CustomizedDialerCbaResourceId
       
  4103 // -----------------------------------------------------------------------------
       
  4104 //
       
  4105 EXPORT_C TInt CPhoneState::CustomizedDialerCbaResourceIdL()
       
  4106     {
       
  4107     __LOGMETHODSTARTEND(EPhoneControl,
       
  4108            "CPhoneState::CustomizedDialerCbaResourceId( ) ");
       
  4109     // Get and return customized dialer CBA resource id
       
  4110     TPhoneCmdParamInteger integerParam;
       
  4111     iViewCommandHandle->HandleCommandL(
       
  4112             EPhoneViewGetCustomizedDialerCbaResourceId,
       
  4113         &integerParam );
       
  4114     return integerParam.Integer();
       
  4115     }
       
  4116 
       
  4117 // -----------------------------------------------------------
       
  4118 // CPhoneState::ShowDtmfDialerL
       
  4119 // -----------------------------------------------------------
       
  4120 //
       
  4121 void CPhoneState::ShowDtmfDialerL()
       
  4122     {
       
  4123     __LOGMETHODSTARTEND(EPhoneControl,
       
  4124         "CPhoneState::ShowDtmfDialerL()" );
       
  4125 
       
  4126     // Set dialer to DTMF mode.
       
  4127     TPhoneCmdParamBoolean booleanParam;
       
  4128     booleanParam.SetBoolean( ETrue );
       
  4129     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfDialerViewVisible,
       
  4130                                          &booleanParam );
       
  4131 
       
  4132     BeginTransEffectLC( ENumberEntryCreate );
       
  4133 
       
  4134     if ( IsNumberEntryUsedL() )
       
  4135         {
       
  4136         // Store the number entry content to cache
       
  4137         if ( !IsNumberEntryContentStored() )
       
  4138             {
       
  4139             StoreNumberEntryContentL();
       
  4140             }
       
  4141         // Clear and display DTMF dialer
       
  4142         NumberEntryClearL();
       
  4143         SetNumberEntryVisibilityL(ETrue);
       
  4144         }
       
  4145     else
       
  4146         {
       
  4147         // Create and display DTMF dialer
       
  4148         NumberEntryManagerL()->CreateNumberEntryL();
       
  4149         }
       
  4150 
       
  4151     EndTransEffect();
       
  4152 
       
  4153     // Update CBA
       
  4154     iCbaManager->UpdateInCallCbaL();
       
  4155     }
       
  4156 
       
  4157 // -----------------------------------------------------------
  3332 // -----------------------------------------------------------
  4158 // CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer
  3333 // CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer
  4159 // -----------------------------------------------------------
  3334 // -----------------------------------------------------------
  4160 //
  3335 //
  4161 EXPORT_C void CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer()
  3336 EXPORT_C void CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer()
  4162     {
  3337     {
  4163     if ( IsOnScreenDialerSupported() )
  3338 
  4164         {
       
  4165         TBool isDialerVisible( EFalse );
       
  4166         TRAP_IGNORE( isDialerVisible = IsDTMFEditorVisibleL() );
       
  4167 
       
  4168          if ( isDialerVisible )
       
  4169              {
       
  4170              TRAP_IGNORE( CloseDTMFEditorL() );
       
  4171              }
       
  4172 
       
  4173          // if the DTMF dialer is used before the idle message, we have to
       
  4174          // restore the original content of the number entry
       
  4175          if ( IsNumberEntryContentStored() )
       
  4176              {
       
  4177              TBool isNumberEntryUsed( EFalse );
       
  4178              TRAP_IGNORE( isNumberEntryUsed = IsNumberEntryUsedL() );
       
  4179 
       
  4180              if ( !isNumberEntryUsed )
       
  4181                  {
       
  4182                  TRAP_IGNORE( NumberEntryManagerL()->CreateNumberEntryL() );
       
  4183                  }
       
  4184              // Restore the number entry content from cache
       
  4185              TRAP_IGNORE( RestoreNumberEntryContentL() );
       
  4186              }
       
  4187          }
       
  4188     }
  3339     }
  4189 
  3340 
  4190 // -----------------------------------------------------------
  3341 // -----------------------------------------------------------
  4191 // CPhoneState::IsOnScreenDialerSupported
  3342 // CPhoneState::IsOnScreenDialerSupported
  4192 // -----------------------------------------------------------
  3343 // -----------------------------------------------------------
  4274     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNumberEntryVisibleL( ) ");
  3425     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNumberEntryVisibleL( ) ");
  4275     return NumberEntryManagerL()->IsNumberEntryVisibleL();
  3426     return NumberEntryManagerL()->IsNumberEntryVisibleL();
  4276     }
  3427     }
  4277 
  3428 
  4278 // -----------------------------------------------------------
  3429 // -----------------------------------------------------------
  4279 // CPhoneState::KeyEventForExistingNumberEntryL
       
  4280 // -----------------------------------------------------------
       
  4281 //
       
  4282 void CPhoneState::KeyEventForExistingNumberEntryL( const TKeyEvent& aKeyEvent,
       
  4283     TEventCode aEventCode )
       
  4284     {
       
  4285     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::KeyEventForExistingNumberEntryL( ) ");
       
  4286     NumberEntryManagerL()->KeyEventForExistingNumberEntryL( aKeyEvent, aEventCode );
       
  4287     }
       
  4288 
       
  4289 // -----------------------------------------------------------
       
  4290 // CPhoneState::HandleNumberEntryClearedL
  3430 // CPhoneState::HandleNumberEntryClearedL
  4291 // -----------------------------------------------------------
  3431 // -----------------------------------------------------------
  4292 //
  3432 //
  4293 EXPORT_C void CPhoneState::HandleNumberEntryClearedL()
  3433 EXPORT_C void CPhoneState::HandleNumberEntryClearedL()
  4294     {
  3434     {
  4310         booleanParam.SetBoolean( EFalse );
  3450         booleanParam.SetBoolean( EFalse );
  4311         }
  3451         }
  4312     NumberEntryManagerL()->SetNumberEntryVisibilityL( booleanParam );
  3452     NumberEntryManagerL()->SetNumberEntryVisibilityL( booleanParam );
  4313     }
  3453     }
  4314 
  3454 
  4315 // ---------------------------------------------------------
       
  4316 // CPhoneState::HandleCreateNumberEntryL
       
  4317 // ---------------------------------------------------------
       
  4318 //
       
  4319 EXPORT_C void CPhoneState::HandleCreateNumberEntryL(
       
  4320         const TKeyEvent& /*aKeyEvent*/,
       
  4321         TEventCode /*aEventCode*/ )
       
  4322     {
       
  4323     NumberEntryManagerL()->HandleCreateNumberEntryL();
       
  4324     }
       
  4325 
       
  4326 // -----------------------------------------------------------
  3455 // -----------------------------------------------------------
  4327 // CPhoneState::IsNumberEntryContentStored
  3456 // CPhoneState::IsNumberEntryContentStored
  4328 // -----------------------------------------------------------
  3457 // -----------------------------------------------------------
  4329 //
  3458 //
  4330 EXPORT_C TBool CPhoneState::IsNumberEntryContentStored()
  3459 EXPORT_C TBool CPhoneState::IsNumberEntryContentStored()
  4342     {
  3471     {
  4343     NumberEntryManagerL()->StoreNumberEntryContentL();
  3472     NumberEntryManagerL()->StoreNumberEntryContentL();
  4344     }
  3473     }
  4345 
  3474 
  4346 // -----------------------------------------------------------
  3475 // -----------------------------------------------------------
  4347 // CPhoneState::RestoreNumberEntryContentL
       
  4348 // -----------------------------------------------------------
       
  4349 //
       
  4350 EXPORT_C void CPhoneState::RestoreNumberEntryContentL()
       
  4351     {
       
  4352     NumberEntryManagerL()->RestoreNumberEntryContentL();
       
  4353     }
       
  4354 
       
  4355 // -----------------------------------------------------------
       
  4356 // CPhoneState::ClearNumberEntryContentCache
  3476 // CPhoneState::ClearNumberEntryContentCache
  4357 // -----------------------------------------------------------
  3477 // -----------------------------------------------------------
  4358 //
  3478 //
  4359 EXPORT_C void CPhoneState::ClearNumberEntryContentCache()
  3479 EXPORT_C void CPhoneState::ClearNumberEntryContentCache()
  4360     {
  3480     {
  4361     TRAP_IGNORE( NumberEntryManagerL()->ClearNumberEntryContentCache() );
  3481     TRAP_IGNORE( NumberEntryManagerL()->ClearNumberEntryContentCache() );
  4362     }
       
  4363 
       
  4364 // -----------------------------------------------------------
       
  4365 // CPhoneState::HandleNumberEntryEdited
       
  4366 // -----------------------------------------------------------
       
  4367 //
       
  4368 EXPORT_C void CPhoneState::HandleNumberEntryEdited()
       
  4369     {
       
  4370     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleNumberEntryEdited() ");
       
  4371     TRAP_IGNORE( NumberEntryManagerL()->HandleNumberEntryEdited() );
       
  4372     }
  3482     }
  4373 
  3483 
  4374 // -----------------------------------------------------------------------------
  3484 // -----------------------------------------------------------------------------
  4375 // CPhoneState::IsAlphanumericSupportedAndCharInput
  3485 // CPhoneState::IsAlphanumericSupportedAndCharInput
  4376 // -----------------------------------------------------------------------------
  3486 // -----------------------------------------------------------------------------
  4400 // -----------------------------------------------------------
  3510 // -----------------------------------------------------------
  4401 //
  3511 //
  4402 void CPhoneState::NumberEntryClearL()
  3512 void CPhoneState::NumberEntryClearL()
  4403     {
  3513     {
  4404     NumberEntryManagerL()->NumberEntryClearL();
  3514     NumberEntryManagerL()->NumberEntryClearL();
  4405     }
       
  4406     
       
  4407 // -----------------------------------------------------------
       
  4408 // CPhoneState::UpdateSilenceButtonDimming
       
  4409 // -----------------------------------------------------------
       
  4410 //
       
  4411 EXPORT_C void CPhoneState::UpdateSilenceButtonDimming()
       
  4412     {
       
  4413     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
       
  4414         {
       
  4415         const TProfileRingingType ringingType =
       
  4416             iStateMachine->PhoneEngineInfo()->RingingType();
       
  4417         
       
  4418         TBool callIsAlerting =
       
  4419                 !(( ringingType == EProfileRingingTypeSilent ) ||
       
  4420                   ( ringingType == EProfileRingingTypeBeepOnce ));
       
  4421 
       
  4422         if ( !callIsAlerting )
       
  4423             {
       
  4424             SetTouchPaneButtonDisabled( EPhoneCallComingCmdSilent );
       
  4425             }
       
  4426         }
       
  4427     }
  3515     }
  4428 
  3516 
  4429 // -----------------------------------------------------------
  3517 // -----------------------------------------------------------
  4430 // CPhoneState::GetBlockedKeyList
  3518 // CPhoneState::GetBlockedKeyList
  4431 // -----------------------------------------------------------
  3519 // -----------------------------------------------------------
  4624             // Reset blocked keys list
  3712             // Reset blocked keys list
  4625             iStateMachine->PhoneStorage()->ResetBlockedKeysList();
  3713             iStateMachine->PhoneStorage()->ResetBlockedKeysList();
  4626             }
  3714             }
  4627         }
  3715         }
  4628     }
  3716     }
  4629     
       
  4630 // ---------------------------------------------------------
       
  4631 // CPhoneState::SetToolbarDimming
       
  4632 // ---------------------------------------------------------
       
  4633 //
       
  4634 EXPORT_C void CPhoneState::SetToolbarDimming( TBool aDimmed )
       
  4635     {
       
  4636     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
       
  4637         {
       
  4638         TPhoneCmdParamBoolean booleanParam;
       
  4639         booleanParam.SetBoolean( aDimmed );
       
  4640         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
       
  4641             EPhoneViewSetToolbarDimming, &booleanParam ));
       
  4642         }
       
  4643     }
       
  4644 
  3717 
  4645 // ---------------------------------------------------------
  3718 // ---------------------------------------------------------
  4646 // CPhoneState::SetToolbarButtonLoudspeakerEnabled
  3719 // CPhoneState::SetToolbarButtonLoudspeakerEnabled
  4647 // ---------------------------------------------------------
  3720 // ---------------------------------------------------------
  4648 //
  3721 //
  4656             EPhoneViewEnableToolbarButton, &integerParam ));
  3729             EPhoneViewEnableToolbarButton, &integerParam ));
  4657         }
  3730         }
  4658     }
  3731     }
  4659 
  3732 
  4660 // ---------------------------------------------------------
  3733 // ---------------------------------------------------------
  4661 // CPhoneState::SetToolbarDimming
  3734 // CPhoneState::SetBackButtonActive
  4662 // ---------------------------------------------------------
  3735 // ---------------------------------------------------------
  4663 //
  3736 //
  4664 EXPORT_C void CPhoneState::SetBackButtonActive( TBool aActive )
  3737 EXPORT_C void CPhoneState::SetBackButtonActive( TBool aActive )
  4665     {
  3738     {
  4666     if(IsAutoLockOn() && aActive) {
  3739     if(IsAutoLockOn() && aActive) {