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.
7 * Interface abstracting the ClientPlugin functionality.
12 /** @suppress {duplicate} */
13 var remoting
= remoting
|| {};
17 * @extends {base.Disposable}
19 remoting
.ClientPlugin = function() {};
22 * @return {remoting.HostDesktop}
24 remoting
.ClientPlugin
.prototype.hostDesktop = function() {};
27 * @return {remoting.ProtocolExtensionManager}
29 remoting
.ClientPlugin
.prototype.extensions = function() {};
32 * @return {HTMLElement} The DOM element representing the remote session.
34 remoting
.ClientPlugin
.prototype.element = function() {};
37 * @param {function(boolean):void} onDone Completion callback.
39 remoting
.ClientPlugin
.prototype.initialize = function(onDone
) {};
42 * @param {remoting.Host} host The host to connect to.
43 * @param {string} localJid Local jid.
44 * @param {remoting.CredentialsProvider} credentialsProvider
46 remoting
.ClientPlugin
.prototype.connect
=
47 function(host
, localJid
, credentialsProvider
) {};
50 * @param {number} key The keycode to inject.
51 * @param {boolean} down True for press; false for a release.
53 remoting
.ClientPlugin
.prototype.injectKeyEvent
=
54 function(key
, down
) {};
57 * Sends a key combination to the host, by sending down events for
58 * the given keys, followed by up events in reverse order.
60 * @param {Array<number>} keys Key codes to be sent.
61 * @return {void} Nothing.
63 remoting
.ClientPlugin
.prototype.injectKeyCombination = function(keys
) {};
66 * Sets and stores the key remapping setting for the current host.
68 * @param {!Object} remappings Key mappings, specified as {from: to}, where
69 * |from| and |to| are both USB keycodes, |from| is a decimal representation
70 * (because object keys must be strings) and |to| is a number.
72 remoting
.ClientPlugin
.prototype.setRemapKeys = function(remappings
) {};
75 * @param {number} from
78 remoting
.ClientPlugin
.prototype.remapKey = function(from, to
) {};
81 * Release all keys currently being pressed.
83 remoting
.ClientPlugin
.prototype.releaseAllKeys = function() {};
88 remoting
.ClientPlugin
.prototype.onIncomingIq = function(iq
) {};
91 * @param {remoting.ClientSession.Capability} capability
92 * @return {boolean} True if the capability has been negotiated between
93 * the client and host.
95 remoting
.ClientPlugin
.prototype.hasCapability = function(capability
) {};
98 * Sends a clipboard item to the host.
100 * @param {string} mimeType The MIME type of the clipboard item.
101 * @param {string} item The clipboard item.
103 remoting
.ClientPlugin
.prototype.sendClipboardItem
=
104 function(mimeType
, item
) {};
107 * Notifies the plugin whether to send touch events to the host.
109 * @param {boolean} enable True if touch events should be sent.
111 remoting
.ClientPlugin
.prototype.enableTouchEvents = function(enable
) {};
114 * Request that this client be paired with the current host.
116 * @param {string} clientName The human-readable name of the client.
117 * @param {function(string, string):void} onDone Callback to receive the
118 * client id and shared secret when they are available.
120 remoting
.ClientPlugin
.prototype.requestPairing
=
121 function(clientName
, onDone
) {};
124 * Allows automatic mouse-lock.
126 remoting
.ClientPlugin
.prototype.allowMouseLock = function() {};
129 * @param {boolean} pause True to pause the audio stream; false to resume it.
131 remoting
.ClientPlugin
.prototype.pauseAudio = function(pause
) {};
134 * @param {boolean} pause True to pause the video stream; false to resume it.
136 remoting
.ClientPlugin
.prototype.pauseVideo = function(pause
) {};
139 * @return {remoting.ClientSession.PerfStats} A summary of the connection
142 remoting
.ClientPlugin
.prototype.getPerfStats = function() {};
145 * @param {remoting.ClientPlugin.ConnectionEventHandler} handler
147 remoting
.ClientPlugin
.prototype.setConnectionEventHandler
=
148 function(handler
) {};
151 * @param {function(string, number, number):void} handler Callback for
152 * processing large mouse cursor images. The first parameter is a data:
153 * URL encoding the mouse cursor; the second and third parameters are
154 * the cursor hotspot's x- and y-coordinates, respectively.
156 remoting
.ClientPlugin
.prototype.setMouseCursorHandler = function(handler
) {};
159 * @param {function(string, string):void} handler Callback for processing
160 * clipboard data injected from the host. The first parameter is the mime
161 * type and the second parameter is the actual data.
163 remoting
.ClientPlugin
.prototype.setClipboardHandler = function(handler
) {};
166 * @param {function({rects:Array<Array<number>>}):void|null} handler Callback
167 * to receive dirty region information for each video frame, for debugging.
169 remoting
.ClientPlugin
.prototype.setDebugDirtyRegionHandler
=
170 function(handler
) {};
175 remoting
.ClientPlugin
.ConnectionEventHandler = function() {};
180 remoting
.ClientPlugin
.ConnectionEventHandler
.prototype.onOutgoingIq
=
184 * @param {string} msg
186 remoting
.ClientPlugin
.ConnectionEventHandler
.prototype.onDebugMessage
=
190 * @param {remoting.ClientSession.State} status The plugin's status.
191 * @param {remoting.ClientSession.ConnectionError} error The plugin's error
194 remoting
.ClientPlugin
.ConnectionEventHandler
.prototype.
195 onConnectionStatusUpdate = function(status
, error
) {};
198 * @param {string} channel The channel name.
199 * @param {string} connectionType The new connection type.
201 remoting
.ClientPlugin
.ConnectionEventHandler
.prototype.onRouteChanged
=
202 function(channel
, connectionType
) {};
205 * @param {boolean} ready True if the connection is ready.
207 remoting
.ClientPlugin
.ConnectionEventHandler
.prototype.onConnectionReady
=
210 /** Called when the first video frame is received */
211 remoting
.ClientPlugin
.ConnectionEventHandler
.prototype.onFirstFrameReceived
=
217 remoting
.ClientPluginFactory = function() {};
220 * @param {Element} container The container for the embed element.
221 * @param {Array<string>} requiredCapabilities
222 * @return {remoting.ClientPlugin} A new client plugin instance.
224 remoting
.ClientPluginFactory
.prototype.createPlugin
=
225 function(container
, requiredCapabilities
) {};
228 * Preload the plugin to make instantiation faster when the user tries
231 remoting
.ClientPluginFactory
.prototype.preloadPlugin = function() {};
234 * @type {remoting.ClientPluginFactory}
236 remoting
.ClientPlugin
.factory
= null;