dom/webidl/MozNfc.webidl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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 /* Copyright © 2013 Deutsche Telekom, Inc. */
michael@0 6
michael@0 7 [NoInterfaceObject,
michael@0 8 Func="Navigator::HasNfcManagerSupport"]
michael@0 9 interface MozNfcManager {
michael@0 10 /**
michael@0 11 * API to check if the given application's manifest
michael@0 12 * URL is registered with the Chrome Process or not.
michael@0 13 *
michael@0 14 * Returns success if given manifestUrl is registered for 'onpeerready',
michael@0 15 * otherwise error
michael@0 16 */
michael@0 17 DOMRequest checkP2PRegistration(DOMString manifestUrl);
michael@0 18
michael@0 19 /**
michael@0 20 * Notify that user has accepted to share nfc message on P2P UI
michael@0 21 */
michael@0 22 void notifyUserAcceptedP2P(DOMString manifestUrl);
michael@0 23
michael@0 24 /**
michael@0 25 * Notify the status of sendFile operation
michael@0 26 */
michael@0 27 void notifySendFileStatus(octet status, DOMString requestId);
michael@0 28
michael@0 29 /**
michael@0 30 * Power on the NFC hardware and start polling for NFC tags or devices.
michael@0 31 */
michael@0 32 DOMRequest startPoll();
michael@0 33
michael@0 34 /**
michael@0 35 * Stop polling for NFC tags or devices. i.e. enter low power mode.
michael@0 36 */
michael@0 37 DOMRequest stopPoll();
michael@0 38
michael@0 39 /**
michael@0 40 * Power off the NFC hardware.
michael@0 41 */
michael@0 42 DOMRequest powerOff();
michael@0 43 };
michael@0 44
michael@0 45 [JSImplementation="@mozilla.org/navigatorNfc;1",
michael@0 46 NavigatorProperty="mozNfc",
michael@0 47 Func="Navigator::HasNfcSupport"]
michael@0 48 interface MozNfc : EventTarget {
michael@0 49 MozNFCTag getNFCTag(DOMString sessionId);
michael@0 50 MozNFCPeer getNFCPeer(DOMString sessionId);
michael@0 51
michael@0 52 [Func="Navigator::HasNfcPeerSupport"]
michael@0 53 attribute EventHandler onpeerready;
michael@0 54 [Func="Navigator::HasNfcPeerSupport"]
michael@0 55 attribute EventHandler onpeerlost;
michael@0 56 };
michael@0 57
michael@0 58 // Mozilla Only
michael@0 59 partial interface MozNfc {
michael@0 60 [ChromeOnly]
michael@0 61 void eventListenerWasAdded(DOMString aType);
michael@0 62 [ChromeOnly]
michael@0 63 void eventListenerWasRemoved(DOMString aType);
michael@0 64 };
michael@0 65
michael@0 66 MozNfc implements MozNfcManager;

mercurial