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