753 // |
753 // |
754 void CAknDiscreetPopupControl::HandlePointerEventL( |
754 void CAknDiscreetPopupControl::HandlePointerEventL( |
755 const TPointerEvent& aPointerEvent ) |
755 const TPointerEvent& aPointerEvent ) |
756 { |
756 { |
757 TBool eventInRect( Rect().Contains( aPointerEvent.iPosition ) ); |
757 TBool eventInRect( Rect().Contains( aPointerEvent.iPosition ) ); |
758 |
758 |
759 // Pointer down - set pressed-down state (popup completely visible while |
759 // The discreet popup which is global won't handle pointer event if there is notifier be popping up. |
760 // pressed-down) |
760 if( !iInternalFlags.IsSet( EGlobal ) || iCoeEnv->RootWin().OrdinalPriority() < ECoeWinPriorityAlwaysAtFront ) |
761 if ( aPointerEvent.iType == TPointerEvent::EButton1Down |
761 { |
762 && eventInRect |
762 // Pointer down - set pressed-down state (popup completely visible while |
763 && iInternalFlags.IsClear( EDismissed ) ) |
763 // pressed-down) |
764 { |
764 if ( aPointerEvent.iType == TPointerEvent::EButton1Down |
765 _AKNTRACE( "CAknDiscreetPopupControl::HandlePointerEventL, TPointerEvent::EButton1Down" ); |
765 && eventInRect |
766 SetPressedDownState( ETrue ); |
766 && iInternalFlags.IsClear( EDismissed ) ) |
767 ImmediateFeedback( ETouchFeedbackSensitive ); |
767 { |
768 } |
768 _AKNTRACE( "CAknDiscreetPopupControl::HandlePointerEventL, TPointerEvent::EButton1Down" ); |
769 |
769 SetPressedDownState( ETrue ); |
770 // Pointer drag - reset pressed-down state if pointer out of popup area |
770 ImmediateFeedback( ETouchFeedbackSensitive ); |
771 else if ( aPointerEvent.iType == TPointerEvent::EDrag ) |
771 } |
772 { |
772 |
773 _AKNTRACE( "CAknDiscreetPopupControl::HandlePointerEventL, TPointerEvent::EDrag" ); |
773 // Pointer drag - reset pressed-down state if pointer out of popup area |
774 iInternalFlags.Set( EDragged ); |
774 else if ( aPointerEvent.iType == TPointerEvent::EDrag ) |
775 if ( !eventInRect && iInternalFlags.IsSet( EPressedDown ) ) |
775 { |
776 { |
776 _AKNTRACE( "CAknDiscreetPopupControl::HandlePointerEventL, TPointerEvent::EDrag" ); |
777 iInternalFlags.Clear( EPressedDown ); |
777 iInternalFlags.Set( EDragged ); |
778 } |
778 if ( !eventInRect && iInternalFlags.IsSet( EPressedDown ) ) |
779 else if ( eventInRect && !iInternalFlags.IsSet( EPressedDown ) ) |
779 { |
780 { |
780 iInternalFlags.Clear( EPressedDown ); |
781 iInternalFlags.Set( EPressedDown ); |
781 } |
782 } |
782 else if ( eventInRect && !iInternalFlags.IsSet( EPressedDown ) ) |
783 } |
783 { |
784 |
784 iInternalFlags.Set( EPressedDown ); |
785 // Pointer up - reset pressed-down state |
785 } |
786 else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
786 } |
787 { |
787 |
788 _AKNTRACE( "CAknDiscreetPopupControl::HandlePointerEventL, TPointerEvent::EButton1Up" ); |
788 // Pointer up - reset pressed-down state |
789 if ( eventInRect ) |
789 else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
790 { |
790 { |
791 NotifyObserverL(); |
791 _AKNTRACE( "CAknDiscreetPopupControl::HandlePointerEventL, TPointerEvent::EButton1Up" ); |
792 } |
792 if ( eventInRect ) |
793 |
793 { |
794 // Start fading away |
794 NotifyObserverL(); |
795 if ( iInternalFlags.IsClear( EDismissed ) ) |
795 } |
796 { |
796 // Start fading away |
797 iInternalFlags.Set( EDismissed ); |
797 if ( iInternalFlags.IsClear( EDismissed ) ) |
798 RequestExitL(); |
798 { |
799 } |
799 iInternalFlags.Set( EDismissed ); |
800 |
800 RequestExitL(); |
801 SetPressedDownState( EFalse ); |
801 } |
802 } |
802 SetPressedDownState( EFalse ); |
803 } |
803 } |
804 |
804 } |
|
805 |
|
806 } |
|
807 |