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_IOS_CLIENT_GESTURES_H_ | 5 #ifndef REMOTING_CLIENT_IOS_CLIENT_GESTURES_H_ |
6 #define REMOTING_CLIENT_IOS_CLIENT_GESTURES_H_ | 6 #define REMOTING_CLIENT_IOS_CLIENT_GESTURES_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 #import <UIKit/UIKit.h> | 9 #import <UIKit/UIKit.h> |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "remoting/client/desktop_viewport.h" |
11 #import "remoting/client/ios/key_input.h" | 12 #import "remoting/client/ios/key_input.h" |
12 | 13 |
13 typedef NS_ENUM(NSInteger, HostInputScheme) { | 14 typedef NS_ENUM(NSInteger, HostInputScheme) { |
14 // Mouse cursor is shown | 15 // Mouse cursor is shown |
15 // Dragging or Panning, moves the mouse cursor | 16 // Dragging or Panning, moves the mouse cursor |
16 // Tapping causes mouse input at the cursor location | 17 // Tapping causes mouse input at the cursor location |
17 HostInputSchemeTrackpad = 0, // Default | 18 HostInputSchemeTrackpad = 0, // Default |
18 // Mouse cursor is not shown | 19 // Mouse cursor is not shown |
19 // Dragging or Panning is similar to a map | 20 // Dragging or Panning is similar to a map |
20 // Tapping causes mouse input at the tap location | 21 // Tapping causes mouse input at the tap location |
(...skipping 14 matching lines...) Expand all Loading... |
35 UILongPressGestureRecognizer* _longPressRecognizer; | 36 UILongPressGestureRecognizer* _longPressRecognizer; |
36 UIPanGestureRecognizer* _panRecognizer; | 37 UIPanGestureRecognizer* _panRecognizer; |
37 UIPanGestureRecognizer* _threeFingerPanRecognizer; | 38 UIPanGestureRecognizer* _threeFingerPanRecognizer; |
38 UIPinchGestureRecognizer* _pinchRecognizer; | 39 UIPinchGestureRecognizer* _pinchRecognizer; |
39 UITapGestureRecognizer* _singleTapRecognizer; | 40 UITapGestureRecognizer* _singleTapRecognizer; |
40 UITapGestureRecognizer* _twoFingerTapRecognizer; | 41 UITapGestureRecognizer* _twoFingerTapRecognizer; |
41 UITapGestureRecognizer* _threeFingerTapRecognizer; | 42 UITapGestureRecognizer* _threeFingerTapRecognizer; |
42 UIScreenEdgePanGestureRecognizer* _edgeGesture; | 43 UIScreenEdgePanGestureRecognizer* _edgeGesture; |
43 UISwipeGestureRecognizer* _swipeGesture; | 44 UISwipeGestureRecognizer* _swipeGesture; |
44 | 45 |
| 46 __weak UIView* _view; |
| 47 remoting::DesktopViewport* _viewport; |
| 48 |
45 HostInputScheme _inputScheme; | 49 HostInputScheme _inputScheme; |
46 } | 50 } |
47 | 51 |
48 - (instancetype)initWithView:(UIView*)view; | 52 - (instancetype)initWithView:(UIView*)view |
| 53 viewport:(remoting::DesktopViewport*)vp; |
49 | 54 |
50 // Zoom in/out | 55 // Zoom in/out |
51 - (IBAction)pinchGestureTriggered:(UIPinchGestureRecognizer*)sender; | 56 - (IBAction)pinchGestureTriggered:(UIPinchGestureRecognizer*)sender; |
52 // Left mouse click, moves cursor | 57 // Left mouse click, moves cursor |
53 - (IBAction)tapGestureTriggered:(UITapGestureRecognizer*)sender; | 58 - (IBAction)tapGestureTriggered:(UITapGestureRecognizer*)sender; |
54 // Scroll the view in 2d | 59 // Scroll the view in 2d |
55 - (IBAction)panGestureTriggered:(UIPanGestureRecognizer*)sender; | 60 - (IBAction)panGestureTriggered:(UIPanGestureRecognizer*)sender; |
56 // Right mouse click and drag, moves cursor | 61 // Right mouse click and drag, moves cursor |
57 - (IBAction)longPressGestureTriggered:(UILongPressGestureRecognizer*)sender; | 62 - (IBAction)longPressGestureTriggered:(UILongPressGestureRecognizer*)sender; |
58 // Right mouse click | 63 // Right mouse click |
59 - (IBAction)twoFingerTapGestureTriggered:(UITapGestureRecognizer*)sender; | 64 - (IBAction)twoFingerTapGestureTriggered:(UITapGestureRecognizer*)sender; |
60 // Middle mouse click | 65 // Middle mouse click |
61 - (IBAction)threeFingerTapGestureTriggered:(UITapGestureRecognizer*)sender; | 66 - (IBAction)threeFingerTapGestureTriggered:(UITapGestureRecognizer*)sender; |
62 // Show hidden menus. Swipe up for keyboard, swipe down for navigation menu | 67 // Show hidden menus. Swipe up for keyboard, swipe down for navigation menu |
63 - (IBAction)threeFingerPanGestureTriggered:(UIPanGestureRecognizer*)sender; | 68 - (IBAction)threeFingerPanGestureTriggered:(UIPanGestureRecognizer*)sender; |
64 | 69 |
65 @end | 70 @end |
66 | 71 |
67 #endif // REMOTING_CLIENT_IOS_CLIENT_GESTURES_H_ | 72 #endif // REMOTING_CLIENT_IOS_CLIENT_GESTURES_H_ |
OLD | NEW |