Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | enum WPSMethod { |
michael@0 | 6 | "pbc", |
michael@0 | 7 | "keypad", |
michael@0 | 8 | "display" |
michael@0 | 9 | }; |
michael@0 | 10 | |
michael@0 | 11 | dictionary WPSInfo { |
michael@0 | 12 | WPSMethod method; |
michael@0 | 13 | DOMString pin; |
michael@0 | 14 | }; |
michael@0 | 15 | |
michael@0 | 16 | [JSImplementation="@mozilla.org/wifip2pgroupowner;1", |
michael@0 | 17 | Func="Navigator::HasWifiManagerSupport"] |
michael@0 | 18 | interface MozWifiP2pGroupOwner { |
michael@0 | 19 | readonly attribute DOMString groupName; |
michael@0 | 20 | readonly attribute DOMString macAddress; |
michael@0 | 21 | readonly attribute DOMString ipAddress; |
michael@0 | 22 | readonly attribute DOMString passphrase; |
michael@0 | 23 | readonly attribute DOMString ssid; |
michael@0 | 24 | readonly attribute any wpsCapabilities; |
michael@0 | 25 | readonly attribute unsigned long freq; |
michael@0 | 26 | readonly attribute boolean isLocal; |
michael@0 | 27 | }; |
michael@0 | 28 | |
michael@0 | 29 | [JSImplementation="@mozilla.org/wifip2pmanager;1", |
michael@0 | 30 | NavigatorProperty="mozWifiP2pManager", |
michael@0 | 31 | Func="Navigator::HasWifiManagerSupport"] |
michael@0 | 32 | interface MozWifiP2pManager : EventTarget |
michael@0 | 33 | { |
michael@0 | 34 | /** |
michael@0 | 35 | * Enable/Disable wifi direct scan. |
michael@0 | 36 | * |
michael@0 | 37 | * onsuccess: Succeeded in starting/stopping wifi direct scan. |
michael@0 | 38 | * onerror: Failed to start/stop wifi direct scan. |
michael@0 | 39 | * |
michael@0 | 40 | */ |
michael@0 | 41 | DOMRequest setScanEnabled(boolean enabled); |
michael@0 | 42 | |
michael@0 | 43 | /** |
michael@0 | 44 | * Connect to a peer with given configuration. |
michael@0 | 45 | * |
michael@0 | 46 | * @param address The peer MAC address we are going to connect. |
michael@0 | 47 | * @param wpsMethod The WPS method we want to use. |
michael@0 | 48 | * @param goIntent Number from 0 ~ 15 to indicate how much we want to be |
michael@0 | 49 | * the group owner. |
michael@0 | 50 | * |
michael@0 | 51 | * onsuccess: Succeeded in issueing a 'connect' request. It doesn't mean we |
michael@0 | 52 | * have connected to the peer. |
michael@0 | 53 | * |
michael@0 | 54 | * onerror: Failed to issue a 'connect' request, probably due to an |
michael@0 | 55 | * invalid peer address, unsupported wps method or any |
michael@0 | 56 | * preliminary error. |
michael@0 | 57 | * |
michael@0 | 58 | **/ |
michael@0 | 59 | DOMRequest connect(DOMString address, WPSMethod wpsMethod, optional byte goIntent); |
michael@0 | 60 | |
michael@0 | 61 | /** |
michael@0 | 62 | * Disconnect with a peer. |
michael@0 | 63 | * |
michael@0 | 64 | * @param address The mac address of the peer. |
michael@0 | 65 | * |
michael@0 | 66 | * onsuccess: Succeeded to issue a 'disconnect' request. It doesn't mean we |
michael@0 | 67 | * have disconnected with the peer. |
michael@0 | 68 | * |
michael@0 | 69 | * onerror: Failed to issue a 'disconnect' request, probably due to the |
michael@0 | 70 | * invalid peer address or any preliminary error. |
michael@0 | 71 | * |
michael@0 | 72 | */ |
michael@0 | 73 | DOMRequest disconnect(DOMString address); |
michael@0 | 74 | |
michael@0 | 75 | /** |
michael@0 | 76 | * Get peer list |
michael@0 | 77 | * |
michael@0 | 78 | * onsuccess: Command success, req.result contains an array of peer objects. |
michael@0 | 79 | * onerror: Command failed. |
michael@0 | 80 | * |
michael@0 | 81 | * Peer object format: |
michael@0 | 82 | * .address MAC address of the peer (string) |
michael@0 | 83 | * .name the peer's device name (string) |
michael@0 | 84 | * .isGroupOwner if the peer is the group owner (boolean) |
michael@0 | 85 | * .wpsCapabilities array of the supported |WPSMethod| |
michael@0 | 86 | * .connectionStatus one of { "disconnected", "connecting", "connected", "disconnecting" } |
michael@0 | 87 | * |
michael@0 | 88 | */ |
michael@0 | 89 | DOMRequest getPeerList(); |
michael@0 | 90 | |
michael@0 | 91 | /** |
michael@0 | 92 | * Set pairing confirmation result. |
michael@0 | 93 | * |
michael@0 | 94 | * @param accepted Boolean to indicate whether we accepted the request or not. |
michael@0 | 95 | * @param pin The user input pin number if the wps method is keypad. |
michael@0 | 96 | * |
michael@0 | 97 | * onsuccess: Command succeeded. |
michael@0 | 98 | * onerror: Command failed. |
michael@0 | 99 | * |
michael@0 | 100 | */ |
michael@0 | 101 | DOMRequest setPairingConfirmation(boolean accepted, optional DOMString pin); |
michael@0 | 102 | |
michael@0 | 103 | /** |
michael@0 | 104 | * Set device name. |
michael@0 | 105 | * |
michael@0 | 106 | * @param devieName The new device name we are going to set. |
michael@0 | 107 | * |
michael@0 | 108 | * onsuccess: Command succeeded. |
michael@0 | 109 | * onerror: Command failed. |
michael@0 | 110 | * |
michael@0 | 111 | */ |
michael@0 | 112 | DOMRequest setDeviceName(DOMString deviceName); |
michael@0 | 113 | |
michael@0 | 114 | /** |
michael@0 | 115 | * Returns if Wifi Direct is enabled. |
michael@0 | 116 | * |
michael@0 | 117 | */ |
michael@0 | 118 | readonly attribute boolean enabled; |
michael@0 | 119 | |
michael@0 | 120 | /** |
michael@0 | 121 | * The current group owner, null if none. |
michael@0 | 122 | */ |
michael@0 | 123 | readonly attribute MozWifiP2pGroupOwner? groupOwner; |
michael@0 | 124 | |
michael@0 | 125 | /** |
michael@0 | 126 | * An event listener that is called whenever the Wifi Direct peer list is |
michael@0 | 127 | * updated. Use getPeerList() to get the up-to-date peer list. |
michael@0 | 128 | */ |
michael@0 | 129 | attribute EventHandler onpeerinfoupdate; |
michael@0 | 130 | |
michael@0 | 131 | /** |
michael@0 | 132 | * An event listener that is called whenever Wifi Direct status changed. |
michael@0 | 133 | * The address of the changed peer will be stored in event.peerList. |
michael@0 | 134 | * See MozWifiP2pStatusChangeEvent.webidl. |
michael@0 | 135 | */ |
michael@0 | 136 | attribute EventHandler onstatuschange; |
michael@0 | 137 | |
michael@0 | 138 | /** |
michael@0 | 139 | * An event listener that is called whenever Wifi Direct is enabled. |
michael@0 | 140 | */ |
michael@0 | 141 | attribute EventHandler onenabled; |
michael@0 | 142 | |
michael@0 | 143 | /** |
michael@0 | 144 | * An event listener that is called whenever Wifi Direct is disabled. |
michael@0 | 145 | */ |
michael@0 | 146 | attribute EventHandler ondisabled; |
michael@0 | 147 | }; |