|
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/. */ |
|
4 |
|
5 /* Copyright © 2013 Deutsche Telekom, Inc. */ |
|
6 |
|
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); |
|
18 |
|
19 /** |
|
20 * Notify that user has accepted to share nfc message on P2P UI |
|
21 */ |
|
22 void notifyUserAcceptedP2P(DOMString manifestUrl); |
|
23 |
|
24 /** |
|
25 * Notify the status of sendFile operation |
|
26 */ |
|
27 void notifySendFileStatus(octet status, DOMString requestId); |
|
28 |
|
29 /** |
|
30 * Power on the NFC hardware and start polling for NFC tags or devices. |
|
31 */ |
|
32 DOMRequest startPoll(); |
|
33 |
|
34 /** |
|
35 * Stop polling for NFC tags or devices. i.e. enter low power mode. |
|
36 */ |
|
37 DOMRequest stopPoll(); |
|
38 |
|
39 /** |
|
40 * Power off the NFC hardware. |
|
41 */ |
|
42 DOMRequest powerOff(); |
|
43 }; |
|
44 |
|
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); |
|
51 |
|
52 [Func="Navigator::HasNfcPeerSupport"] |
|
53 attribute EventHandler onpeerready; |
|
54 [Func="Navigator::HasNfcPeerSupport"] |
|
55 attribute EventHandler onpeerlost; |
|
56 }; |
|
57 |
|
58 // Mozilla Only |
|
59 partial interface MozNfc { |
|
60 [ChromeOnly] |
|
61 void eventListenerWasAdded(DOMString aType); |
|
62 [ChromeOnly] |
|
63 void eventListenerWasRemoved(DOMString aType); |
|
64 }; |
|
65 |
|
66 MozNfc implements MozNfcManager; |