OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_ |
| 6 #define UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "ui/events/event.h" |
| 10 #include "ui/events/events_export.h" |
| 11 #include "ui/events/gesture_detection/filtered_gesture_provider.h" |
| 12 #include "ui/events/gesture_detection/gesture_event_data_packet.h" |
| 13 #include "ui/events/gesture_detection/touch_disposition_gesture_filter.h" |
| 14 #include "ui/events/gestures/motion_event_aura.h" |
| 15 |
| 16 namespace ui { |
| 17 |
| 18 class EVENTS_EXPORT GestureProviderAuraClient { |
| 19 public: |
| 20 virtual ~GestureProviderAuraClient() {} |
| 21 virtual void OnGestureEvent(GestureEvent* event) = 0; |
| 22 }; |
| 23 |
| 24 // Provides gesture detection and dispatch given a sequence of touch events |
| 25 // and touch event acks. |
| 26 class EVENTS_EXPORT GestureProviderAura : public GestureProviderClient { |
| 27 public: |
| 28 GestureProviderAura(GestureProviderAuraClient* client); |
| 29 virtual ~GestureProviderAura(); |
| 30 |
| 31 bool OnTouchEvent(const TouchEvent& event); |
| 32 void OnTouchEventAck(bool event_consumed); |
| 33 const MotionEventAura& pointer_state() { return pointer_state_; } |
| 34 |
| 35 // GestureProviderClient implementation |
| 36 virtual void OnGestureEvent(const GestureEventData& gesture) OVERRIDE; |
| 37 |
| 38 private: |
| 39 GestureProviderAuraClient* client_; |
| 40 MotionEventAura pointer_state_; |
| 41 FilteredGestureProvider filtered_gesture_provider_; |
| 42 |
| 43 int last_touch_event_flags_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(GestureProviderAura); |
| 46 }; |
| 47 |
| 48 } // namespace ui |
| 49 |
| 50 #endif // UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_ |
OLD | NEW |