| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 COMPONENTS_EXO_POINTER_STYLUS_DELEGATE_H_ |
| 6 #define COMPONENTS_EXO_POINTER_STYLUS_DELEGATE_H_ |
| 7 |
| 8 #include "base/time/time.h" |
| 9 #include "ui/events/event_constants.h" |
| 10 |
| 11 namespace gfx { |
| 12 class Vector2dF; |
| 13 } |
| 14 |
| 15 namespace exo { |
| 16 class Pointer; |
| 17 |
| 18 // Handles tool-specific event details on pointers. Used as an extension to the |
| 19 // PointerDelegate. |
| 20 class PointerStylusDelegate { |
| 21 public: |
| 22 // Called at the top of the pointer's destructor, to give observers a |
| 23 // chance to remove themselves. |
| 24 virtual void OnPointerDestroying(Pointer* pointer) = 0; |
| 25 |
| 26 // Called when the type of pointer device changes. |
| 27 virtual void OnPointerToolChange(ui::EventPointerType type) = 0; |
| 28 |
| 29 // Called when the force (pressure) of the pointer changes. |
| 30 // Normalized to be [0, 1]. |
| 31 virtual void OnPointerForce(base::TimeTicks time_stamp, float force) = 0; |
| 32 |
| 33 // Called when the tilt of a pen/stylus changes. Measured from surface normal |
| 34 // as plane angle in degrees, values lie in [-90,90]. A positive x is to the |
| 35 // right and a positive y is towards the user. |
| 36 virtual void OnPointerTilt(base::TimeTicks time_stamp, |
| 37 gfx::Vector2dF tilt) = 0; |
| 38 |
| 39 protected: |
| 40 virtual ~PointerStylusDelegate() {} |
| 41 }; |
| 42 |
| 43 } // namespace exo |
| 44 |
| 45 #endif // COMPONENTS_EXO_POINTER_STYLUS_DELEGATE_H_ |
| OLD | NEW |