michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* Copyright © 2013 Deutsche Telekom, Inc. */ michael@0: michael@0: [NoInterfaceObject, michael@0: Func="Navigator::HasNfcManagerSupport"] michael@0: interface MozNfcManager { michael@0: /** michael@0: * API to check if the given application's manifest michael@0: * URL is registered with the Chrome Process or not. michael@0: * michael@0: * Returns success if given manifestUrl is registered for 'onpeerready', michael@0: * otherwise error michael@0: */ michael@0: DOMRequest checkP2PRegistration(DOMString manifestUrl); michael@0: michael@0: /** michael@0: * Notify that user has accepted to share nfc message on P2P UI michael@0: */ michael@0: void notifyUserAcceptedP2P(DOMString manifestUrl); michael@0: michael@0: /** michael@0: * Notify the status of sendFile operation michael@0: */ michael@0: void notifySendFileStatus(octet status, DOMString requestId); michael@0: michael@0: /** michael@0: * Power on the NFC hardware and start polling for NFC tags or devices. michael@0: */ michael@0: DOMRequest startPoll(); michael@0: michael@0: /** michael@0: * Stop polling for NFC tags or devices. i.e. enter low power mode. michael@0: */ michael@0: DOMRequest stopPoll(); michael@0: michael@0: /** michael@0: * Power off the NFC hardware. michael@0: */ michael@0: DOMRequest powerOff(); michael@0: }; michael@0: michael@0: [JSImplementation="@mozilla.org/navigatorNfc;1", michael@0: NavigatorProperty="mozNfc", michael@0: Func="Navigator::HasNfcSupport"] michael@0: interface MozNfc : EventTarget { michael@0: MozNFCTag getNFCTag(DOMString sessionId); michael@0: MozNFCPeer getNFCPeer(DOMString sessionId); michael@0: michael@0: [Func="Navigator::HasNfcPeerSupport"] michael@0: attribute EventHandler onpeerready; michael@0: [Func="Navigator::HasNfcPeerSupport"] michael@0: attribute EventHandler onpeerlost; michael@0: }; michael@0: michael@0: // Mozilla Only michael@0: partial interface MozNfc { michael@0: [ChromeOnly] michael@0: void eventListenerWasAdded(DOMString aType); michael@0: [ChromeOnly] michael@0: void eventListenerWasRemoved(DOMString aType); michael@0: }; michael@0: michael@0: MozNfc implements MozNfcManager;