| 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_IOS_CLIENT_GESTURES_H_ | 5 #ifndef REMOTING_IOS_CLIENT_GESTURES_H_ |
| 6 #define REMOTING_IOS_CLIENT_GESTURES_H_ | 6 #define REMOTING_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 | 10 |
| 11 @class RemotingClient; | 11 @class RemotingClient; |
| 12 | 12 |
| 13 typedef NS_ENUM(NSInteger, HostInputScheme) { | |
| 14 // Mouse cursor is shown | |
| 15 // Dragging or Panning, moves the mouse cursor | |
| 16 // Tapping causes mouse input at the cursor location | |
| 17 HostInputSchemeTrackpad = 0, // Default | |
| 18 // Mouse cursor is not shown | |
| 19 // Dragging or Panning is similar to a map | |
| 20 // Tapping causes mouse input at the tap location | |
| 21 HostInputSchemeTouch = 1 | |
| 22 }; | |
| 23 | |
| 24 typedef NS_ENUM(NSInteger, MouseButton) { | |
| 25 NO_BUTTON = 0, | |
| 26 LEFT_BUTTON = 1, | |
| 27 MIDDLE_BUTTON = 2, | |
| 28 RIGHT_BUTTON = 3, | |
| 29 }; | |
| 30 | |
| 31 @protocol ClientGesturesDelegate<NSObject> | 13 @protocol ClientGesturesDelegate<NSObject> |
| 32 - (void)keyboardShouldShow; | 14 - (void)keyboardShouldShow; |
| 33 - (void)keyboardShouldHide; | 15 - (void)keyboardShouldHide; |
| 34 @end | 16 @end |
| 35 | 17 |
| 36 @interface ClientGestures : NSObject<UIGestureRecognizerDelegate> { | 18 @interface ClientGestures : NSObject |
| 37 @private | |
| 38 UILongPressGestureRecognizer* _longPressRecognizer; | |
| 39 UIPanGestureRecognizer* _panRecognizer; | |
| 40 UIPanGestureRecognizer* _flingRecognizer; | |
| 41 UIPanGestureRecognizer* _scrollRecognizer; | |
| 42 UIPanGestureRecognizer* _threeFingerPanRecognizer; | |
| 43 UIPinchGestureRecognizer* _pinchRecognizer; | |
| 44 UITapGestureRecognizer* _singleTapRecognizer; | |
| 45 UITapGestureRecognizer* _twoFingerTapRecognizer; | |
| 46 UITapGestureRecognizer* _threeFingerTapRecognizer; | |
| 47 UIScreenEdgePanGestureRecognizer* _edgeGesture; | |
| 48 UISwipeGestureRecognizer* _swipeGesture; | |
| 49 | |
| 50 __weak UIView* _view; | |
| 51 __weak RemotingClient* _client; | |
| 52 | |
| 53 HostInputScheme _inputScheme; | |
| 54 } | |
| 55 | 19 |
| 56 - (instancetype)initWithView:(UIView*)view client:(RemotingClient*)client; | 20 - (instancetype)initWithView:(UIView*)view client:(RemotingClient*)client; |
| 57 | 21 |
| 58 // Zoom in/out | |
| 59 - (IBAction)pinchGestureTriggered:(UIPinchGestureRecognizer*)sender; | |
| 60 // Left mouse click, moves cursor | |
| 61 - (IBAction)tapGestureTriggered:(UITapGestureRecognizer*)sender; | |
| 62 // Scroll the view in 2d | |
| 63 - (IBAction)panGestureTriggered:(UIPanGestureRecognizer*)sender; | |
| 64 // Handle one finger fling gesture | |
| 65 - (IBAction)flingGestureTriggered:(UIPanGestureRecognizer*)sender; | |
| 66 // Handle two finger scroll gesture | |
| 67 - (IBAction)scrollGestureTriggered:(UIPanGestureRecognizer*)sender; | |
| 68 // Right mouse click and drag, moves cursor | |
| 69 - (IBAction)longPressGestureTriggered:(UILongPressGestureRecognizer*)sender; | |
| 70 // Right mouse click | |
| 71 - (IBAction)twoFingerTapGestureTriggered:(UITapGestureRecognizer*)sender; | |
| 72 // Middle mouse click | |
| 73 - (IBAction)threeFingerTapGestureTriggered:(UITapGestureRecognizer*)sender; | |
| 74 // Show hidden menus. Swipe up for keyboard, swipe down for navigation menu | |
| 75 - (IBAction)threeFingerPanGestureTriggered:(UIPanGestureRecognizer*)sender; | |
| 76 | |
| 77 @property(weak, nonatomic) id<ClientGesturesDelegate> delegate; | 22 @property(weak, nonatomic) id<ClientGesturesDelegate> delegate; |
| 78 | 23 |
| 79 @end | 24 @end |
| 80 | 25 |
| 81 #endif // REMOTING_IOS_CLIENT_GESTURES_H_ | 26 #endif // REMOTING_IOS_CLIENT_GESTURES_H_ |
| OLD | NEW |