messagingappbase/msgeditor/viewsrc/MsgEditorView.cpp
branchRCL_3
changeset 42 1367103c24e2
parent 28 fbb813aef148
--- a/messagingappbase/msgeditor/viewsrc/MsgEditorView.cpp	Wed Jun 09 09:37:26 2010 +0300
+++ b/messagingappbase/msgeditor/viewsrc/MsgEditorView.cpp	Mon Jun 21 15:36:19 2010 +0300
@@ -93,7 +93,9 @@
     iEditorModeFlags( aEditorModeFlags ),
     iLineHeight( MsgEditorCommons::MsgBaseLineDelta() ),
     iBaseLineOffset( MsgEditorCommons::MsgBaseLineOffset() ),
-    iResourceLoader( *iCoeEnv )
+    iResourceLoader( *iCoeEnv ),
+    iPrevFocus( EMsgNoneFocused ), 
+    iMoveUpDownEvent( EFalse) 
     {
     }
 
@@ -243,11 +245,13 @@
         TInt newFocus = iHeader->FirstFocusableControl( 0, EMsgFocusDown );
         if ( newFocus == KErrNotFound )
             {
+            iPrevFocus = EMsgHeaderFocused; 
             iCurrentFocus = EMsgBodyFocused;
             newFocus = iBody->FirstFocusableControl( 0, EMsgFocusDown );
             
             if ( newFocus == KErrNotFound )
                 {
+				iPrevFocus = EMsgNoneFocused;
                 iCurrentFocus = EMsgNoneFocused;
                 }
             else
@@ -782,7 +786,9 @@
             }
         }
     
+    iMoveUpDownEvent = ETrue; 
     EnsureCorrectFormPosition( ( aKeyEvent.iCode == EKeyDownArrow ) && focusRotated, forceScrollUp );
+    iMoveUpDownEvent = EFalse; 
 
     UpdateScrollBarL();
 
@@ -1764,7 +1770,8 @@
                     iHeader->NotifyControlsForEvent( EMsgViewEventPrepareFocusTransitionDown, 0 ); 
                     }
                 }
-            TMsgFocus previousMsgPart = iCurrentFocus;    
+            TMsgFocus previousMsgPart = iCurrentFocus;
+            iPrevFocus = iCurrentFocus; 
             iCurrentFocus = EMsgBodyFocused;
             
             TInt delta = componentIndex - iBody->CurrentFocus();
@@ -2238,6 +2245,34 @@
         {
         return EFalse;
         }
+    else 
+        {
+        if ( ctrl->ControlType() == EMsgBodyControl 
+             && ctrl->ItemFinder()
+             && ctrl->IsReadOnly()
+             && !iMoveUpDownEvent ) 
+            {
+            TInt countHeader = iHeader->CountMsgControls();
+            for ( TInt i = 0; i < countHeader; i++ )
+                 {
+                 CMsgBaseControl* headerCtrl = iHeader->MsgControl( i );
+                 if ( headerCtrl )
+                     {
+                     TInt controlType;
+                     controlType = headerCtrl->ControlType();
+                     if ( controlType == EMsgAddressControl ||
+                          controlType == EMsgExpandableControl ||
+                          controlType == EMsgAttachmentControl )
+                         {
+                         if ( ControlFullyVisible(headerCtrl) || iPrevFocus == EMsgHeaderFocused )
+                             {
+                             return EFalse; // Ignoring Scroll Event
+                             }
+                         }
+                      }
+                 }
+            }        
+        }
 
     iStateFlags |= EMsgEnsureCorrectFormPositionRequestIssued;
 
@@ -2248,8 +2283,8 @@
 
     if ( lineRect.Height() )
         {
-		if (lineRect.Height() >= iViewRect.Height())
-            {
+        if ( lineRect.iBr.iY > iViewRect.Height() ) 
+           {
             // the view must be scrolled up.
             delta = iViewRect.Height() - lineRect.iBr.iY;
             }