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

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5  /* Copyright © 2013 Deutsche Telekom, Inc. */
     7 [NoInterfaceObject,
     8  Func="Navigator::HasNfcManagerSupport"]
     9 interface MozNfcManager {
    10    /**
    11     * API to check if the given application's manifest
    12     * URL is registered with the Chrome Process or not.
    13     *
    14     * Returns success if given manifestUrl is registered for 'onpeerready',
    15     * otherwise error
    16     */
    17    DOMRequest checkP2PRegistration(DOMString manifestUrl);
    19    /**
    20     * Notify that user has accepted to share nfc message on P2P UI
    21     */
    22    void notifyUserAcceptedP2P(DOMString manifestUrl);
    24    /**
    25     * Notify the status of sendFile operation
    26     */
    27    void notifySendFileStatus(octet status, DOMString requestId);
    29    /**
    30     * Power on the NFC hardware and start polling for NFC tags or devices.
    31     */
    32    DOMRequest startPoll();
    34    /**
    35     * Stop polling for NFC tags or devices. i.e. enter low power mode.
    36     */
    37    DOMRequest stopPoll();
    39    /**
    40     * Power off the NFC hardware.
    41     */
    42    DOMRequest powerOff();
    43 };
    45 [JSImplementation="@mozilla.org/navigatorNfc;1",
    46  NavigatorProperty="mozNfc",
    47  Func="Navigator::HasNfcSupport"]
    48 interface MozNfc : EventTarget {
    49    MozNFCTag getNFCTag(DOMString sessionId);
    50    MozNFCPeer getNFCPeer(DOMString sessionId);
    52    [Func="Navigator::HasNfcPeerSupport"]
    53    attribute EventHandler onpeerready;
    54    [Func="Navigator::HasNfcPeerSupport"]
    55    attribute EventHandler onpeerlost;
    56 };
    58 // Mozilla Only
    59 partial interface MozNfc {
    60    [ChromeOnly]
    61    void eventListenerWasAdded(DOMString aType);
    62    [ChromeOnly]
    63    void eventListenerWasRemoved(DOMString aType);
    64 };
    66 MozNfc implements MozNfcManager;

mercurial