Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / remoting / webapp / js_proto / remoting_proto.js
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.
4
5 // This file contains type definitions for various remoting classes.
6 // It is used only with JSCompiler to verify the type-correctness of our code.
7
8 /** @suppress {duplicate} */
9 var remoting = remoting || {};
10
11 /** @constructor
12  *  @extends Event
13  */
14 remoting.ClipboardData = function() {};
15
16 /** @type {Array.<string>} */
17 remoting.ClipboardData.prototype.types;
18
19 /** @type {function(string): string} */
20 remoting.ClipboardData.prototype.getData;
21
22 /** @type {function(string, string): void} */
23 remoting.ClipboardData.prototype.setData;
24
25 /** @constructor
26  */
27 remoting.ClipboardEvent = function() {};
28
29 /** @type {remoting.ClipboardData} */
30 remoting.ClipboardEvent.prototype.clipboardData;
31
32 /** @type {function(): void} */
33 remoting.ClipboardEvent.prototype.preventDefault;
34
35
36 /** @constructor
37  *  @extends HTMLElement
38  */
39 remoting.HostPlugin = function() {};
40
41 /** @param {string} email The email address of the connector.
42  *  @param {string} token The access token for the connector.
43  *  @return {void} Nothing. */
44 remoting.HostPlugin.prototype.connect = function(email, token) {};
45
46 /** @return {void} Nothing. */
47 remoting.HostPlugin.prototype.disconnect = function() {};
48
49 /** @param {function(string):string} callback Pointer to chrome.i18n.getMessage.
50  *  @return {void} Nothing. */
51 remoting.HostPlugin.prototype.localize = function(callback) {};
52
53 /** @param {function(string):void} callback Callback to be called with the
54  *      local hostname.
55  *  @return {void} Nothing. */
56 remoting.HostPlugin.prototype.getHostName = function(callback) {};
57
58 /** @param {string} hostId The host ID.
59  *  @param {string} pin The PIN.
60  *  @param {function(string):void} callback Callback to be called with the hash
61  *      encoded with Base64.
62  *  @return {void} Nothing. */
63 remoting.HostPlugin.prototype.getPinHash = function(hostId, pin, callback) {};
64
65 /** @param {function(string, string):void} callback Callback to be called
66  *  after new key is generated.
67  *  @return {void} Nothing. */
68 remoting.HostPlugin.prototype.generateKeyPair = function(callback) {};
69
70 /**
71  * Updates host config with the values specified in |config|. All
72  * fields that are not specified in |config| remain
73  * unchanged. Following parameters cannot be changed using this
74  * function: host_id, xmpp_login. Error is returned if |config|
75  * includes these paramters. Changes take effect before the callback
76  * is called.
77  *
78  * @param {string} config The new config parameters, JSON encoded dictionary.
79  * @param {function(remoting.HostController.AsyncResult):void} callback
80  *     Callback to be called when finished.
81  * @return {void} Nothing. */
82 remoting.HostPlugin.prototype.updateDaemonConfig =
83     function(config, callback) {};
84
85 /** @param {function(string):void} callback Callback to be called with
86  *      the config.
87  *  @return {void} Nothing. */
88 remoting.HostPlugin.prototype.getDaemonConfig = function(callback) {};
89
90 /** @param {function(string):void} callback Callback to be called with
91  *      the version, as a dotted string.
92  *  @return {void} Nothing. */
93 remoting.HostPlugin.prototype.getDaemonVersion = function(callback) {};
94
95 /** @param {function(boolean, boolean, boolean):void} callback Callback to be
96  *      called with the consent.
97  *  @return {void} Nothing. */
98 remoting.HostPlugin.prototype.getUsageStatsConsent = function(callback) {};
99
100 /** @param {string} config Host configuration.
101  *  @param {function(remoting.HostController.AsyncResult):void} callback
102  *     Callback to be called when finished.
103  *  @return {void} Nothing. */
104 remoting.HostPlugin.prototype.startDaemon = function(
105     config, consent, callback) {};
106
107 /** @param {function(remoting.HostController.AsyncResult):void} callback
108  *     Callback to be called when finished.
109  *  @return {void} Nothing. */
110 remoting.HostPlugin.prototype.stopDaemon = function(callback) {};
111
112 /** @param {function(string):void} callback Callback to be called with the
113  *      JSON-encoded list of paired clients.
114  *  @return {void} Nothing.
115  */
116 remoting.HostPlugin.prototype.getPairedClients = function(callback) {};
117
118 /** @param {function(boolean):void} callback Callback to be called when
119  *      finished.
120  *  @return {void} Nothing.
121  */
122 remoting.HostPlugin.prototype.clearPairedClients = function(callback) {};
123
124 /** @param {string} client Client id of the pairing to be deleted.
125  *  @param {function(boolean):void} callback Callback to be called when
126  *      finished.
127  *  @return {void} Nothing.
128  */
129 remoting.HostPlugin.prototype.deletePairedClient = function(
130     client, callback) {};
131
132 /** @type {number} */ remoting.HostPlugin.prototype.state;
133
134 /** @type {number} */ remoting.HostPlugin.prototype.STARTING;
135 /** @type {number} */ remoting.HostPlugin.prototype.REQUESTED_ACCESS_CODE;
136 /** @type {number} */ remoting.HostPlugin.prototype.RECEIVED_ACCESS_CODE;
137 /** @type {number} */ remoting.HostPlugin.prototype.CONNECTED;
138 /** @type {number} */ remoting.HostPlugin.prototype.DISCONNECTED;
139 /** @type {number} */ remoting.HostPlugin.prototype.DISCONNECTING;
140 /** @type {number} */ remoting.HostPlugin.prototype.ERROR;
141
142 /** @type {string} */ remoting.HostPlugin.prototype.accessCode;
143 /** @type {number} */ remoting.HostPlugin.prototype.accessCodeLifetime;
144
145 /** @type {string} */ remoting.HostPlugin.prototype.client;
146
147 /** @type {remoting.HostController.State} */
148 remoting.HostPlugin.prototype.daemonState;
149
150 /** @type {function(boolean):void} */
151 remoting.HostPlugin.prototype.onNatTraversalPolicyChanged;
152
153 /** @type {string} */ remoting.HostPlugin.prototype.xmppServerAddress;
154 /** @type {boolean} */ remoting.HostPlugin.prototype.xmppServerUseTls;
155 /** @type {string} */ remoting.HostPlugin.prototype.directoryBotJid;
156 /** @type {string} */ remoting.HostPlugin.prototype.supportedFeatures;
157
158
159 /** @constructor
160  *  @extends HTMLEmbedElement
161  */
162 remoting.ViewerPlugin = function() { };
163
164 /** @param {string} message The message to send to the host. */
165 remoting.ViewerPlugin.prototype.postMessage = function(message) {};
166
167
168 /** @constructor
169  */
170 remoting.WcsIqClient = function() {};
171
172 /** @param {function(Array.<string>): void} onMsg The function called when a
173  *      message is received.
174  *  @return {void} Nothing. */
175 remoting.WcsIqClient.prototype.setOnMessage = function(onMsg) {};
176
177 /** @return {void} Nothing. */
178 remoting.WcsIqClient.prototype.connectChannel = function() {};
179
180 /** @param {string} stanza An IQ stanza.
181  *  @return {void} Nothing. */
182 remoting.WcsIqClient.prototype.sendIq = function(stanza) {};
183
184 /** @param {string} token An OAuth2 access token.
185  *  @return {void} Nothing. */
186 remoting.WcsIqClient.prototype.updateAccessToken = function(token) {};