| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_EXO_POINTER_DELEGATE_H_ | 5 #ifndef COMPONENTS_EXO_POINTER_DELEGATE_H_ |
| 6 #define COMPONENTS_EXO_POINTER_DELEGATE_H_ | 6 #define COMPONENTS_EXO_POINTER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "ui/events/event_constants.h" | 9 #include "ui/events/event_constants.h" |
| 10 | 10 |
| 11 namespace gfx { | 11 namespace gfx { |
| 12 class Point; | 12 class Point; |
| 13 class Vector2d; | 13 class Vector2dF; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace exo { | 16 namespace exo { |
| 17 class Pointer; | 17 class Pointer; |
| 18 class Surface; | 18 class Surface; |
| 19 | 19 |
| 20 // Handles events on pointers in context-specific ways. | 20 // Handles events on pointers in context-specific ways. |
| 21 class PointerDelegate { | 21 class PointerDelegate { |
| 22 public: | 22 public: |
| 23 // Called at the top of the pointer's destructor, to give observers a | 23 // Called at the top of the pointer's destructor, to give observers a |
| (...skipping 18 matching lines...) Expand all Loading... |
| 42 virtual void OnPointerMotion(base::TimeDelta time_stamp, | 42 virtual void OnPointerMotion(base::TimeDelta time_stamp, |
| 43 const gfx::Point& location) = 0; | 43 const gfx::Point& location) = 0; |
| 44 | 44 |
| 45 // Called when pointer button state changed. |changed_button_flags| contains | 45 // Called when pointer button state changed. |changed_button_flags| contains |
| 46 // all buttons that changed. |pressed| is true if buttons entered pressed | 46 // all buttons that changed. |pressed| is true if buttons entered pressed |
| 47 // state. | 47 // state. |
| 48 virtual void OnPointerButton(base::TimeDelta time_stamp, | 48 virtual void OnPointerButton(base::TimeDelta time_stamp, |
| 49 int changed_button_flags, | 49 int changed_button_flags, |
| 50 bool pressed) = 0; | 50 bool pressed) = 0; |
| 51 | 51 |
| 52 // Called when pointer wheel changed. |offset| contains the direction and | 52 // Called when pointer is scrolling. |offset| contains the direction and |
| 53 // distance of the change. | 53 // distance of the change. |discrete| is true if the scrolling is caused |
| 54 virtual void OnPointerWheel(base::TimeDelta time_stamp, | 54 // by a discrete device such as a scroll wheel. |
| 55 const gfx::Vector2d& offset) = 0; | 55 virtual void OnPointerScroll(base::TimeDelta time_stamp, |
| 56 const gfx::Vector2dF& offset, |
| 57 bool discrete) = 0; |
| 58 |
| 59 // Called when a current kinetic scroll should be canceled. |
| 60 virtual void OnPointerScrollCancel(base::TimeDelta time_stamp) = 0; |
| 61 |
| 62 // Called when pointer scroll has stopped and a fling is happening (e.g. |
| 63 // lifting the fingers from the touchpad after scrolling quickly) |
| 64 virtual void OnPointerScrollStop(base::TimeDelta time_stamp) = 0; |
| 65 |
| 66 // Called after all pointer information of this frame has been set and the |
| 67 // client should evaluate the updated state. No events are being sent before |
| 68 // this method is called. |
| 69 virtual void OnPointerFrame() = 0; |
| 56 | 70 |
| 57 protected: | 71 protected: |
| 58 virtual ~PointerDelegate() {} | 72 virtual ~PointerDelegate() {} |
| 59 }; | 73 }; |
| 60 | 74 |
| 61 } // namespace exo | 75 } // namespace exo |
| 62 | 76 |
| 63 #endif // COMPONENTS_EXO_POINTER_DELEGATE_H_ | 77 #endif // COMPONENTS_EXO_POINTER_DELEGATE_H_ |
| OLD | NEW |