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.
5 #ifndef REMOTING_IOS_BRIDGE_CLIENT_PROXY_H_
6 #define REMOTING_IOS_BRIDGE_CLIENT_PROXY_H_
8 #import <Foundation/Foundation.h>
9 #import <UIKit/UIKit.h>
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"
15 #import "remoting/ios/bridge/client_proxy_delegate_wrapper.h"
20 } // namespace remoting
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.
28 @interface HostProxy
: NSObject
{
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
;
38 // TRUE when a connection has been established successfully.
41 // Forwards credentials from CLIENT and to HOST and begins establishing a
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
;
50 // Report from CLIENT with the user's PIN.
51 - (void)authenticationResponse
:(NSString
*)pin createPair
:(BOOL
)createPair
;
53 // CLIENT initiated disconnection
54 - (void)disconnectFromHost
;
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
;
62 // Report from CLIENT of keyboard input
63 - (void)keyboardAction
:(NSInteger
)keyCode keyDown
:(BOOL
)keyIsDown
;
67 #endif // REMOTING_IOS_BRIDGE_CLIENT_PROXY_H_