Upstream version 9.37.197.0
[platform/framework/web/crosswalk.git] / src / remoting / ios / bridge / host_proxy.h
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_CLIENT_PROXY_H_
6 #define REMOTING_IOS_BRIDGE_CLIENT_PROXY_H_
7
8 #import <Foundation/Foundation.h>
9 #import <UIKit/UIKit.h>
10
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
14
15 #import "remoting/ios/bridge/client_proxy_delegate_wrapper.h"
16
17 namespace remoting {
18 class ClientInstance;
19 class ClientProxy;
20 }  // namespace remoting
21
22 // HostProxy is one channel of a bridge from the UI Application (CLIENT) and the
23 // common Chromoting protocol (HOST). HostProxy proxies message from the UI
24 // application to the host. The reverse channel, ClientProxy, is owned by the
25 // HostProxy to control deconstruction order, but is shared with the
26 // ClientInstance to perform work.
27
28 @interface HostProxy : NSObject {
29  @private
30   // Host to Client channel
31   scoped_ptr<remoting::ClientProxy> _hostToClientChannel;
32   // Client to Host channel, must be released before |_hostToClientChannel|
33   scoped_refptr<remoting::ClientInstance> _clientToHostChannel;
34   // Connection state
35   BOOL _isConnected;
36 }
37
38 // TRUE when a connection has been established successfully.
39 - (BOOL)isConnected;
40
41 // Forwards credentials from CLIENT and to HOST and begins establishing a
42 // connection.
43 - (void)connectToHost:(NSString*)username
44             authToken:(NSString*)token
45              jabberId:(NSString*)jid
46                hostId:(NSString*)hostId
47             publicKey:(NSString*)hostPublicKey
48              delegate:(id<ClientProxyDelegate>)delegate;
49
50 // Report from CLIENT with the user's PIN.
51 - (void)authenticationResponse:(NSString*)pin createPair:(BOOL)createPair;
52
53 // CLIENT initiated disconnection
54 - (void)disconnectFromHost;
55
56 // Report from CLIENT of mouse input
57 - (void)mouseAction:(const webrtc::DesktopVector&)position
58          wheelDelta:(const webrtc::DesktopVector&)wheelDelta
59         whichButton:(NSInteger)buttonPressed
60          buttonDown:(BOOL)buttonIsDown;
61
62 // Report from CLIENT of keyboard input
63 - (void)keyboardAction:(NSInteger)keyCode keyDown:(BOOL)keyIsDown;
64
65 @end
66
67 #endif  // REMOTING_IOS_BRIDGE_CLIENT_PROXY_H_