gecko/dom/webidl/MozNfc.webidl
Siddartha Pothapragada a47318a090 Bug 933136 - Part 1: Add Nfc DOM event handlers 'onpeerready' and 'onpeerlost'. r=khuey, sr=smaug
Add new interface 'checkP2PRegistration' to MozNfc and two 'ChromeOnly' interfaces 'eventListenerWasAdded' 'eventListenerWasRemoved' to support basic PeerToPeer use cases.

--HG--
extra : rebase_source : 43f0021b85624d87fdcb5e9445c976bb6efb9219
2013-11-24 20:40:39 -08:00

32 lines
1.0 KiB
Plaintext

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Copyright © 2013 Deutsche Telekom, Inc. */
[JSImplementation="@mozilla.org/navigatorNfc;1",
NavigatorProperty="mozNfc"]
interface MozNfc : EventTarget {
MozNFCTag getNFCTag(DOMString sessionId);
MozNFCPeer getNFCPeer(DOMString sessionId);
/**
* API to check if the given application's manifest
* URL is registered with the Chrome Process or not.
*
* Returns success if given manifestUrl is registered for 'onpeerready',
* otherwise error
*
* Users of this API should have valid permissions 'nfc-manager'
* and 'nfc-write'
*/
DOMRequest checkP2PRegistration(DOMString manifestUrl);
attribute EventHandler onpeerready;
attribute EventHandler onpeerlost;
[ChromeOnly]
void eventListenerWasAdded(DOMString aType);
[ChromeOnly]
void eventListenerWasRemoved(DOMString aType);
};