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 REMOTING_CLIENT_IOS_CLIENT_GESTURES_H_ |
| 6 #define REMOTING_CLIENT_IOS_CLIENT_GESTURES_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 #import <UIKit/UIKit.h> |
| 10 #include "base/logging.h" |
| 11 #import "remoting/client/ios/key_input.h" |
| 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 |
| 26 NO_BUTTON = 0, |
| 27 LEFT_BUTTON = 1, |
| 28 MIDDLE_BUTTON = 2, |
| 29 RIGHT_BUTTON = 3, |
| 30 |
| 31 }; |
| 32 |
| 33 @interface ClientGestures : NSObject<UIGestureRecognizerDelegate> { |
| 34 @private |
| 35 UILongPressGestureRecognizer* _longPressRecognizer; |
| 36 UIPanGestureRecognizer* _panRecognizer; |
| 37 UIPanGestureRecognizer* _threeFingerPanRecognizer; |
| 38 UIPinchGestureRecognizer* _pinchRecognizer; |
| 39 UITapGestureRecognizer* _singleTapRecognizer; |
| 40 UITapGestureRecognizer* _twoFingerTapRecognizer; |
| 41 UITapGestureRecognizer* _threeFingerTapRecognizer; |
| 42 UIScreenEdgePanGestureRecognizer* _edgeGesture; |
| 43 UISwipeGestureRecognizer* _swipeGesture; |
| 44 |
| 45 HostInputScheme _inputScheme; |
| 46 } |
| 47 |
| 48 - (instancetype)initWithView:(UIView*)view; |
| 49 |
| 50 // Zoom in/out |
| 51 - (IBAction)pinchGestureTriggered:(UIPinchGestureRecognizer*)sender; |
| 52 // Left mouse click, moves cursor |
| 53 - (IBAction)tapGestureTriggered:(UITapGestureRecognizer*)sender; |
| 54 // Scroll the view in 2d |
| 55 - (IBAction)panGestureTriggered:(UIPanGestureRecognizer*)sender; |
| 56 // Right mouse click and drag, moves cursor |
| 57 - (IBAction)longPressGestureTriggered:(UILongPressGestureRecognizer*)sender; |
| 58 // Right mouse click |
| 59 - (IBAction)twoFingerTapGestureTriggered:(UITapGestureRecognizer*)sender; |
| 60 // Middle mouse click |
| 61 - (IBAction)threeFingerTapGestureTriggered:(UITapGestureRecognizer*)sender; |
| 62 // Show hidden menus. Swipe up for keyboard, swipe down for navigation menu |
| 63 - (IBAction)threeFingerPanGestureTriggered:(UIPanGestureRecognizer*)sender; |
| 64 |
| 65 @end |
| 66 |
| 67 #endif // REMOTING_CLIENT_IOS_CLIENT_GESTURES_H_ |
OLD | NEW |