uifw/EikStd/coctlsrc/EIKEDWIN.CPP
branchRCL_3
changeset 51 fcdfafb36fe7
parent 50 a1caeb42b3a3
child 55 aecbbf00d063
--- a/uifw/EikStd/coctlsrc/EIKEDWIN.CPP	Thu Jul 15 18:56:19 2010 +0300
+++ b/uifw/EikStd/coctlsrc/EIKEDWIN.CPP	Thu Aug 19 10:11:06 2010 +0300
@@ -3151,11 +3151,15 @@
                 {
                 TRAP_IGNORE( edwinState->ReportAknEdStateEventL( 
                     MAknEdStateObserver::EAknSyncEdwinState ) );
-                if ( edwinState->Flags() & EAknEditorFlagHideTextView )
+                // if text view is already hidden and editor loses focus, display text view.
+				if ( ( edwinState->Flags() & EAknEditorFlagHideTextView ) &&
+                     ( iEdwinExtension && iEdwinExtension->iTextViewHidden ) )
                     {
                     iTextView->MakeVisible( ETrue );
                     edwinState->SetFlags( edwinState->Flags() & 
                         ~EAknEditorFlagHideTextView );
+                    iEdwinExtension->iTextViewHidden = EFalse;                    
+                    DrawDeferred();
                     }
                 }
             else
@@ -8516,18 +8520,42 @@
         TRAP_IGNORE( ReportChinesePopupEventL( chinesePopup == 0 ) );
         }
     
-    if ( iTextView )
-        {
-        if ( ( aNewFlags & EAknEditorFlagHideTextView )
-                && !( aOldFlags & EAknEditorFlagHideTextView ) )
+    // To reduce power consumption, text view should be hidden when full screen Touch
+    // Input is open and editor is covered by it, for user can not see editor in this 
+    // case. When full screen Touch Input is open, FEP will set flag EAknEditorFlagHideTextView 
+    // to notify editor the text view should be hidden. But we have to check if the feature 
+    // of partial screen input is enabled at the same time, for full screen Touch Input window 
+    // will only occupy part of the screen if the feature is eanbled and editor is still visible 
+    // to user. So editor can only be hidden in such situation: full screen Touch Input is open 
+    // and partial screen feature is disabled.
+    // In the contrary situations (full screen touch input is closed or partial screen 
+    // feature is enabled), text view has to be shown so editor can work as normal.
+    if ( iTextView && iEdwinExtension )
+        {
+        TBool textViewHideEnabled( ( aNewFlags & EAknEditorFlagHideTextView ) &&
+            !( aOldFlags & EAknEditorFlagHideTextView ) );
+
+        TBool textViewHideDisabled( !( aNewFlags & EAknEditorFlagHideTextView ) && 
+            ( aOldFlags & EAknEditorFlagHideTextView ) );
+
+        TBool partialScreenEnabled( ( aNewFlags & EAknEditorFlagEnablePartialScreen ) &&
+            !( aOldFlags & EAknEditorFlagEnablePartialScreen ) );
+
+        TBool partialScreenDisabled( !( aNewFlags & EAknEditorFlagEnablePartialScreen ) && 
+            ( aOldFlags & EAknEditorFlagEnablePartialScreen ) );
+         
+        if ( ( textViewHideEnabled && 
+                !( aNewFlags & EAknEditorFlagEnablePartialScreen ) ) ||
+             ( partialScreenDisabled && ( aNewFlags & EAknEditorFlagHideTextView ) ) )
             {
             iTextView->MakeVisible( EFalse );
-            }
-        else if ( ( aOldFlags & EAknEditorFlagTouchInputModeOpened )
-                && !( aNewFlags & EAknEditorFlagTouchInputModeOpened ) )
+            iEdwinExtension->iTextViewHidden = ETrue;
+            }
+        else if ( iEdwinExtension->iTextViewHidden && ( textViewHideDisabled || partialScreenEnabled ) )
             {
             iTextView->MakeVisible( ETrue );
             DrawNow();
+            iEdwinExtension->iTextViewHidden = EFalse;            
             }
         }
     }