textinput/peninputarc/src/peninputserverapp/peninputserver.cpp
branchRCL_3
changeset 19 ac7e4d1d9209
parent 18 b1ea1642412e
child 20 ebd48d2de13c
equal deleted inserted replaced
18:b1ea1642412e 19:ac7e4d1d9209
    55 const TInt KMsgQueueLen = 1000;
    55 const TInt KMsgQueueLen = 1000;
    56 const TInt KMsgResponseQueueLen = 10;
    56 const TInt KMsgResponseQueueLen = 10;
    57 
    57 
    58 const TInt KWsSessionFlushPerioid = 50000;//50ms
    58 const TInt KWsSessionFlushPerioid = 50000;//50ms
    59 const TInt KInvalidValue = -1;
    59 const TInt KInvalidValue = -1;
       
    60 // Layout UID for portrait FSQ.  Used for distinguish between 
       
    61 // landscape and portrait FSQ for EPluginInputModeFSQ, which 
       
    62 // is used for both orientation in Pen Input server side code.
       
    63 const TInt KPenInputSrvPrtFsqUiId = 0x20026837;
       
    64 
    60 
    65 
    61 enum TActivationFlag
    66 enum TActivationFlag
    62 	{
    67 	{
    63 	ECmdDeactivate = EFalse,
    68 	ECmdDeactivate = EFalse,
    64 	ECmdActivate = ETrue,
    69 	ECmdActivate = ETrue,
   441     	{
   446     	{
   442         return;
   447         return;
   443     	}
   448     	}
   444     
   449     
   445     // we should not be able to activate and show pen ui if this mode is disabled currently
   450     // we should not be able to activate and show pen ui if this mode is disabled currently
   446     if(iUiLayout->PenInputType() & DisabledByOrientation())
   451     TInt inputType = iUiLayout->PenInputType();
       
   452     if( inputType == EPluginInputModeFSQ && iLayoutId.iUid == KPenInputSrvPrtFsqUiId )
       
   453         {
       
   454         inputType = EPluginInputModePortraitFSQ;
       
   455         }
       
   456     if( inputType & DisabledByOrientation() )
       
   457 
   447         {
   458         {
   448         // we have activate the animation otherwise we will see the penui but not reponse
   459         // we have activate the animation otherwise we will see the penui but not reponse
   449         // when clicking on it in the case we rotating the screen quickly and continously
   460         // when clicking on it in the case we rotating the screen quickly and continously
   450         if(iAnimObj)
   461         if(iAnimObj)
   451             {
   462             {
   557     if(!iUiLayout)
   568     if(!iUiLayout)
   558         return;
   569         return;
   559     
   570     
   560     // [[[ temporary solution for Virtual keyboard becomes corrupted after several rotations
   571     // [[[ temporary solution for Virtual keyboard becomes corrupted after several rotations
   561     // we should not be able to activate and show pen ui if this mode is disabled currently
   572     // we should not be able to activate and show pen ui if this mode is disabled currently
   562     if(iUiLayout->PenInputType() & DisabledByOrientation())
   573     TInt inputType = iUiLayout->PenInputType();
       
   574     if( inputType == EPluginInputModeFSQ && iLayoutId.iUid == KPenInputSrvPrtFsqUiId )
       
   575         {
       
   576         inputType = EPluginInputModePortraitFSQ;
       
   577         }
       
   578     if( inputType & DisabledByOrientation() )
   563         {
   579         {
   564         // we have activate the animation otherwise we will see the penui but not reponse 
   580         // we have activate the animation otherwise we will see the penui but not reponse 
   565         // when clicking on it in the case we rotating the screen quickly and continously
   581         // when clicking on it in the case we rotating the screen quickly and continously
   566         if(iAnimObj)
   582         if(iAnimObj)
   567             {
   583             {
  2106 // Handle application resource change
  2122 // Handle application resource change
  2107 // ---------------------------------------------------------------------------
  2123 // ---------------------------------------------------------------------------
  2108 //    
  2124 //    
  2109 void CPeninputServer::HandleResourceChange(TInt aType)
  2125 void CPeninputServer::HandleResourceChange(TInt aType)
  2110     {
  2126     {
       
  2127 	// Update the cursor color when resource is changed
       
  2128 	iPenUiCtrl->SetCursorColor();
       
  2129 	
  2111 	#ifdef FIX_FOR_NGA 
  2130 	#ifdef FIX_FOR_NGA 
  2112 	// iEnablePriorityChangeOnOriChange will be set to be EFalse, if some dialog in FEP end were opened and 
  2131 	// iEnablePriorityChangeOnOriChange will be set to be EFalse, if some dialog in FEP end were opened and 
  2113 	// not close after rotation for example: Symbol Table, Writing Language list and Match Dialog on ITI
  2132 	// not close after rotation for example: Symbol Table, Writing Language list and Match Dialog on ITI
  2114 	if(iUiLayout && iActive && iEnablePriorityChangeOnOriChange && aType == KEikDynamicLayoutVariantSwitch)
  2133 	if(iUiLayout && iActive && iEnablePriorityChangeOnOriChange && aType == KEikDynamicLayoutVariantSwitch)
  2115         {
  2134         {
  2119         TBool isPortrait = ( size.iPixelSize.iWidth < size.iPixelSize.iHeight );
  2138         TBool isPortrait = ( size.iPixelSize.iWidth < size.iPixelSize.iHeight );
  2120    
  2139    
  2121         TBool needToLiftUp = EFalse;
  2140         TBool needToLiftUp = EFalse;
  2122         TInt inputMode = 0; 
  2141         TInt inputMode = 0; 
  2123         inputMode = iUiLayout->PenInputType();
  2142         inputMode = iUiLayout->PenInputType();
  2124         if(inputMode == EPluginInputModeItut)
  2143         
       
  2144         // If input mode is either ITU-T or portrait FSQ, and if orientation 
       
  2145         // is changed to landscape, highest priority is given to Pen UI to avoid 
       
  2146         // flickering problem while drawing landscape FSQ layout.        
       
  2147         if( inputMode == EPluginInputModeItut ||
       
  2148           ( inputMode == EPluginInputModeFSQ && 
       
  2149             iLayoutId.iUid == KPenInputSrvPrtFsqUiId ) )
  2125             {
  2150             {
  2126             if(!isPortrait)
  2151             if(!isPortrait)
  2127                 {
  2152                 {
  2128                 needToLiftUp = ETrue;
  2153                 needToLiftUp = ETrue;
  2129                 }
  2154                 }
  2153                 iPenUiCtrl->LiftUpPriority();				
  2178                 iPenUiCtrl->LiftUpPriority();				
  2154                 }
  2179                 }
  2155             }
  2180             }
  2156         }
  2181         }
  2157 	#endif	
  2182 	#endif	
  2158     if(iUiLayout && !(iUiLayout->PenInputType() & DisabledByOrientation()) )
  2183     if( iUiLayout )
  2159         {
  2184         {
  2160         //hide the layout if it's already shown
  2185         TInt inputType = iUiLayout->PenInputType();
       
  2186         if( inputType == EPluginInputModeFSQ && iLayoutId.iUid == KPenInputSrvPrtFsqUiId )
       
  2187             {
       
  2188             inputType = EPluginInputModePortraitFSQ;
       
  2189             }
       
  2190         if( !( inputType & DisabledByOrientation() ) )
       
  2191             {
       
  2192             //hide the layout if it's already shown
  2161         
  2193         
  2162         if ( iActive )
  2194             if ( iActive )
  2163             {
  2195                 {
  2164             iUiLayout->OnActivate();  
  2196                 iUiLayout->OnActivate();  
  2165             }  
  2197                 }  
  2166         
  2198         
  2167         iUiLayout->OnResourceChange(aType);
  2199             iUiLayout->OnResourceChange(aType);
  2168         
  2200         
  2169         if(iUseWindowCtrl)
  2201             if(iUseWindowCtrl)
  2170             {
  2202                 {
  2171             iPenUiCtrl->DrawNow();
  2203                 iPenUiCtrl->DrawNow();
       
  2204                 }
  2172             }
  2205             }
  2173             
  2206             
  2174         //show the layout if it's active
  2207         //show the layout if it's active
  2175         }
  2208         }
  2176     }
  2209     }
  2278     if(isArabicFingerInput)
  2311     if(isArabicFingerInput)
  2279         {
  2312         {
  2280         return;
  2313         return;
  2281         }
  2314         }
  2282     
  2315     
  2283 	if(iActive && !iPrevActive && inputMode != EPluginInputModeFSQ && iBackgroudDefaultOri == CAknAppUiBase::EAppUiOrientationUnspecified )
  2316     // Both landscape and portrait FSQs are handled as EPluginInputModeFSQ
       
  2317     // in Pen Input server. iLayoutId can be used to check it's landscape or
       
  2318     // portrait.
       
  2319     TBool isLandscapeFSQ = 
       
  2320         ( inputMode == EPluginInputModeFSQ && 
       
  2321           iLayoutId.iUid != KPenInputSrvPrtFsqUiId )
       
  2322          ? ETrue : EFalse;
       
  2323     
       
  2324     if ( iActive && !iPrevActive && !isLandscapeFSQ && 
       
  2325          iBackgroudDefaultOri == CAknAppUiBase::EAppUiOrientationUnspecified )
  2284         {
  2326         {
  2285         #ifdef FIX_FOR_NGA
  2327         #ifdef FIX_FOR_NGA
  2286         if(inputMode == EPluginInputModeFingerHwr)
  2328         if(inputMode == EPluginInputModeFingerHwr)
  2287             {
  2329             {
  2288             iPrevActive = ETrue;
  2330             iPrevActive = ETrue;
  2891                     {
  2933                     {
  2892                     return disabled |= EPluginInputModeFSQ;
  2934                     return disabled |= EPluginInputModeFSQ;
  2893                     }
  2935                     }
  2894                 if( size.iPixelSize.iWidth > size.iPixelSize.iHeight )
  2936                 if( size.iPixelSize.iWidth > size.iPixelSize.iHeight )
  2895                     {
  2937                     {
  2896                     return disabled |= EPluginInputModeItut;
  2938                     // Portrait input modes which are ITU-T and Portrait FSQ
       
  2939                     // should be disabled in portrait orientation. 
       
  2940                     // Note: no need to check feature flag because if it is not
       
  2941                     // turned on, EPluginInputModePortraitFSQ will not be handled 
       
  2942                     // at all so adding it to "disabled" will take no effect.
       
  2943                     disabled |= EPluginInputModeItut | EPluginInputModePortraitFSQ;
       
  2944 
       
  2945                     return disabled;
  2897                     }
  2946                     }
  2898                 }
  2947                 }
  2899             }
  2948             }
  2900         }
  2949         }
  2901     return disabled;
  2950     return disabled;