dom/webidl/MozNfc.webidl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/webidl/MozNfc.webidl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,66 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 + /* Copyright © 2013 Deutsche Telekom, Inc. */
     1.9 +
    1.10 +[NoInterfaceObject,
    1.11 + Func="Navigator::HasNfcManagerSupport"]
    1.12 +interface MozNfcManager {
    1.13 +   /**
    1.14 +    * API to check if the given application's manifest
    1.15 +    * URL is registered with the Chrome Process or not.
    1.16 +    *
    1.17 +    * Returns success if given manifestUrl is registered for 'onpeerready',
    1.18 +    * otherwise error
    1.19 +    */
    1.20 +   DOMRequest checkP2PRegistration(DOMString manifestUrl);
    1.21 +
    1.22 +   /**
    1.23 +    * Notify that user has accepted to share nfc message on P2P UI
    1.24 +    */
    1.25 +   void notifyUserAcceptedP2P(DOMString manifestUrl);
    1.26 +
    1.27 +   /**
    1.28 +    * Notify the status of sendFile operation
    1.29 +    */
    1.30 +   void notifySendFileStatus(octet status, DOMString requestId);
    1.31 +
    1.32 +   /**
    1.33 +    * Power on the NFC hardware and start polling for NFC tags or devices.
    1.34 +    */
    1.35 +   DOMRequest startPoll();
    1.36 +
    1.37 +   /**
    1.38 +    * Stop polling for NFC tags or devices. i.e. enter low power mode.
    1.39 +    */
    1.40 +   DOMRequest stopPoll();
    1.41 +
    1.42 +   /**
    1.43 +    * Power off the NFC hardware.
    1.44 +    */
    1.45 +   DOMRequest powerOff();
    1.46 +};
    1.47 +
    1.48 +[JSImplementation="@mozilla.org/navigatorNfc;1",
    1.49 + NavigatorProperty="mozNfc",
    1.50 + Func="Navigator::HasNfcSupport"]
    1.51 +interface MozNfc : EventTarget {
    1.52 +   MozNFCTag getNFCTag(DOMString sessionId);
    1.53 +   MozNFCPeer getNFCPeer(DOMString sessionId);
    1.54 +
    1.55 +   [Func="Navigator::HasNfcPeerSupport"]
    1.56 +   attribute EventHandler onpeerready;
    1.57 +   [Func="Navigator::HasNfcPeerSupport"]
    1.58 +   attribute EventHandler onpeerlost;
    1.59 +};
    1.60 +
    1.61 +// Mozilla Only
    1.62 +partial interface MozNfc {
    1.63 +   [ChromeOnly]
    1.64 +   void eventListenerWasAdded(DOMString aType);
    1.65 +   [ChromeOnly]
    1.66 +   void eventListenerWasRemoved(DOMString aType);
    1.67 +};
    1.68 +
    1.69 +MozNfc implements MozNfcManager;

mercurial