OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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_IOS_BRIDGE_CHROMOTING_INTERFACE_H_ | |
6 #define REMOTING_IOS_BRIDGE_CHROMOTING_INTERFACE_H_ | |
7 | |
8 #import <Foundation/Foundation.h> | |
9 #import <UIKit/UIKit.h> | |
10 | |
11 #include <vector> | |
12 | |
13 #include "base/memory/ref_counted.h" | |
14 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | |
15 | |
16 namespace remoting { | |
17 class ClientBridge; | |
18 } // namespace remoting | |
19 | |
20 // Contract to provide for callbacks from an async communication channel | |
21 // by the C++ code base to OBJ_C++. | |
22 @protocol ClientControllerDelegate<NSObject> | |
23 // HOST request for client to input their PIN. | |
24 - (void)requestHostPin:(BOOL)pairingSupported; | |
dcaiafa
2014/03/19 01:14:15
nit: Add blank line between methods.
aboone
2014/03/21 16:42:07
Done.
| |
25 // HOST notification that a connection has been successfully opened. | |
26 - (void)connected; | |
27 // HOST notification that a connection has failed. | |
28 - (void)connectionFailed:(NSString*)errorMessage; | |
29 // HOST notification for a change in connections status. | |
30 - (void)connectionStatus:(NSString*)statusMessage; | |
31 // A new Canvas (desktop) update has arrived. | |
32 - (void)applyFrame:(const webrtc::DesktopSize&)size | |
33 stride:(NSInteger)stride | |
34 data:(uint8_t*)data | |
35 regions:(const std::vector<webrtc::DesktopRect>&)regions; | |
36 // A new Cursor (mouse) update has arrived. | |
37 - (void)applyCursor:(const webrtc::DesktopSize&)size | |
38 hotspot:(const webrtc::DesktopVector&)hotspot | |
39 cursorData:(uint8_t*)data; | |
40 @end | |
41 | |
42 // ClientController is part of a bridge from the Chromoting C++ code base (HOST) | |
43 // to an iOS OBJ_C++ UI application (CLIENT) front end. ClientController | |
44 // represents the CLIENT side of the bridge, and communicates with a C/OBJ-C | |
45 // implimented class ClientBridge to process input/output with the | |
dcaiafa
2014/03/19 01:14:15
nit: spelling.
aboone
2014/03/21 16:42:07
Done.
| |
46 // (HOST). The majority of the functions are simply pass through. | |
47 @interface ClientController : NSObject { | |
48 @private | |
49 scoped_refptr<remoting::ClientBridge> _bridge; | |
50 __weak id<ClientControllerDelegate> _delegate; | |
51 BOOL _isConnected; | |
52 } | |
53 | |
54 // Accepts credentials from CLIENT and sends them to the HOST as an async | |
55 // process. | |
56 - (void)connectToHost:(NSString*)username | |
57 authToken:(NSString*)token | |
58 jabberId:(NSString*)jid | |
59 hostId:(NSString*)hostId | |
60 publicKey:(NSString*)hostPublicKey | |
61 delegate:(id<ClientControllerDelegate>)delegate; | |
62 | |
63 // Initiate a disconnection by CLIENT | |
64 - (void)disconnectFromHost; | |
65 | |
66 // TRUE when a connection has been established successfully. | |
67 - (BOOL)isConnected; | |
68 | |
69 // Request from HOST to fetch the User's PIN for host | |
70 - (void)displayAuthenticationPrompt:(BOOL)pairingSupported; | |
71 | |
72 // Request from HOST to store User's credentials | |
73 - (void)commitPairinedentials:(NSString*)hostId | |
74 pairId:(NSString*)pairId | |
75 secret:(NSString*)hostSecret; | |
76 | |
77 // Report errors from HOST | |
78 - (void)reportConnectionStatus:(NSInteger)state error:(NSInteger)error; | |
79 | |
80 // Report from CLIENT of mouse input | |
81 - (void)mouseAction:(const webrtc::DesktopVector&)position | |
82 wheelDelta:(const webrtc::DesktopVector&)wheelDelta | |
83 whichButton:(NSInteger)buttonPressed | |
84 buttonDown:(BOOL)buttonIsDown; | |
85 | |
86 // Report from CLIENT of keyboard input | |
87 - (void)keyboardAction:(NSInteger)keyCode keyDown:(BOOL)keyIsDown; | |
88 | |
89 // Report from CLIENT with the user's PIN. Occurs after HOST has called | |
90 // displayAuthenticationPrompt | |
91 - (void)authenticationResponse:(NSString*)pin createPair:(BOOL)createPair; | |
92 | |
93 // HOST has delivered a Cursor (mouse) update | |
94 - (void)updateCursorShape:(const webrtc::DesktopSize&)size | |
95 hotspot:(const webrtc::DesktopVector&)hotspot | |
96 cursorData:(uint8_t*)data; | |
97 | |
98 // HOST has delivered a Canvas (desktop) update | |
99 - (void)updateImageBuffer:(const webrtc::DesktopSize&)size | |
100 stride:(NSInteger)stride | |
101 data:(uint8_t*)data | |
102 regions:(const std::vector<webrtc::DesktopRect>&)regions; | |
103 | |
104 @end | |
105 | |
106 #endif // REMOTING_IOS_BRIDGE_CHROMOTING_INTERFACE_H_ | |
OLD | NEW |