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
3 // found in the LICENSE file.
5 /** @suppress {duplicate} */
6 var remoting
= remoting
|| {};
9 * Interface used for ClientPlugin objects.
12 remoting
.ClientPlugin = function() {
15 /** @type {number} Desktop width */
16 remoting
.ClientPlugin
.prototype.desktopWidth
;
17 /** @type {number} Desktop height */
18 remoting
.ClientPlugin
.prototype.desktopHeight
;
19 /** @type {number} Desktop x DPI */
20 remoting
.ClientPlugin
.prototype.desktopXDpi
;
21 /** @type {number} Desktop y DPI */
22 remoting
.ClientPlugin
.prototype.desktopYDpi
;
24 /** @type {function(string): void} Outgoing signaling message callback. */
25 remoting
.ClientPlugin
.prototype.onOutgoingIqHandler
;
26 /** @type {function(string): void} Debug messages callback. */
27 remoting
.ClientPlugin
.prototype.onDebugMessageHandler
;
28 /** @type {function(number, number): void} State change callback. */
29 remoting
.ClientPlugin
.prototype.onConnectionStatusUpdateHandler
;
30 /** @type {function(boolean): void} Connection ready state callback. */
31 remoting
.ClientPlugin
.prototype.onConnectionReadyHandler
;
32 /** @type {function(): void} Desktop size change callback. */
33 remoting
.ClientPlugin
.prototype.onDesktopSizeUpdateHandler
;
36 * Initializes the plugin asynchronously and calls specified function
39 * @param {function(boolean): void} onDone Function to be called when
40 * the plugin is initialized. Parameter is set to true when the plugin
41 * is loaded successfully.
43 remoting
.ClientPlugin
.prototype.initialize = function(onDone
) {};
46 * @return {boolean} True if the plugin and web-app versions are compatible.
48 remoting
.ClientPlugin
.prototype.isSupportedVersion = function() {};
51 * Set of features for which hasFeature() can be used to test.
55 remoting
.ClientPlugin
.Feature
= {
56 HIGH_QUALITY_SCALING
: 'highQualityScaling',
57 INJECT_KEY_EVENT
: 'injectKeyEvent',
58 NOTIFY_CLIENT_DIMENSIONS
: 'notifyClientDimensions',
59 PAUSE_VIDEO
: 'pauseVideo',
60 PAUSE_AUDIO
: 'pauseAudio',
61 REMAP_KEY
: 'remapKey',
62 SEND_CLIPBOARD_ITEM
: 'sendClipboardItem'
66 * @param {remoting.ClientPlugin.Feature} feature The feature to test for.
67 * @return {boolean} True if the plugin supports the named feature.
69 remoting
.ClientPlugin
.prototype.hasFeature = function(feature
) {};
72 * @return {HTMLEmbedElement} HTML element that corresponds to the plugin.
74 remoting
.ClientPlugin
.prototype.element = function() {};
79 remoting
.ClientPlugin
.prototype.cleanup = function() {};
82 * Must be called for each incoming stanza received from the host.
83 * @param {string} iq Incoming IQ stanza.
85 remoting
.ClientPlugin
.prototype.onIncomingIq = function(iq
) {};
88 * @param {string} hostJid The jid of the host to connect to.
89 * @param {string} hostPublicKey The base64 encoded version of the host's
91 * @param {string} localJid Local jid.
92 * @param {string} sharedSecret The access code for IT2Me or the PIN
94 * @param {string} authenticationMethods Comma-separated list of
95 * authentication methods the client should attempt to use.
96 * @param {string} authenticationTag A host-specific tag to mix into
97 * authentication hashes.
99 remoting
.ClientPlugin
.prototype.connect = function(
100 hostJid
, hostPublicKey
, localJid
, sharedSecret
,
101 authenticationMethods
, authenticationTag
) {};
104 * Release all currently pressed keys.
106 remoting
.ClientPlugin
.prototype.releaseAllKeys = function() {};
109 * Send a key event to the host.
111 * @param {number} usbKeycode The USB-style code of the key to inject.
112 * @param {boolean} pressed True to inject a key press, False for a release.
114 remoting
.ClientPlugin
.prototype.injectKeyEvent
=
115 function(usbKeycode
, pressed
) {};
118 * Remap one USB keycode to another in all subsequent key events.
120 * @param {number} fromKeycode The USB-style code of the key to remap.
121 * @param {number} toKeycode The USB-style code to remap the key to.
123 remoting
.ClientPlugin
.prototype.remapKey
=
124 function(fromKeycode
, toKeycode
) {};
127 * Returns an associative array with a set of stats for this connection.
129 * @return {remoting.ClientSession.PerfStats} The connection statistics.
131 remoting
.ClientPlugin
.prototype.getPerfStats = function() {};
134 * Sends a clipboard item to the host.
136 * @param {string} mimeType The MIME type of the clipboard item.
137 * @param {string} item The clipboard item.
139 remoting
.ClientPlugin
.prototype.sendClipboardItem = function(mimeType
, item
) {};
142 * Notifies the host that the client has the specified dimensions.
144 * @param {number} width The available client width.
145 * @param {number} height The available client height.
147 remoting
.ClientPlugin
.prototype.notifyClientDimensions
=
148 function(width
, height
) {};
151 * Requests that the host pause or resume sending video updates.
153 * @param {boolean} pause True to suspend video updates, false otherwise.
155 remoting
.ClientPlugin
.prototype.pauseVideo
=
159 * Requests that the host pause or resume sending audio updates.
161 * @param {boolean} pause True to suspend audio updates, false otherwise.
163 remoting
.ClientPlugin
.prototype.pauseAudio
=