| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 REMOTING_CLIENT_UI_INPUT_STRATEGY_H_ | 5 #ifndef REMOTING_CLIENT_UI_INPUT_STRATEGY_H_ |
| 6 #define REMOTING_CLIENT_UI_INPUT_STRATEGY_H_ | 6 #define REMOTING_CLIENT_UI_INPUT_STRATEGY_H_ |
| 7 | 7 |
| 8 #include "remoting/client/ui/view_matrix.h" | 8 #include "remoting/client/ui/view_matrix.h" |
| 9 | 9 |
| 10 namespace remoting { | 10 namespace remoting { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // change. | 40 // change. |
| 41 // simultaneous_gesture: Gesture that is simultaneously in progress. | 41 // simultaneous_gesture: Gesture that is simultaneously in progress. |
| 42 // Returns true if this changes the cursor position. | 42 // Returns true if this changes the cursor position. |
| 43 virtual bool HandlePan(const ViewMatrix::Vector2D& translation, | 43 virtual bool HandlePan(const ViewMatrix::Vector2D& translation, |
| 44 Gesture simultaneous_gesture, | 44 Gesture simultaneous_gesture, |
| 45 DesktopViewport* viewport) = 0; | 45 DesktopViewport* viewport) = 0; |
| 46 | 46 |
| 47 // Called when a touch input (which will end up injecting a mouse event at | 47 // Called when a touch input (which will end up injecting a mouse event at |
| 48 // certain position in the host) is done at |touch_point|. | 48 // certain position in the host) is done at |touch_point|. |
| 49 // The implementation should move the cursor to proper position. | 49 // The implementation should move the cursor to proper position. |
| 50 virtual void TrackTouchInput(const ViewMatrix::Point& touch_point, | 50 // |
| 51 // Returns true if |touch_point| is a valid input, false otherwise. If the |
| 52 // input is not valid, the implementation should not change its cursor |
| 53 // position. |
| 54 virtual bool TrackTouchInput(const ViewMatrix::Point& touch_point, |
| 51 const DesktopViewport& viewport) = 0; | 55 const DesktopViewport& viewport) = 0; |
| 52 | 56 |
| 53 // Returns the current cursor position. | 57 // Returns the current cursor position. |
| 54 virtual ViewMatrix::Point GetCursorPosition() const = 0; | 58 virtual ViewMatrix::Point GetCursorPosition() const = 0; |
| 55 | 59 |
| 56 // Maps a vector (or movement) in the surface coordinate to the vector to be | 60 // Maps a vector (or movement) in the surface coordinate to the vector to be |
| 57 // used on the desktop. For example it can be used to map a scroll gesture | 61 // used on the desktop. For example it can be used to map a scroll gesture |
| 58 // on the screen to change in mouse wheel position. | 62 // on the screen to change in mouse wheel position. |
| 59 virtual ViewMatrix::Vector2D MapScreenVectorToDesktop( | 63 virtual ViewMatrix::Vector2D MapScreenVectorToDesktop( |
| 60 const ViewMatrix::Vector2D& delta, | 64 const ViewMatrix::Vector2D& delta, |
| 61 const DesktopViewport& viewport) const = 0; | 65 const DesktopViewport& viewport) const = 0; |
| 62 | 66 |
| 63 // Returns the maximum radius of the feedback animation on the surface's | 67 // Returns the maximum radius of the feedback animation on the surface's |
| 64 // coordinate for the given input type. The feedback will then be shown on the | 68 // coordinate for the given input type. The feedback will then be shown on the |
| 65 // cursor positions returned by GetCursorPosition(). Return 0 if no feedback | 69 // cursor positions returned by GetCursorPosition(). Return 0 if no feedback |
| 66 // should be shown. | 70 // should be shown. |
| 67 virtual float GetFeedbackRadius(InputFeedbackType type) const = 0; | 71 virtual float GetFeedbackRadius(InputFeedbackType type) const = 0; |
| 68 | 72 |
| 69 // Returns true if the input strategy maintains a visible cursor on the | 73 // Returns true if the input strategy maintains a visible cursor on the |
| 70 // desktop. | 74 // desktop. |
| 71 virtual bool IsCursorVisible() const = 0; | 75 virtual bool IsCursorVisible() const = 0; |
| 72 }; | 76 }; |
| 73 | 77 |
| 74 } // namespace remoting | 78 } // namespace remoting |
| 75 #endif // REMOTING_CLIENT_UI_INPUT_STRATEGY_H_ | 79 #endif // REMOTING_CLIENT_UI_INPUT_STRATEGY_H_ |
| OLD | NEW |