mobilemessaging/mmsui/viewersrc/UniMmsViewerAppUi.cpp
branchRCL_3
changeset 24 696bfeff199e
parent 20 94cccd85bd25
child 25 fa1df4b99609
equal deleted inserted replaced
22:1367103c24e2 24:696bfeff199e
  1175                     }
  1175                     }
  1176                 }
  1176                 }
  1177             
  1177             
  1178             if ( !IsOwnMessage( ) )
  1178             if ( !IsOwnMessage( ) )
  1179                 {    
  1179                 {    
  1180                 if( ( FocusedControlId( ) == EMsgComponentIdFrom) && ( ( iMtm->Sender( ) ).Length() ) 
  1180                 if( ( focusedControl == EMsgComponentIdFrom ) && ( ( iMtm->Sender( ) ).Length() ) 
  1181                       && senderHighlighted )
  1181                       && senderHighlighted )
  1182                     {
  1182                     {
  1183                     iFindItemMenu->SetSenderHighlightStatus( ETrue );
  1183                     iFindItemMenu->SetSenderHighlightStatus( ETrue );
  1184                     iFindItemMenu->SetSenderDisplayText( TMmsGenUtils::PureAddress( iMtm->Sender( ) ) );                
  1184                     iFindItemMenu->SetSenderDisplayText( TMmsGenUtils::PureAddress( iMtm->Sender( ) ) );                
  1185                     }
  1185                     }
  1188                     iFindItemMenu->SetSenderHighlightStatus( EFalse );
  1188                     iFindItemMenu->SetSenderHighlightStatus( EFalse );
  1189 		            }
  1189 		            }
  1190                 }
  1190                 }
  1191             
  1191             
  1192             iFindItemMenu->AddItemFindMenuL( 
  1192             iFindItemMenu->AddItemFindMenuL( 
  1193                 ( iView->ItemFinder() && iView->ItemFinder()->CurrentSelection().Length() ) 
  1193                 ( iView->ItemFinder() && 
  1194                 ? iView->ItemFinder( ) : 0,
  1194                   iView->ItemFinder()->CurrentSelection().Length() ) 
       
  1195                 ? iView->ItemFinder() : 0,
  1195                 aMenuPane, 
  1196                 aMenuPane, 
  1196                 EFindItemMenuPlaceHolder,
  1197                 EFindItemMenuPlaceHolder,
  1197                 senderHighlighted ? 
  1198                 senderHighlighted ? 
  1198                 TMmsGenUtils::PureAddress( iMtm->Sender( ) ) : KNullDesC(),
  1199                 TMmsGenUtils::PureAddress( iMtm->Sender( ) ) : KNullDesC(),
  1199                 iHeader->Alias( ) && !iHeader->IsRemoteAlias( ) ? ETrue : EFalse, //"Is sender known"
  1200                 iHeader->Alias( ) && !iHeader->IsRemoteAlias( ) ? ETrue : EFalse, //"Is sender known"
  1623             }
  1624             }
  1624             break;
  1625             break;
  1625         case EKeyDevice3:       //Selection key
  1626         case EKeyDevice3:       //Selection key
  1626         case EKeyEnter:         //Enter Key
  1627         case EKeyEnter:         //Enter Key
  1627             {                    
  1628             {                    
  1628             if( iView->FocusedControl()->ControlType() == EMsgAddressControl )
  1629             CMsgExpandableControl* ctrl = NULL;
  1629                 {
  1630             TBool checkHighlight = EFalse;
  1630                 CMsgAddressControl* address = static_cast<CMsgAddressControl*>(
  1631             
  1631                     iView->FocusedControl() );
  1632             if( iView->FocusedControl() )
  1632                 if ( address && !address->Editor().SelectionLength() )
  1633                 {
       
  1634                 ctrl = static_cast<CMsgExpandableControl*>( iView->FocusedControl() );
       
  1635                 if ( ctrl->ControlType() == EMsgAddressControl
       
  1636                         && !ctrl->Editor().SelectionLength()  ) 
  1633                     {
  1637                     {
  1634                     // restore highlight to address field
  1638                     checkHighlight = ETrue;
  1635                     return address->Editor().OfferKeyEventL( aKeyEvent, aType );
  1639                     }
  1636                     }               
  1640                 else if ( ctrl->ControlType() == EMsgBodyControl )
  1637                 }
  1641                     {       
  1638             else if ( iView->FocusedControl()->ControlType() == EMsgBodyControl )
  1642                     CItemFinder* itemFinder = iView->ItemFinder();
  1639                 {       
  1643                     if ( FocusedControlId() == EMsgComponentIdBody && itemFinder
  1640                 CItemFinder* itemFinder = iView->ItemFinder();
  1644                             && !itemFinder->CurrentSelection().Length() )
  1641                 if ( FocusedControlId() == EMsgComponentIdBody 
  1645                         {                                                              
  1642                      && itemFinder )
  1646                         checkHighlight = ETrue;
  1643                     {                                                                          
       
  1644                     if ( !itemFinder->CurrentSelection().Length() )
       
  1645                         {
       
  1646                         CMsgBodyControl* body = static_cast<CMsgBodyControl*>(
       
  1647                             iView->FocusedControl() );
       
  1648                         if ( body )
       
  1649                             {                     
       
  1650                              // restore highlight to current itemfinder item
       
  1651                             return body->Editor().OfferKeyEventL( aKeyEvent, aType );
       
  1652                             }
       
  1653                         }
  1647                         }
  1654                     }
  1648                     }
  1655                 }
  1649                 }
  1656             // fall through
  1650             if ( ctrl && checkHighlight )
  1657             } 
  1651                 {
  1658         case EMsgFindItemKeyEvent:
  1652                 // Check if highlight needs to be restored to editor,
  1659             {
  1653                 // address/body editor offerkeyevent will handle it
       
  1654                 if ( ctrl->Editor().OfferKeyEventL( aKeyEvent, aType ) 
       
  1655                         == EKeyWasConsumed )
       
  1656                     {
       
  1657                     // Highlight was restored, just return, no cs menu needed
       
  1658                     return EKeyWasConsumed;
       
  1659                     }
       
  1660                 }
       
  1661 
  1660             TInt focusedControl = FocusedControlId( );
  1662             TInt focusedControl = FocusedControlId( );
  1661             CMsgMediaControl* control = MediaControlById(focusedControl);
  1663             CMsgMediaControl* control = MediaControlById(focusedControl);
  1662             if (control)
  1664             if (control)
  1663                 {
  1665                 {
  1664                 if ( MediaCanStop( control ) )
  1666                 if ( MediaCanStop( control ) )