| 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 /** | |
| 6 * @fileoverview | |
| 7 * Interface abstracting the ClientPlugin functionality. | |
| 8 */ | |
| 9 | |
| 10 'use strict'; | |
| 11 | |
| 12 /** @suppress {duplicate} */ | |
| 13 var remoting = remoting || {}; | |
| 14 | |
| 15 /** | |
| 16 * @interface | |
| 17 * @extends {base.Disposable} | |
| 18 */ | |
| 19 remoting.ClientPlugin = function() {}; | |
| 20 | |
| 21 /** | |
| 22 * @return {remoting.HostDesktop} | |
| 23 */ | |
| 24 remoting.ClientPlugin.prototype.hostDesktop = function() {}; | |
| 25 | |
| 26 /** | |
| 27 * @return {remoting.ProtocolExtensionManager} | |
| 28 */ | |
| 29 remoting.ClientPlugin.prototype.extensions = function() {}; | |
| 30 | |
| 31 /** | |
| 32 * @return {HTMLElement} The DOM element representing the remote session. | |
| 33 */ | |
| 34 remoting.ClientPlugin.prototype.element = function() {}; | |
| 35 | |
| 36 /** | |
| 37 * @param {function(boolean):void} onDone Completion callback. | |
| 38 */ | |
| 39 remoting.ClientPlugin.prototype.initialize = function(onDone) {}; | |
| 40 | |
| 41 /** | |
| 42 * @param {remoting.Host} host The host to connect to. | |
| 43 * @param {string} localJid Local jid. | |
| 44 * @param {remoting.CredentialsProvider} credentialsProvider | |
| 45 */ | |
| 46 remoting.ClientPlugin.prototype.connect = | |
| 47 function(host, localJid, credentialsProvider) {}; | |
| 48 | |
| 49 /** | |
| 50 * @param {number} key The keycode to inject. | |
| 51 * @param {boolean} down True for press; false for a release. | |
| 52 */ | |
| 53 remoting.ClientPlugin.prototype.injectKeyEvent = | |
| 54 function(key, down) {}; | |
| 55 | |
| 56 /** | |
| 57 * Sends a key combination to the host, by sending down events for | |
| 58 * the given keys, followed by up events in reverse order. | |
| 59 * | |
| 60 * @param {Array<number>} keys Key codes to be sent. | |
| 61 * @return {void} Nothing. | |
| 62 */ | |
| 63 remoting.ClientPlugin.prototype.injectKeyCombination = function(keys) {}; | |
| 64 | |
| 65 /** | |
| 66 * Sets and stores the key remapping setting for the current host. | |
| 67 * | |
| 68 * @param {string} remappings Comma separated list of key remappings. | |
| 69 */ | |
| 70 remoting.ClientPlugin.prototype.setRemapKeys = function(remappings) {}; | |
| 71 | |
| 72 /** | |
| 73 * @param {number} from | |
| 74 * @param {number} to | |
| 75 */ | |
| 76 remoting.ClientPlugin.prototype.remapKey = function(from, to) {}; | |
| 77 | |
| 78 /** | |
| 79 * Release all keys currently being pressed. | |
| 80 */ | |
| 81 remoting.ClientPlugin.prototype.releaseAllKeys = function() {}; | |
| 82 | |
| 83 /** | |
| 84 * @param {string} iq | |
| 85 */ | |
| 86 remoting.ClientPlugin.prototype.onIncomingIq = function(iq) {}; | |
| 87 | |
| 88 /** | |
| 89 * @return {boolean} True if the web-app and plugin are compatible. | |
| 90 */ | |
| 91 remoting.ClientPlugin.prototype.isSupportedVersion = function() {}; | |
| 92 | |
| 93 /** | |
| 94 * @param {remoting.ClientPlugin.Feature} feature | |
| 95 * @return {boolean} True if the plugin supports the specified feature. | |
| 96 */ | |
| 97 remoting.ClientPlugin.prototype.hasFeature = function(feature) {}; | |
| 98 | |
| 99 | |
| 100 /** | |
| 101 * @param {remoting.ClientSession.Capability} capability | |
| 102 * @return {boolean} True if the capability has been negotiated between | |
| 103 * the client and host. | |
| 104 */ | |
| 105 remoting.ClientPlugin.prototype.hasCapability = function(capability) {}; | |
| 106 | |
| 107 /** | |
| 108 * Sends a clipboard item to the host. | |
| 109 * | |
| 110 * @param {string} mimeType The MIME type of the clipboard item. | |
| 111 * @param {string} item The clipboard item. | |
| 112 */ | |
| 113 remoting.ClientPlugin.prototype.sendClipboardItem = | |
| 114 function(mimeType, item) {}; | |
| 115 | |
| 116 /** | |
| 117 * Request that this client be paired with the current host. | |
| 118 * | |
| 119 * @param {string} clientName The human-readable name of the client. | |
| 120 * @param {function(string, string):void} onDone Callback to receive the | |
| 121 * client id and shared secret when they are available. | |
| 122 */ | |
| 123 remoting.ClientPlugin.prototype.requestPairing = | |
| 124 function(clientName, onDone) {}; | |
| 125 | |
| 126 /** | |
| 127 * Allows automatic mouse-lock. | |
| 128 */ | |
| 129 remoting.ClientPlugin.prototype.allowMouseLock = function() {}; | |
| 130 | |
| 131 /** | |
| 132 * @param {boolean} pause True to pause the audio stream; false to resume it. | |
| 133 */ | |
| 134 remoting.ClientPlugin.prototype.pauseAudio = function(pause) {}; | |
| 135 | |
| 136 /** | |
| 137 * @param {boolean} pause True to pause the video stream; false to resume it. | |
| 138 */ | |
| 139 remoting.ClientPlugin.prototype.pauseVideo = function(pause) {}; | |
| 140 | |
| 141 /** | |
| 142 * @return {remoting.ClientSession.PerfStats} A summary of the connection | |
| 143 * performance. | |
| 144 */ | |
| 145 remoting.ClientPlugin.prototype.getPerfStats = function() {}; | |
| 146 | |
| 147 /** | |
| 148 * @param {remoting.ClientPlugin.ConnectionEventHandler} handler | |
| 149 */ | |
| 150 remoting.ClientPlugin.prototype.setConnectionEventHandler = | |
| 151 function(handler) {}; | |
| 152 | |
| 153 /** | |
| 154 * @param {function(string, number, number):void} handler Callback for | |
| 155 * processing large mouse cursor images. The first parameter is a data: | |
| 156 * URL encoding the mouse cursor; the second and third parameters are | |
| 157 * the cursor hotspot's x- and y-coordinates, respectively. | |
| 158 */ | |
| 159 remoting.ClientPlugin.prototype.setMouseCursorHandler = function(handler) {}; | |
| 160 | |
| 161 /** | |
| 162 * @param {function(string, string):void} handler Callback for processing | |
| 163 * clipboard data injected from the host. The first parameter is the mime | |
| 164 * type and the second parameter is the actual data. | |
| 165 */ | |
| 166 remoting.ClientPlugin.prototype.setClipboardHandler = function(handler) {}; | |
| 167 | |
| 168 /** | |
| 169 * @param {function({rects:Array<Array<number>>}):void|null} handler Callback | |
| 170 * to receive dirty region information for each video frame, for debugging. | |
| 171 */ | |
| 172 remoting.ClientPlugin.prototype.setDebugDirtyRegionHandler = | |
| 173 function(handler) {}; | |
| 174 | |
| 175 | |
| 176 /** | |
| 177 * Set of features for which hasFeature() can be used to test. | |
| 178 * | |
| 179 * @enum {string} | |
| 180 */ | |
| 181 remoting.ClientPlugin.Feature = { | |
| 182 INJECT_KEY_EVENT: 'injectKeyEvent', | |
| 183 NOTIFY_CLIENT_RESOLUTION: 'notifyClientResolution', | |
| 184 ASYNC_PIN: 'asyncPin', | |
| 185 PAUSE_VIDEO: 'pauseVideo', | |
| 186 PAUSE_AUDIO: 'pauseAudio', | |
| 187 REMAP_KEY: 'remapKey', | |
| 188 SEND_CLIPBOARD_ITEM: 'sendClipboardItem', | |
| 189 THIRD_PARTY_AUTH: 'thirdPartyAuth', | |
| 190 TRAP_KEY: 'trapKey', | |
| 191 PINLESS_AUTH: 'pinlessAuth', | |
| 192 ALLOW_MOUSE_LOCK: 'allowMouseLock', | |
| 193 EXTENSION_MESSAGE: 'extensionMessage', | |
| 194 VIDEO_CONTROL: 'videoControl' | |
| 195 }; | |
| 196 | |
| 197 | |
| 198 /** | |
| 199 * @interface | |
| 200 */ | |
| 201 remoting.ClientPlugin.ConnectionEventHandler = function() {}; | |
| 202 | |
| 203 /** | |
| 204 * @param {string} iq | |
| 205 */ | |
| 206 remoting.ClientPlugin.ConnectionEventHandler.prototype.onOutgoingIq = | |
| 207 function(iq) {}; | |
| 208 | |
| 209 /** | |
| 210 * @param {string} msg | |
| 211 */ | |
| 212 remoting.ClientPlugin.ConnectionEventHandler.prototype.onDebugMessage = | |
| 213 function(msg) {}; | |
| 214 | |
| 215 /** | |
| 216 * @param {remoting.ClientSession.State} status The plugin's status. | |
| 217 * @param {remoting.ClientSession.ConnectionError} error The plugin's error | |
| 218 * state, if any. | |
| 219 */ | |
| 220 remoting.ClientPlugin.ConnectionEventHandler.prototype. | |
| 221 onConnectionStatusUpdate = function(status, error) {}; | |
| 222 | |
| 223 /** | |
| 224 * @param {string} channel The channel name. | |
| 225 * @param {string} connectionType The new connection type. | |
| 226 */ | |
| 227 remoting.ClientPlugin.ConnectionEventHandler.prototype.onRouteChanged = | |
| 228 function(channel, connectionType) {}; | |
| 229 | |
| 230 /** | |
| 231 * @param {boolean} ready True if the connection is ready. | |
| 232 */ | |
| 233 remoting.ClientPlugin.ConnectionEventHandler.prototype.onConnectionReady = | |
| 234 function(ready) {}; | |
| 235 | |
| 236 /** Called when the first video frame is received */ | |
| 237 remoting.ClientPlugin.ConnectionEventHandler.prototype.onFirstFrameReceived = | |
| 238 function() {}; | |
| 239 | |
| 240 /** | |
| 241 * @interface | |
| 242 */ | |
| 243 remoting.ClientPluginFactory = function() {}; | |
| 244 | |
| 245 /** | |
| 246 * @param {Element} container The container for the embed element. | |
| 247 * @param {Array<string>} requiredCapabilities | |
| 248 * @return {remoting.ClientPlugin} A new client plugin instance. | |
| 249 */ | |
| 250 remoting.ClientPluginFactory.prototype.createPlugin = | |
| 251 function(container, requiredCapabilities) {}; | |
| 252 | |
| 253 /** | |
| 254 * Preload the plugin to make instantiation faster when the user tries | |
| 255 * to connect. | |
| 256 */ | |
| 257 remoting.ClientPluginFactory.prototype.preloadPlugin = function() {}; | |
| 258 | |
| 259 /** | |
| 260 * @type {remoting.ClientPluginFactory} | |
| 261 */ | |
| 262 remoting.ClientPlugin.factory = null; | |
| OLD | NEW |