34 #include <msgbiobodycontrol.h> // CMsgBioBodyControl |
34 #include <msgbiobodycontrol.h> // CMsgBioBodyControl |
35 #include <MsgBioUids.h> // smart message type uids |
35 #include <MsgBioUids.h> // smart message type uids |
36 #include <msgbiocontrol.h> // CMsgBioControl |
36 #include <msgbiocontrol.h> // CMsgBioControl |
37 #include <CGmsWrapper.h> // CGmsWrapper |
37 #include <CGmsWrapper.h> // CGmsWrapper |
38 #include <MsgNaviPaneControl.h> |
38 #include <MsgNaviPaneControl.h> |
|
39 #include <MsgExpandableControlEditor.h> |
39 // messaging |
40 // messaging |
40 #include <smuthdr.h> // CSmsHeader |
41 #include <smuthdr.h> // CSmsHeader |
41 #include <smsclnt.h> // CSmsClientMtm |
42 #include <smsclnt.h> // CSmsClientMtm |
42 #include <MsgFolderSelectionDialog.h> // CMsgFolderSelectionDialog |
43 #include <MsgFolderSelectionDialog.h> // CMsgFolderSelectionDialog |
43 #include <MuiuMsvProgressReporterOperation.h> // CMsvProgressReporterOperation |
44 #include <MuiuMsvProgressReporterOperation.h> // CMsvProgressReporterOperation |
977 if ( FocusedControlId( ) == EMsgComponentIdFrom ) |
978 if ( FocusedControlId( ) == EMsgComponentIdFrom ) |
978 { |
979 { |
979 CMsgAddressControl* address = static_cast<CMsgAddressControl*>( |
980 CMsgAddressControl* address = static_cast<CMsgAddressControl*>( |
980 iView->ControlById( EMsgComponentIdFrom ) ); |
981 iView->ControlById( EMsgComponentIdFrom ) ); |
981 |
982 |
982 if ( address && address->Editor().SelectionLength() ) |
983 if ( address && address->Editor().SelectionLength() |
|
984 == address->Editor().TextLength() ) |
983 { |
985 { |
984 senderHighlighted = ETrue; |
986 senderHighlighted = ETrue; |
985 } |
987 } |
986 } |
988 } |
987 if ( iFlags.iValidSenderNumber |
989 if ( iFlags.iValidSenderNumber |
1103 if ( FocusedControlId( ) == EMsgComponentIdFrom ) |
1105 if ( FocusedControlId( ) == EMsgComponentIdFrom ) |
1104 { |
1106 { |
1105 CMsgAddressControl* address = static_cast<CMsgAddressControl*>( |
1107 CMsgAddressControl* address = static_cast<CMsgAddressControl*>( |
1106 iView->ControlById( EMsgComponentIdFrom ) ); |
1108 iView->ControlById( EMsgComponentIdFrom ) ); |
1107 |
1109 |
1108 if ( address && address->Editor().SelectionLength() ) |
1110 if ( address && address->Editor().SelectionLength() |
|
1111 == address->Editor().TextLength() ) |
1109 { |
1112 { |
1110 senderHighlighted = ETrue; |
1113 senderHighlighted = ETrue; |
1111 } |
1114 } |
1112 } |
1115 } |
1113 |
1116 |
1612 iView->OfferKeyEventL( aKeyEvent, aType ); |
1615 iView->OfferKeyEventL( aKeyEvent, aType ); |
1613 return EKeyWasConsumed; |
1616 return EKeyWasConsumed; |
1614 } |
1617 } |
1615 case EKeyDevice3: |
1618 case EKeyDevice3: |
1616 case EKeyEnter: |
1619 case EKeyEnter: |
1617 { |
1620 { |
1618 if( iView->FocusedControl()->ControlType() == EMsgAddressControl ) |
1621 CMsgExpandableControl* ctrl = NULL; |
|
1622 TBool checkHighlight = EFalse; |
|
1623 |
|
1624 if( iView->FocusedControl() ) |
1619 { |
1625 { |
1620 CMsgAddressControl* address = static_cast<CMsgAddressControl*>( |
1626 ctrl = static_cast<CMsgExpandableControl*>( iView->FocusedControl() ); |
1621 iView->FocusedControl() ); |
1627 if ( ctrl->ControlType() == EMsgAddressControl |
1622 if ( address && !address->Editor().SelectionLength() ) |
1628 && !ctrl->Editor().SelectionLength() ) |
1623 { |
1629 { |
1624 // restore highlight to address field |
1630 checkHighlight = ETrue; |
1625 return address->Editor().OfferKeyEventL( aKeyEvent, aType ); |
1631 } |
1626 } |
1632 else if ( ctrl->ControlType() == EMsgBodyControl ) |
1627 } |
1633 { |
1628 else if ( iView->FocusedControl()->ControlType() == EMsgBodyControl ) |
1634 CItemFinder* itemFinder = iView->ItemFinder(); |
1629 { |
1635 if ( FocusedControlId() == EMsgComponentIdBody && itemFinder |
1630 CItemFinder* itemFinder = iView->ItemFinder(); |
1636 && !itemFinder->CurrentSelection().Length() ) |
1631 if ( FocusedControlId() == EMsgComponentIdBody |
1637 { |
1632 && itemFinder ) |
1638 checkHighlight = ETrue; |
1633 { |
|
1634 if ( !itemFinder->CurrentSelection().Length() ) |
|
1635 { |
|
1636 CMsgBodyControl* body = static_cast<CMsgBodyControl*>( |
|
1637 iView->FocusedControl() ); |
|
1638 if ( body ) |
|
1639 { |
|
1640 // restore highlight to current itemfinder item |
|
1641 return body->Editor().OfferKeyEventL( aKeyEvent, aType ); |
|
1642 } |
|
1643 } |
1639 } |
1644 } |
1640 } |
1645 } |
1641 } |
1646 // fall through |
1642 if ( ctrl && checkHighlight ) |
1647 } |
1643 { |
1648 case EMsgFindItemKeyEvent: |
1644 // Check if highlight needs to be restored to editor, |
1649 { |
1645 // address/body editor offerkeyevent will handle it |
|
1646 if ( ctrl->Editor().OfferKeyEventL( aKeyEvent, aType ) |
|
1647 == EKeyWasConsumed ) |
|
1648 { |
|
1649 // Highlight was restored, just return, no cs menu needed |
|
1650 return EKeyWasConsumed; |
|
1651 } |
|
1652 } |
|
1653 |
1650 // Selection-key checking (Context sensitive menu) |
1654 // Selection-key checking (Context sensitive menu) |
1651 // (with Class 0 just show the menu) |
1655 // (with Class 0 just show the menu) |
1652 if ( !iClass0CBA ) |
1656 if ( !iClass0CBA ) |
1653 { |
1657 { |
1654 MenuBar()->SetMenuTitleResourceId( R_SMSV_CONTEXTMENUBAR ); |
1658 MenuBar()->SetMenuTitleResourceId( R_SMSV_CONTEXTMENUBAR ); |