2013-11-06 21:36:19 +04:00
|
|
|
/* 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/.
|
|
|
|
*
|
|
|
|
* Part of this IDL file is from:
|
|
|
|
* http://w3c.github.io/nfc/proposals/common/nfc.html#idl-def-NFCPeer
|
|
|
|
*
|
|
|
|
* Copyright © 2013 Deutsche Telekom, Inc.
|
|
|
|
*/
|
|
|
|
|
2014-12-26 15:57:11 +03:00
|
|
|
[JSImplementation="@mozilla.org/nfc/peer;1", AvailableIn="PrivilegedApps"]
|
2013-11-06 21:36:19 +04:00
|
|
|
interface MozNFCPeer {
|
2014-12-31 12:08:17 +03:00
|
|
|
/**
|
|
|
|
* Indicate if this peer is already lost.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean isLost;
|
|
|
|
|
2014-11-21 12:54:04 +03:00
|
|
|
/**
|
|
|
|
* Send NDEF data to peer device.
|
|
|
|
*/
|
2014-07-29 07:36:58 +04:00
|
|
|
[Throws]
|
2014-11-21 12:54:04 +03:00
|
|
|
Promise<void> sendNDEF(sequence<MozNDEFRecord> records);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send file to peer device.
|
|
|
|
*/
|
2014-12-05 02:55:14 +03:00
|
|
|
[Throws, CheckPermissions="nfc-share", AvailableIn="CertifiedApps"]
|
2014-11-21 12:54:04 +03:00
|
|
|
Promise<void> sendFile(Blob blob);
|
2013-11-06 21:36:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// Mozilla Only
|
|
|
|
partial interface MozNFCPeer {
|
|
|
|
[ChromeOnly]
|
|
|
|
attribute DOMString session;
|
2014-10-29 06:15:11 +03:00
|
|
|
|
2014-12-31 12:08:17 +03:00
|
|
|
[ChromeOnly]
|
|
|
|
void notifyLost();
|
2013-11-06 21:36:19 +04:00
|
|
|
};
|