612 aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); |
612 aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); |
613 } |
613 } |
614 if ( iFlags & ENotViewerIsNotification ) |
614 if ( iFlags & ENotViewerIsNotification ) |
615 { // Notification mode |
615 { // Notification mode |
616 if ( iView ) |
616 if ( iView ) |
617 { |
617 { |
618 if( (FocusedControlId( ) == EMsgComponentIdFrom) && ( ( iMtm->Sender( ) ).Length() ) ) |
618 TInt focusedControl = FocusedControlId(); |
|
619 TBool senderHighlighted = EFalse; |
|
620 |
|
621 if ( focusedControl == EMsgComponentIdFrom ) |
|
622 { |
|
623 CMsgAddressControl* address = static_cast<CMsgAddressControl*>( |
|
624 iView->ControlById( EMsgComponentIdFrom ) ); |
|
625 |
|
626 if ( address && address->Editor().SelectionLength() |
|
627 == address->Editor().TextLength() ) |
|
628 { |
|
629 senderHighlighted = ETrue; |
|
630 } |
|
631 } |
|
632 |
|
633 if( ( focusedControl == EMsgComponentIdFrom ) && ( ( iMtm->Sender( ) ).Length() ) |
|
634 && senderHighlighted ) |
619 { |
635 { |
620 iFindItemMenu->SetSenderHighlightStatus( ETrue ); |
636 iFindItemMenu->SetSenderHighlightStatus( ETrue ); |
621 iFindItemMenu->SetSenderDisplayText( TMmsGenUtils::PureAddress( iMtm->Sender( ) ) ); |
637 iFindItemMenu->SetSenderDisplayText( TMmsGenUtils::PureAddress( iMtm->Sender( ) ) ); |
622 } |
638 } |
623 else |
639 else |
624 { |
640 { |
625 iFindItemMenu->SetSenderHighlightStatus( EFalse ); |
641 iFindItemMenu->SetSenderHighlightStatus( EFalse ); |
626 } |
642 } |
627 iFindItemMenu->AddItemFindMenuL( |
643 iFindItemMenu->AddItemFindMenuL( |
628 ( FocusedControlId() == EMsgComponentIdBody ) ? iView->ItemFinder() : 0, |
644 ( iView->ItemFinder() && |
|
645 iView->ItemFinder()->CurrentSelection().Length() ) |
|
646 ? iView->ItemFinder() : 0, |
629 aMenuPane, |
647 aMenuPane, |
630 EFindItemMenuPlaceHolder, |
648 EFindItemMenuPlaceHolder, |
631 iMtm->Sender(), |
649 senderHighlighted ? |
|
650 iMtm->Sender( ) : KNullDesC(), |
632 iAlias && !iRemoteAlias ? ETrue : EFalse, //"Is sender known" |
651 iAlias && !iRemoteAlias ? ETrue : EFalse, //"Is sender known" |
633 EFalse ); |
652 EFalse ); |
634 } |
653 } |
635 |
654 |
636 aMenuPane->SetItemDimmed( ENotViewerSend, ETrue ); |
655 aMenuPane->SetItemDimmed( ENotViewerSend, ETrue ); |
865 } |
884 } |
866 |
885 |
867 case EKeyDevice3: //Selection key |
886 case EKeyDevice3: //Selection key |
868 case EKeyEnter: //Enter Key |
887 case EKeyEnter: //Enter Key |
869 { |
888 { |
|
889 CMsgExpandableControl* ctrl = NULL; |
|
890 TBool checkHighlight = EFalse; |
|
891 |
|
892 if( iView->FocusedControl() ) |
|
893 { |
|
894 ctrl = static_cast<CMsgExpandableControl*>( iView->FocusedControl() ); |
|
895 if ( ctrl ) |
|
896 { |
|
897 if ( ctrl->ControlType() == EMsgAddressControl |
|
898 && !ctrl->Editor().SelectionLength() ) |
|
899 { |
|
900 checkHighlight = ETrue; |
|
901 } |
|
902 else if ( ctrl->ControlType() == EMsgBodyControl ) |
|
903 { |
|
904 CItemFinder* itemFinder = iView->ItemFinder(); |
|
905 if ( FocusedControlId() == EMsgComponentIdBody && itemFinder |
|
906 && !itemFinder->CurrentSelection().Length() ) |
|
907 { |
|
908 checkHighlight = ETrue; |
|
909 } |
|
910 } |
|
911 } |
|
912 } |
|
913 if ( ctrl && checkHighlight ) |
|
914 { |
|
915 // Check if highlight needs to be restored to editor, |
|
916 // address/body editor offerkeyevent will handle it |
|
917 if ( ctrl->Editor().OfferKeyEventL( aKeyEvent, aType ) |
|
918 == EKeyWasConsumed ) |
|
919 { |
|
920 // Highlight was restored, just return, no cs menu needed |
|
921 return EKeyWasConsumed; |
|
922 } |
|
923 } |
|
924 |
870 if ( DoSelectionKeyL( ) ) |
925 if ( DoSelectionKeyL( ) ) |
871 { |
926 { |
872 return EKeyWasConsumed; |
927 return EKeyWasConsumed; |
873 } |
928 } |
874 break; //Lint e527 |
929 break; //Lint e527 |