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_SESSION_REMOTING_CLIENT_H_ | 5 #ifndef REMOTING_CLIENT_IOS_SESSION_REMOTING_CLIENT_H_ |
6 #define REMOTING_CLIENT_IOS_SESSION_REMOTING_CLIENT_H_ | 6 #define REMOTING_CLIENT_IOS_SESSION_REMOTING_CLIENT_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
| 10 #import "remoting/client/ios/display/gl_display_handler.h" |
| 11 |
10 #include "remoting/protocol/connection_to_host.h" | 12 #include "remoting/protocol/connection_to_host.h" |
11 | 13 |
| 14 namespace remoting { |
| 15 |
| 16 class GestureInterpreter; |
| 17 |
| 18 } // namespace remoting |
| 19 |
12 @class HostInfo; | 20 @class HostInfo; |
13 @class GlDisplayHandler; | 21 @class GlDisplayHandler; |
14 | 22 |
15 // A list of notifications that will be sent out for different types of Remoting | 23 // A list of notifications that will be sent out for different types of Remoting |
16 // Client events. | 24 // Client events. |
17 // | 25 // |
18 extern NSString* const kHostSessionStatusChanged; | 26 extern NSString* const kHostSessionStatusChanged; |
19 extern NSString* const kHostSessionPinProvided; | 27 extern NSString* const kHostSessionPinProvided; |
20 | 28 |
21 // List of keys in user info from events. | 29 // List of keys in user info from events. |
22 extern NSString* const kSessionDetails; | 30 extern NSString* const kSessionDetails; |
23 extern NSString* const kSessonStateErrorCode; | 31 extern NSString* const kSessonStateErrorCode; |
24 extern NSString* const kHostSessionPin; | 32 extern NSString* const kHostSessionPin; |
25 | 33 |
26 // Remoting Client is the entry point for starting a session with a remote | 34 // Remoting Client is the entry point for starting a session with a remote |
27 // host. This object should not be reused. Remoting Client will use the default | 35 // host. This object should not be reused. Remoting Client will use the default |
28 // NSNotificationCenter to signal session state changes using the key | 36 // NSNotificationCenter to signal session state changes using the key |
29 // |kHostSessionStatusChanged|. It expects to receive an event back on | 37 // |kHostSessionStatusChanged|. It expects to receive an event back on |
30 // |kHostSessionPinProvided| when the session is asking for a PIN authenication. | 38 // |kHostSessionPinProvided| when the session is asking for a PIN authenication. |
31 @interface RemotingClient : NSObject | 39 @interface RemotingClient : NSObject<GlDisplayHandlerDelegate> |
32 | 40 |
33 // Connect to a given host. | 41 // Connect to a given host. |
34 // |hostInfo| is all the details around a host. | 42 // |hostInfo| is all the details around a host. |
35 // |username| is the username to be used when connecting. | 43 // |username| is the username to be used when connecting. |
36 // |accessToken| is the oAuth access token to provided to create the session. | 44 // |accessToken| is the oAuth access token to provided to create the session. |
37 - (void)connectToHost:(HostInfo*)hostInfo | 45 - (void)connectToHost:(HostInfo*)hostInfo |
38 username:(NSString*)username | 46 username:(NSString*)username |
39 accessToken:(NSString*)accessToken; | 47 accessToken:(NSString*)accessToken; |
40 | 48 |
41 // Mirrors the native client session delegate interface: | 49 // Mirrors the native client session delegate interface: |
42 | 50 |
43 - (void)onConnectionState:(remoting::protocol::ConnectionToHost::State)state | 51 - (void)onConnectionState:(remoting::protocol::ConnectionToHost::State)state |
44 error:(remoting::protocol::ErrorCode)error; | 52 error:(remoting::protocol::ErrorCode)error; |
45 | 53 |
46 - (void)commitPairingCredentialsForHost:(NSString*)host | 54 - (void)commitPairingCredentialsForHost:(NSString*)host |
47 id:(NSString*)id | 55 id:(NSString*)id |
48 secret:(NSString*)secret; | 56 secret:(NSString*)secret; |
49 | 57 |
50 - (void)fetchThirdPartyTokenForUrl:(NSString*)tokenUrl | 58 - (void)fetchThirdPartyTokenForUrl:(NSString*)tokenUrl |
51 clientId:(NSString*)clinetId | 59 clientId:(NSString*)clinetId |
52 scope:(NSString*)scope; | 60 scope:(NSString*)scope; |
53 | 61 |
54 - (void)setCapabilities:(NSString*)capabilities; | 62 - (void)setCapabilities:(NSString*)capabilities; |
55 | 63 |
56 - (void)handleExtensionMessageOfType:(NSString*)type message:(NSString*)message; | 64 - (void)handleExtensionMessageOfType:(NSString*)type message:(NSString*)message; |
57 | 65 |
| 66 // Notifies all components that the frame of the surface has changed. |
| 67 - (void)surfaceChanged:(const CGRect&)frame; |
| 68 |
58 // The display handler tied to the remoting client used to display the host. | 69 // The display handler tied to the remoting client used to display the host. |
59 @property(nonatomic, strong) GlDisplayHandler* displayHandler; | 70 @property(nonatomic, strong) GlDisplayHandler* displayHandler; |
60 // The host info used to make the remoting client connection. | 71 // The host info used to make the remoting client connection. |
61 @property(nonatomic, readonly) HostInfo* hostInfo; | 72 @property(nonatomic, readonly) HostInfo* hostInfo; |
| 73 // The gesture interpreter used to handle gestures. |
| 74 // This is valid only after the client has connected to the host. Always use |
| 75 // RemotingClient.gestureInterpreter instead of storing the pointer separately. |
| 76 @property(nonatomic, readonly) remoting::GestureInterpreter* gestureInterpreter; |
62 | 77 |
63 @end | 78 @end |
64 | 79 |
65 #endif // REMOTING_CLIENT_IOS_SESSION_REMOTING_CLIENT_H_ | 80 #endif // REMOTING_CLIENT_IOS_SESSION_REMOTING_CLIENT_H_ |
OLD | NEW |