fep/aknfep/src/AknFepPluginManager.cpp
branchRCL_3
changeset 29 857bebeecec0
parent 28 6c2c2d3ab788
child 38 b1ea1642412e
equal deleted inserted replaced
28:6c2c2d3ab788 29:857bebeecec0
   825                 iFepMan.CommitInlineEditL();
   825                 iFepMan.CommitInlineEditL();
   826                 SendIcfDataL( EPluginSyncAll );                
   826                 SendIcfDataL( EPluginSyncAll );                
   827 //                OnPenInputServerKeyEventL(pBuf);                
   827 //                OnPenInputServerKeyEventL(pBuf);                
   828                 }
   828                 }
   829                 break;
   829                 break;
       
   830             case ESignalDeactivateSprite:
       
   831             	{
       
   832                 ClosePluginInputUiL( ETrue );
       
   833                 if(iPenInputSvrConnected ) //lost foreground
       
   834                     {
       
   835                     iPenInputServer.LoseForeground();
       
   836                     }
       
   837             	}
       
   838             	break;
   830             default:
   839             default:
   831                 break;
   840                 break;
   832             }
   841             }
   833         }  
   842         }  
   834     return bHandled;
   843     return bHandled;
  1523 // (other items were commented in a header)
  1532 // (other items were commented in a header)
  1524 // ---------------------------------------------------------------------------
  1533 // ---------------------------------------------------------------------------
  1525 // 
  1534 // 
  1526 void CAknFepPluginManager::OnResourceChangedL( TInt aType )
  1535 void CAknFepPluginManager::OnResourceChangedL( TInt aType )
  1527     { 
  1536     { 
  1528     if ( !iCurrentPluginInputFepUI || !iPenInputServer.IsForeground() || 
  1537     if ( !iCurrentPluginInputFepUI 
  1529          iPluginInputMode == EPluginInputModeNone )
  1538     	 || iPluginInputMode == EPluginInputModeNone )
  1530         {
  1539         {
  1531         return;
  1540         return;
  1532         }
  1541         }
  1533         
  1542         
  1534     if ( (iPluginInputMode == EPluginInputModeFSQ || (iPluginInputMode == EPluginInputModeFingerHwr 
  1543     if ( (iPluginInputMode == EPluginInputModeFSQ || (iPluginInputMode == EPluginInputModeFingerHwr 
  1535 	     && iSharedData.InputTextLanguage() == ELangArabic))
  1544 	     && iSharedData.InputTextLanguage() == ELangArabic))
  1536 	     && !iSharedData.AutoRotateEnabled() )
  1545 	     && !iSharedData.AutoRotateEnabled() )
  1537         {
  1546         {
  1538         return;
  1547         return;
  1539         }
  1548         }    
  1540         
  1549 
       
  1550     TInt preInputMode = iPluginInputMode;
       
  1551     if ( iSharedData.AutoRotateEnabled() && 
       
  1552         ( preInputMode == EPluginInputModeFSQ || preInputMode == EPluginInputModeItut ) )
       
  1553         {
       
  1554         // Calculate current input mode by orientation.
       
  1555         // even though peninputserver is brought to backgroud, 
       
  1556         // the value for current input mode also needs to be ready. 
       
  1557         // For example, when open task switcher, pen ui is invisible and peniput server is background, 
       
  1558         // then switch orientation...
       
  1559         // After that when focus go back to editor, config FEP must be done before pen ui open,
       
  1560         // And FEP must know for which kind of input method it configur.        
       
  1561         TPixelsTwipsAndRotation size; 
       
  1562         CCoeEnv::Static()->ScreenDevice()->GetDefaultScreenSizeAndRotation(size);        
       
  1563         iPluginInputMode = ( size.iPixelSize.iWidth < size.iPixelSize.iHeight ) ? 
       
  1564             EPluginInputModeItut : EPluginInputModeFSQ;            
       
  1565         }
       
  1566     
       
  1567     if ( !iPenInputServer.IsForeground() )
       
  1568 	    {
       
  1569 	    return;
       
  1570 	    }
       
  1571 
  1541     TBool setResChange = EFalse;
  1572     TBool setResChange = EFalse;
  1542     
  1573     
  1543     if (iPluginInputMode == EPluginInputModeItut || 
  1574     if ( preInputMode == EPluginInputModeItut || 
  1544          iPluginInputMode == EPluginInputModeFSQ ||
  1575     	 preInputMode == EPluginInputModeFSQ ||
  1545         iPluginInputMode == EPluginInputModeFingerHwr)
  1576     	 preInputMode == EPluginInputModeFingerHwr )
  1546         {
  1577         {
  1547         setResChange = ETrue;
  1578         setResChange = ETrue;
  1548         iPenInputServer.SetResourceChange(ETrue);    
  1579         iPenInputServer.SetResourceChange(ETrue);           
  1549         }
  1580         }
  1550     
  1581     
  1551     iResourceChange = ETrue;   
  1582     iResourceChange = ETrue;   
  1552 
  1583 
  1553     TBool needToChangeInputMode = ETrue;
  1584     TBool needToChangeInputMode = ETrue;
  1554     if ( iSharedData.AutoRotateEnabled() && 
  1585     if ( iSharedData.AutoRotateEnabled() && 
  1555         ( iPluginInputMode == EPluginInputModeFSQ || iPluginInputMode == EPluginInputModeItut ) )
  1586          ( preInputMode == EPluginInputModeFSQ || preInputMode == EPluginInputModeItut ) )
  1556         {
  1587         {
  1557         if ( IsSpellVisible() )
  1588         if ( IsSpellVisible() )
  1558             {
  1589             {
  1559             iFepMan.ExitPluginSpellModeByCancel();
  1590             iFepMan.ExitPluginSpellModeByCancel();
  1560             iFepMan.SetNotifyPlugin( EFalse );
  1591             iFepMan.SetNotifyPlugin( EFalse );
  1561             iFepMan.HandleChangeInFocusForSettingFep();
  1592             iFepMan.HandleChangeInFocusForSettingFep();
  1562             iFepMan.SetNotifyPlugin( ETrue );
  1593             iFepMan.SetNotifyPlugin( ETrue );
  1563             }
  1594             }
  1564         TPixelsTwipsAndRotation size; 
  1595         
  1565         CCoeEnv::Static()->ScreenDevice()->GetDefaultScreenSizeAndRotation(size);
  1596          if ( iPenInputMenu && iPenInputMenu->IsShowing() )
  1566 
  1597              {
  1567         TPluginInputMode inputModeBeforeOri = ( size.iPixelSize.iWidth < size.iPixelSize.iHeight ) ? 
  1598              iPenInputMenu->Hide();
  1568             EPluginInputModeItut : EPluginInputModeFSQ;
  1599              ResetMenuState(EFalse);
  1569         
  1600              }
  1570             if ( iPenInputMenu && iPenInputMenu->IsShowing() )
       
  1571                 {
       
  1572                 iPenInputMenu->Hide();
       
  1573                 ResetMenuState(EFalse);
       
  1574                 }
       
  1575             
  1601             
  1576         if(inputModeBeforeOri != iPluginInputMode)
  1602         if( preInputMode != iPluginInputMode )
  1577             {
  1603             {            
  1578             iPluginInputMode = inputModeBeforeOri; 
  1604             ClosePluginInputModeL(ETrue);
  1579             ClosePluginInputModeL(ETrue);               
       
  1580             iFepMan.TryCloseUiL();
  1605             iFepMan.TryCloseUiL();
  1581             }
  1606             }
  1582         else
  1607         else
  1583             {
  1608             {
  1584             needToChangeInputMode = EFalse;
  1609             needToChangeInputMode = EFalse;
  1589 	    {
  1614 	    {
  1590 		TryChangePluginInputModeByModeL( iPluginInputMode,
  1615 		TryChangePluginInputModeByModeL( iPluginInputMode,
  1591                                      EPenInputOpenManually,
  1616                                      EPenInputOpenManually,
  1592                                      ERangeInvalid ); 
  1617                                      ERangeInvalid ); 
  1593 		}
  1618 		}
       
  1619     else 
       
  1620         {
       
  1621         if ( !NotifyInGlobalNoteEditorL() )
       
  1622             {
       
  1623             iFocuschangedForSpellEditor = EFalse; 
       
  1624             iCurrentPluginInputFepUI->ActivateUI(); 
       
  1625             iNeedFetchDimState = ETrue;
       
  1626             }
       
  1627         }
       
  1628 
  1594     
  1629     
  1595     /*if(size.iPixelSize.iWidth > size.iPixelSize.iHeight ) //landscape
  1630     /*if(size.iPixelSize.iWidth > size.iPixelSize.iHeight ) //landscape
  1596         {
  1631         {
  1597         if ( iPluginInputMode == EPluginInputModeVkb )
  1632         if ( iPluginInputMode == EPluginInputModeVkb )
  1598             {        	
  1633             {