fep/aknfep/src/AknFepPluginManager.cpp
branchRCL_3
changeset 50 5a1685599b76
parent 46 bd83ceabce89
child 56 8152b1f1763a
equal deleted inserted replaced
46:bd83ceabce89 50:5a1685599b76
   219     iCurrentPluginInputFepUI = NULL; // why not delete????
   219     iCurrentPluginInputFepUI = NULL; // why not delete????
   220     delete iPenInputMenu;
   220     delete iPenInputMenu;
   221     
   221     
   222     if( iPenInputSvrConnected )
   222     if( iPenInputSvrConnected )
   223         {
   223         {
       
   224         iPenInputServer.RemovePenUiActivationHandler( this );
   224         iPenInputServer.Close();
   225         iPenInputServer.Close();
   225         iPenInputSvrConnected = EFalse;
   226         iPenInputSvrConnected = EFalse;
   226         }
   227         }
   227     delete iFingerItutChineseUI;
   228     delete iFingerItutChineseUI;
   228     
   229     
   529             case ESignalHwNotifySctPopup:
   530             case ESignalHwNotifySctPopup:
   530                 iFepMan.LaunchSpecialCharacterTableL( 0,ETrue );//possible?
   531                 iFepMan.LaunchSpecialCharacterTableL( 0,ETrue );//possible?
   531                 break;  
   532                 break;  
   532             case ESignalChangeAmPm:
   533             case ESignalChangeAmPm:
   533                 {
   534                 {
   534                 iFepMan.ChangeMfneAmPm();
   535                 iFepMan.ChangeMfneAmPmL();
   535                 }
   536                 }
   536                 break;
   537                 break;
   537             case ESignalSetAppEditorCursor:
   538             case ESignalSetAppEditorCursor:
   538                 {
   539                 {
   539                 TInt8 *ptrData = (TInt8* )(pBuf.Ptr());
   540                 TInt8 *ptrData = (TInt8* )(pBuf.Ptr());
  1004             break;
  1005             break;
  1005         case EPluginForegroundChanged:
  1006         case EPluginForegroundChanged:
  1006             {
  1007             {
  1007             iForegroundChange = ETrue;   
  1008             iForegroundChange = ETrue;   
  1008             iLaunchHelp = EFalse;    
  1009             iLaunchHelp = EFalse;    
       
  1010 
       
  1011             // Remove pen ui activation observer
       
  1012             if (iPenInputSvrConnected && !aEventData )
       
  1013                 {
       
  1014                 iPenInputServer.RemovePenUiActivationHandler( this );
       
  1015                 }            
  1009             
  1016             
  1010             if (!aEventData && IsInGlobleNoteEditor())
  1017             if (!aEventData && IsInGlobleNoteEditor())
  1011                 {
  1018                 {
  1012                 ClosePluginInputUiL(ETrue);
  1019                 ClosePluginInputUiL(ETrue);
  1013                 if(iPenInputSvrConnected ) //lost foreground
  1020                 if(iPenInputSvrConnected ) //lost foreground
  1400                 iAvkonAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape );
  1407                 iAvkonAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape );
  1401                 iOrientationChanged = ETrue;                
  1408                 iOrientationChanged = ETrue;                
  1402                 }
  1409                 }
  1403             }
  1410             }
  1404         }
  1411         }
       
  1412     else if( aSuggestMode == EPluginInputModePortraitFSQ  )
       
  1413     	{
       
  1414 		// If current input languge is Chinese or Korean, use EPluginInputModeItut instead.
       
  1415 		if ( iPortraitFSQEnabled && 
       
  1416 				( iFepMan.IsChineseInputLanguage() || iFepMan.IsKoreanInputLanguage() ))
       
  1417 			{
       
  1418 			  aSuggestMode = EPluginInputModeItut;
       
  1419 			}
       
  1420     	}
  1405     else if ( iOrientationChanged )
  1421     else if ( iOrientationChanged )
  1406         {
  1422         {
  1407         iFepMan.SetNotifyPlugin( EFalse );
  1423         iFepMan.SetNotifyPlugin( EFalse );
  1408         iAvkonAppUi->SetOrientationL( (CAknAppUiBase::TAppUiOrientation)iDefaultOrientation );
  1424         iAvkonAppUi->SetOrientationL( (CAknAppUiBase::TAppUiOrientation)iDefaultOrientation );
  1409         iFepMan.SetNotifyPlugin( ETrue );
  1425         iFepMan.SetNotifyPlugin( ETrue );
  1410         iOrientationChanged = EFalse;
  1426         iOrientationChanged = EFalse;
  1411         }
  1427         }
       
  1428     
       
  1429     // Add pen ui activation observer
       
  1430     iPenInputServer.AddPenUiActivationHandler( this, EPluginInputModeAll );    
  1412     
  1431     
  1413     TBool isSplit = IsEditorSupportSplitIme();
  1432     TBool isSplit = IsEditorSupportSplitIme();
  1414     TInt inputLang = iFepMan.InputLanguageCapabilities().iInputLanguageCode;
  1433     TInt inputLang = iFepMan.InputLanguageCapabilities().iInputLanguageCode;
  1415     // temp code for Chinese split view
  1434     // temp code for Chinese split view
  1416     if ( inputLang == ELangPrcChinese || 
  1435     if ( inputLang == ELangPrcChinese || 
  1591 // (other items were commented in a header).
  1610 // (other items were commented in a header).
  1592 // -----------------------------------------------------------------------------
  1611 // -----------------------------------------------------------------------------
  1593 //
  1612 //
  1594 void CAknFepPluginManager::ClosePluginInputUiL(TBool aResetState)
  1613 void CAknFepPluginManager::ClosePluginInputUiL(TBool aResetState)
  1595     {
  1614     {
       
  1615     iInitiateCloseInputUi = ETrue;
       
  1616     
  1596     // For addition of ITI features on FSQ, 
  1617     // For addition of ITI features on FSQ, 
  1597     // need to restore some values stored before opening FSQ    
  1618     // need to restore some values stored before opening FSQ    
  1598     
  1619     
  1599     iConnectAo->Cancel();
  1620     iConnectAo->Cancel();
  1600     ResetItiStateL();
  1621     ResetItiStateL();
  1615                 //iCurrentPluginInputFepUI->HandleCommandL(ECmdPeninputDisableLayoutDrawing,ETrue);
  1636                 //iCurrentPluginInputFepUI->HandleCommandL(ECmdPeninputDisableLayoutDrawing,ETrue);
  1616                 return; //don't close the UI if this is caused by removing spell editor
  1637                 return; //don't close the UI if this is caused by removing spell editor
  1617                 }
  1638                 }
  1618             else
  1639             else
  1619                 {
  1640                 {
       
  1641                 NotifyAppUiImeTouchWndStateL( EFalse ); //this change is under testing 
  1620                 iCurrentPluginInputFepUI->CloseUI();
  1642                 iCurrentPluginInputFepUI->CloseUI();
  1621                 }
  1643                 }
  1622             if( aResetState )
  1644             if( aResetState )
  1623                 {
  1645                 {
  1624                 iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputWindowClose);
  1646                 iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputWindowClose);
  1657         TRAP_IGNORE( iAvkonAppUi->SetOrientationL( (CAknAppUiBase::TAppUiOrientation)iDefaultOrientation ) );
  1679         TRAP_IGNORE( iAvkonAppUi->SetOrientationL( (CAknAppUiBase::TAppUiOrientation)iDefaultOrientation ) );
  1658         iOrientationChanged = EFalse;
  1680         iOrientationChanged = EFalse;
  1659         } 
  1681         } 
  1660         
  1682         
  1661     // Notify editor the touch window has been closed
  1683     // Notify editor the touch window has been closed
  1662     NotifyAppUiImeTouchWndStateL( EFalse );
  1684     //NotifyAppUiImeTouchWndStateL( EFalse );//this change is under testing
  1663     
  1685     
  1664     iCharStartPostion = KInvalidValue;
  1686     iCharStartPostion = KInvalidValue;
  1665     
  1687     
  1666     // Set the KAknFepTouchInputActive PS to 0, 
  1688     // Set the KAknFepTouchInputActive PS to 0, 
  1667     // it means that touch input is inactive now.
  1689     // it means that touch input is inactive now.
  1668     RProperty::Set( KPSUidAknFep, KAknFepTouchInputActive, 0 );
  1690     RProperty::Set( KPSUidAknFep, KAknFepTouchInputActive, 0 );
       
  1691     
       
  1692     iInitiateCloseInputUi = EFalse;    
  1669     }
  1693     }
  1670 
  1694 
  1671 // ---------------------------------------------------------------------------
  1695 // ---------------------------------------------------------------------------
  1672 // CAknFepPluginManager::OnResourceChangedL
  1696 // CAknFepPluginManager::OnResourceChangedL
  1673 // (other items were commented in a header)
  1697 // (other items were commented in a header)
  1872                     {
  1896                     {
  1873                     ProcessChangingInputModeCmdL(EPluginInputModeItut);
  1897                     ProcessChangingInputModeCmdL(EPluginInputModeItut);
  1874                     }
  1898                     }
  1875                     break;
  1899                     break;
  1876                 case EPeninputCmdFSQ:
  1900                 case EPeninputCmdFSQ:
       
  1901                 	{
       
  1902                 	if ( iPortraitFSQEnabled )
       
  1903                 		{
       
  1904                         TPixelsTwipsAndRotation size; 
       
  1905                         CCoeEnv::Static()->ScreenDevice()->GetDefaultScreenSizeAndRotation(size);
       
  1906                         TBool landscape = size.iPixelSize.iWidth > size.iPixelSize.iHeight;
       
  1907                         ProcessChangingInputModeCmdL( landscape ? EPluginInputModeFSQ : EPluginInputModePortraitFSQ );
       
  1908                 		}
       
  1909                 	else
       
  1910                 		{
       
  1911                 	    ProcessChangingInputModeCmdL(EPluginInputModeFSQ);
       
  1912                 		}
       
  1913                 	}
       
  1914                 	break;
  1877                 // "Edit portrait" menu - switch to portrait FSQ
  1915                 // "Edit portrait" menu - switch to portrait FSQ
  1878                 case EPeninputCmdPortraitEditor:
  1916                 case EPeninputCmdPortraitEditor:
  1879                     {
  1917                     {
  1880                     if ( iPortraitFSQEnabled )
  1918                     ProcessChangingInputModeCmdL(EPluginInputModePortraitFSQ);          
  1881                         {
  1919                     }
  1882                         ProcessChangingInputModeCmdL(EPluginInputModePortraitFSQ);          
       
  1883                         }
       
  1884                     else 
       
  1885                         {
       
  1886                         ProcessChangingInputModeCmdL(EPluginInputModeFSQ);
       
  1887                         }
       
  1888                     }
       
  1889 
       
  1890                     break;
  1920                     break;
  1891                 // "Edit landscape" menu - switch to landscape FSQ
  1921                 // "Edit landscape" menu - switch to landscape FSQ
  1892                 case EPeninputCmdLandscapeEditor:
  1922                 case EPeninputCmdLandscapeEditor:
  1893 
  1923 
  1894                     {
  1924                     {
  2293     // "QWERTY keyboard" - EPeninputCmdFSQ menu
  2323     // "QWERTY keyboard" - EPeninputCmdFSQ menu
  2294     if ( iPortraitFSQEnabled )
  2324     if ( iPortraitFSQEnabled )
  2295         {
  2325         {
  2296         // "QWERTY keyboard" - EPeninputCmdFSQ menu is shown in these conditions
  2326         // "QWERTY keyboard" - EPeninputCmdFSQ menu is shown in these conditions
  2297         // if portrait FSQ feature flag is enabled
  2327         // if portrait FSQ feature flag is enabled
  2298         // 1) Non-Chinese language
  2328         if ( !isKorean && !isChinese )
  2299         // 2) Current input mode is not portrait FSQ and also the mode is not disabled
  2329         	{
  2300         // 3) Current orientation is portrait
  2330             // 1) Non-Chinese language and non-Korean language   
  2301         if ( !isKorean && !isChinese
  2331             if ( isPortrait )
  2302             && ( curInputMode != EPluginInputModePortraitFSQ ) 
  2332             	{
  2303             && !( disabledInputMode & EPluginInputModePortraitFSQ ) 
  2333                 // 2) On portrait screen, current input mode is not portrait FSQ 
  2304             && isPortrait )
  2334                 //    and also the mode is not disabled
  2305         {
  2335                 if ( curInputMode != EPluginInputModePortraitFSQ 
  2306         aMenuPane->SetItemDimmed( EPeninputCmdFSQ, EFalse );
  2336                 	 && !( disabledInputMode & EPluginInputModePortraitFSQ ) )
  2307         }
  2337                 	{
  2308         
  2338                     aMenuPane->SetItemDimmed( EPeninputCmdFSQ, EFalse );
       
  2339                 	}                	
       
  2340             	}
       
  2341             else
       
  2342             	{
       
  2343                 // 3) On landscape screen, current input mode is not FSQ 
       
  2344                 // and also the mode is not disabled
       
  2345                 if ( curInputMode != EPluginInputModeFSQ 
       
  2346                    	 && !( disabledInputMode & EPluginInputModeFSQ ) )
       
  2347                 	{
       
  2348                     aMenuPane->SetItemDimmed( EPeninputCmdFSQ, EFalse );
       
  2349                 	}
       
  2350             	}        
       
  2351         	}
  2309         }
  2352         }
  2310     else
  2353     else
  2311         {
  2354         {
  2312         if ( !isKorean && !isChinese && ( curInputMode != EPluginInputModeFSQ ) 
  2355         if ( !isKorean && !isChinese && ( curInputMode != EPluginInputModeFSQ ) 
  2313             && !( disabledInputMode & EPluginInputModeFSQ ) 
  2356             && !( disabledInputMode & EPluginInputModeFSQ ) 
  6055               // default range couldn't be accent. 
  6098               // default range couldn't be accent. 
  6056               || !iPluginPrimaryRange )
  6099               || !iPluginPrimaryRange )
  6057          && iFepMan.InputLanguageCapabilities().iSupportsWesternQwertyPredictive
  6100          && iFepMan.InputLanguageCapabilities().iSupportsWesternQwertyPredictive
  6058          && !iSharedData.QwertyInputMode()
  6101          && !iSharedData.QwertyInputMode()
  6059          // No need to support in dialer application.
  6102          // No need to support in dialer application.
  6060          && RProcess().SecureId().iId != KPhoneSecureId )
  6103          && RProcess().SecureId().iId != KPhoneSecureId && 
       
  6104          !iFepMan.IsNoT9Editor() )
  6061         {
  6105         {
  6062         return ETrue;
  6106         return ETrue;
  6063         }        
  6107         }        
  6064 #endif
  6108 #endif
  6065     return EFalse;
  6109     return EFalse;
  6508                                     ERangeInvalid);
  6552                                     ERangeInvalid);
  6509     iCurMFNECap = 0;
  6553     iCurMFNECap = 0;
  6510     iCurEditor = NULL;
  6554     iCurEditor = NULL;
  6511     }
  6555     }
  6512 
  6556 
       
  6557 // -----------------------------------------------------------------------------
       
  6558 // CAknFepPluginManager::OnPeninputUiDeactivated
       
  6559 // Called when pen input UI is about to be closed
       
  6560 // -----------------------------------------------------------------------------
       
  6561 //
       
  6562 void CAknFepPluginManager::OnPeninputUiDeactivated()
       
  6563     {
       
  6564     if( !iInitiateCloseInputUi )
       
  6565         {
       
  6566         TRAP_IGNORE( ClosePluginInputUiL( ETrue ) );
       
  6567         }
       
  6568     }
       
  6569 
       
  6570 // -----------------------------------------------------------------------------
       
  6571 // CAknFepPluginManager::OnPeninputUiActivated
       
  6572 // Called when pen input UI is about to be open
       
  6573 // -----------------------------------------------------------------------------
       
  6574 //
       
  6575 void CAknFepPluginManager::OnPeninputUiActivated()
       
  6576     {
       
  6577     }
       
  6578 
       
  6579 
  6513 CConnectAo::CConnectAo(CAknFepPluginManager* aClient) 
  6580 CConnectAo::CConnectAo(CAknFepPluginManager* aClient) 
  6514                 : CActive(CActive::EPriorityStandard),
  6581                 : CActive(CActive::EPriorityStandard),
  6515                   iClient(aClient)
  6582                   iClient(aClient)
  6516     {
  6583     {
  6517     CActiveScheduler::Add(this);
  6584     CActiveScheduler::Add(this);