OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PROTOCOL_CONNECTION_TO_HOST_H_ | 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "remoting/protocol/errors.h" | 12 #include "remoting/protocol/errors.h" |
13 | 13 |
14 namespace remoting { | 14 namespace remoting { |
15 namespace protocol { | 15 namespace protocol { |
16 | 16 |
17 class AudioStub; | 17 class AudioStub; |
18 class Authenticator; | 18 class Authenticator; |
19 class ClientStub; | 19 class ClientStub; |
20 class ClipboardStub; | 20 class ClipboardStub; |
21 class HostStub; | 21 class HostStub; |
22 class InputStub; | 22 class InputStub; |
23 class Session; | 23 class Session; |
24 class SessionConfig; | 24 class SessionConfig; |
25 class TransportContext; | 25 class TransportContext; |
26 struct TransportRoute; | 26 struct TransportRoute; |
27 class VideoStub; | 27 class VideoRenderer; |
28 | 28 |
29 class ConnectionToHost { | 29 class ConnectionToHost { |
30 public: | 30 public: |
31 // The UI implementations maintain corresponding definitions of this | 31 // The UI implementations maintain corresponding definitions of this |
32 // enumeration in client_session.js and | 32 // enumeration in client_session.js and |
33 // android/java/src/org/chromium/chromoting/jni/JniInterface.java. Be sure to | 33 // android/java/src/org/chromium/chromoting/jni/JniInterface.java. Be sure to |
34 // update these locations if you make any changes to the ordering. | 34 // update these locations if you make any changes to the ordering. |
35 enum State { | 35 enum State { |
36 INITIALIZING, | 36 INITIALIZING, |
37 CONNECTING, | 37 CONNECTING, |
(...skipping 25 matching lines...) Expand all Loading... |
63 }; | 63 }; |
64 | 64 |
65 virtual ~ConnectionToHost() {} | 65 virtual ~ConnectionToHost() {} |
66 | 66 |
67 // Set the stubs which will handle messages from the host. | 67 // Set the stubs which will handle messages from the host. |
68 // The caller must ensure that stubs out-live the connection. | 68 // The caller must ensure that stubs out-live the connection. |
69 // Unless otherwise specified, all stubs must be set before Connect() | 69 // Unless otherwise specified, all stubs must be set before Connect() |
70 // is called. | 70 // is called. |
71 virtual void set_client_stub(ClientStub* client_stub) = 0; | 71 virtual void set_client_stub(ClientStub* client_stub) = 0; |
72 virtual void set_clipboard_stub(ClipboardStub* clipboard_stub) = 0; | 72 virtual void set_clipboard_stub(ClipboardStub* clipboard_stub) = 0; |
73 virtual void set_video_stub(VideoStub* video_stub) = 0; | 73 virtual void set_video_renderer(VideoRenderer* video_renderer) = 0; |
74 // If no audio stub is specified then audio will not be requested. | 74 // If no audio stub is specified then audio will not be requested. |
75 virtual void set_audio_stub(AudioStub* audio_stub) = 0; | 75 virtual void set_audio_stub(AudioStub* audio_stub) = 0; |
76 | 76 |
77 // Initiates a connection using |session|. |event_callback| will be notified | 77 // Initiates a connection using |session|. |event_callback| will be notified |
78 // of changes in the state of the connection and must outlive the | 78 // of changes in the state of the connection and must outlive the |
79 // ConnectionToHost. Caller must set stubs (see below) before calling Connect. | 79 // ConnectionToHost. Caller must set stubs (see below) before calling Connect. |
80 virtual void Connect(scoped_ptr<Session> session, | 80 virtual void Connect(scoped_ptr<Session> session, |
81 scoped_refptr<TransportContext> transport_context, | 81 scoped_refptr<TransportContext> transport_context, |
82 HostEventCallback* event_callback) = 0; | 82 HostEventCallback* event_callback) = 0; |
83 | 83 |
84 // Returns the session configuration that was negotiated with the host. | 84 // Returns the session configuration that was negotiated with the host. |
85 virtual const SessionConfig& config() = 0; | 85 virtual const SessionConfig& config() = 0; |
86 | 86 |
87 // Stubs for sending data to the host. | 87 // Stubs for sending data to the host. |
88 virtual ClipboardStub* clipboard_forwarder() = 0; | 88 virtual ClipboardStub* clipboard_forwarder() = 0; |
89 virtual HostStub* host_stub() = 0; | 89 virtual HostStub* host_stub() = 0; |
90 virtual InputStub* input_stub() = 0; | 90 virtual InputStub* input_stub() = 0; |
91 | 91 |
92 // Return the current state of ConnectionToHost. | 92 // Return the current state of ConnectionToHost. |
93 virtual State state() const = 0; | 93 virtual State state() const = 0; |
94 }; | 94 }; |
95 | 95 |
96 } // namespace protocol | 96 } // namespace protocol |
97 } // namespace remoting | 97 } // namespace remoting |
98 | 98 |
99 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 99 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
OLD | NEW |