2013-11-06 09:36:19 -08: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 04:57:11 -08:00
|
|
|
[JSImplementation="@mozilla.org/nfc/peer;1", AvailableIn="PrivilegedApps"]
|
2013-11-06 09:36:19 -08:00
|
|
|
interface MozNFCPeer {
|
2014-12-31 01:08:17 -08:00
|
|
|
/**
|
|
|
|
* Indicate if this peer is already lost.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean isLost;
|
|
|
|
|
2014-11-21 01:54:04 -08:00
|
|
|
/**
|
|
|
|
* Send NDEF data to peer device.
|
|
|
|
*/
|
2014-07-28 20:36:58 -07:00
|
|
|
[Throws]
|
2014-11-21 01:54:04 -08:00
|
|
|
Promise<void> sendNDEF(sequence<MozNDEFRecord> records);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send file to peer device.
|
|
|
|
*/
|
2014-12-04 15:55:14 -08:00
|
|
|
[Throws, CheckPermissions="nfc-share", AvailableIn="CertifiedApps"]
|
2014-11-21 01:54:04 -08:00
|
|
|
Promise<void> sendFile(Blob blob);
|
2013-11-06 09:36:19 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
// Mozilla Only
|
|
|
|
partial interface MozNFCPeer {
|
|
|
|
[ChromeOnly]
|
|
|
|
attribute DOMString session;
|
2014-10-28 20:15:11 -07:00
|
|
|
|
2014-12-31 01:08:17 -08:00
|
|
|
[ChromeOnly]
|
|
|
|
void notifyLost();
|
2013-11-06 09:36:19 -08:00
|
|
|
};
|