emailuis/emailui/src/ncscomposeviewcontainer.cpp
branchRCL_3
changeset 61 dcf0eedfc1a3
parent 26 67369d1b217f
equal deleted inserted replaced
60:d620048b4810 61:dcf0eedfc1a3
   272 //
   272 //
   273 void CNcsComposeViewContainer::HandlePointerEventL( 
   273 void CNcsComposeViewContainer::HandlePointerEventL( 
   274         const TPointerEvent& aPointerEvent )
   274         const TPointerEvent& aPointerEvent )
   275     {
   275     {
   276     FUNC_LOG;
   276     FUNC_LOG;
       
   277 	TBool clearSelection(EFalse);
   277     if ( aPointerEvent.iType != TPointerEvent::EButton1Down &&
   278     if ( aPointerEvent.iType != TPointerEvent::EButton1Down &&
   278          iHeader->NeedsLongTapL( aPointerEvent.iPosition ) )
   279          iHeader->NeedsLongTapL( aPointerEvent.iPosition ) )
   279         {
   280         {
   280     	iLongTapDetector->PointerEventL( aPointerEvent );
   281     	iLongTapDetector->PointerEventL( aPointerEvent );
   281         }
   282         }
   350                     iFocused = iMessageField;
   351                     iFocused = iMessageField;
   351                     iMessageField->SetFocus( ETrue, ENoDrawNow );
   352                     iMessageField->SetFocus( ETrue, ENoDrawNow );
   352                     }
   353                     }
   353                 else
   354                 else
   354                     {
   355                     {
   355                     iMessageField->ClearSelectionL();
   356 				    // Changes made in predictive input mode can be approved
       
   357 					// only if ClearSelection is called AFTER
       
   358 					// CCoeControl::HandlePointerEventL,
       
   359 					// so iMessageField->ClearSelection() has been moved
       
   360 					clearSelection = ETrue;
   356                     }
   361                     }
   357                 }
   362                 }
   358 
   363 
   359 			break;
   364 			break;
   360     		}
   365     		}
   441         {
   446         {
   442         iLongTapDetector->PointerEventL( aPointerEvent );
   447         iLongTapDetector->PointerEventL( aPointerEvent );
   443         }
   448         }
   444 
   449 
   445     CCoeControl::HandlePointerEventL( aPointerEvent );
   450     CCoeControl::HandlePointerEventL( aPointerEvent );
       
   451 	if (clearSelection)
       
   452 		{
       
   453 		iMessageField->ClearSelectionL();
       
   454 		}
   446     }
   455     }
   447 
   456 
   448 // -----------------------------------------------------------------------------
   457 // -----------------------------------------------------------------------------
   449 // CNcsComposeViewContainer::OfferKeyEventL()
   458 // CNcsComposeViewContainer::OfferKeyEventL()
   450 // Handles key events
   459 // Handles key events
   761     // do not used stored headerLineCount, because relayout above may grow or
   770     // do not used stored headerLineCount, because relayout above may grow or
   762     // shrink edit fields
   771     // shrink edit fields
   763     NcsUtility::LayoutBodyEdwin( 
   772     NcsUtility::LayoutBodyEdwin( 
   764             iMessageField, cmailPaneRect, iHeader->LayoutLineCount(), 
   773             iMessageField, cmailPaneRect, iHeader->LayoutLineCount(), 
   765             iMessageField->LineCount(), iSeparatorLineYPos );
   774             iMessageField->LineCount(), iSeparatorLineYPos );
       
   775     iMessageField->SetAlignment( EAknEditorAlignBidi );
   766     
   776     
   767     // we don't need format again when format was already done
   777     // we don't need format again when format was already done
   768     // during creation of forward/reply message
   778     // during creation of forward/reply message
   769     if ( !iSwitchOffFormattingText )
   779     if ( !iSwitchOffFormattingText )
   770         {
   780         {
   779         TInt dummySeparatorPos;
   789         TInt dummySeparatorPos;
   780         NcsUtility::LayoutBodyEdwin(
   790         NcsUtility::LayoutBodyEdwin(
   781                 iReadOnlyQuoteField, cmailPaneRect, 
   791                 iReadOnlyQuoteField, cmailPaneRect, 
   782                 iHeader->LayoutLineCount() + iMessageField->LineCount(), 
   792                 iHeader->LayoutLineCount() + iMessageField->LineCount(), 
   783                 iReadOnlyQuoteField->LineCount(), dummySeparatorPos );
   793                 iReadOnlyQuoteField->LineCount(), dummySeparatorPos );
       
   794         iReadOnlyQuoteField->SetAlignment( EAknEditorAlignBidi );
   784         // we don't need format again when format was already done
   795         // we don't need format again when format was already done
   785 		// during creation of forward/reply message
   796 		// during creation of forward/reply message
   786         if ( !iSwitchOffFormattingText )
   797         if ( !iSwitchOffFormattingText )
   787             {
   798             {
   788             TRAP_IGNORE( iReadOnlyQuoteField->FormatAllTextNowL() );
   799             TRAP_IGNORE( iReadOnlyQuoteField->FormatAllTextNowL() );
   950             {
   961             {
   951 			TInt dummySeparatorPos;
   962 			TInt dummySeparatorPos;
   952 			NcsUtility::LayoutBodyEdwin( iReadOnlyQuoteField, iCmailPaneRect, 
   963 			NcsUtility::LayoutBodyEdwin( iReadOnlyQuoteField, iCmailPaneRect, 
   953 					iHeader->LayoutLineCount() + iMessageField->LineCount(),
   964 					iHeader->LayoutLineCount() + iMessageField->LineCount(),
   954 					iReadOnlyQuoteField->LineCount(), dummySeparatorPos );
   965 					iReadOnlyQuoteField->LineCount(), dummySeparatorPos );
   955 	
   966             iReadOnlyQuoteField->SetAlignment( EAknEditorAlignBidi );
       
   967             
   956 			RMemReadStream inputStream;
   968 			RMemReadStream inputStream;
   957             inputStream.Open( iReadOnlyQuote->Ptr(), iReadOnlyQuote->Size() );
   969             inputStream.Open( iReadOnlyQuote->Ptr(), iReadOnlyQuote->Size() );
   958             TRAP_IGNORE( iReadOnlyQuoteField->RichText()->ImportTextL( 0, inputStream,
   970             TRAP_IGNORE( iReadOnlyQuoteField->RichText()->ImportTextL( 0, inputStream,
   959                     CPlainText::EOrganiseByParagraph ) );
   971                     CPlainText::EOrganiseByParagraph ) );
   960             inputStream.Close();
   972             inputStream.Close();