gecko/dom/webidl/MozNFCTag.webidl
Yoshi Huang 7083269cb4 Bug 1115676 - update contractID for mozNFC. r=smaug, dimi
From 84d5d3ccb88ea78ea65cd38cf5e17da145338d61 Mon Sep 17 00:00:00 2001
---
 dom/nfc/nsNfc.js             | 6 +++---
 dom/nfc/nsNfc.manifest       | 6 +++---
 dom/webidl/MozNFC.webidl     | 2 +-
 dom/webidl/MozNFCPeer.webidl | 2 +-
 dom/webidl/MozNFCTag.webidl  | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)
2014-12-26 20:57:11 +08:00

107 lines
2.2 KiB
Plaintext

/* 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 is from:
* http://w3c.github.io/nfc/proposals/common/nfc.html#nfctag-interface
*
* Copyright © 2013 Deutsche Telekom, Inc.
*/
enum NFCTechType {
"NFC_A",
"NFC_B",
"NFC_F",
"NFC_V",
"NFC_ISO_DEP",
"MIFARE_CLASSIC",
"MIFARE_ULTRALIGHT",
"NFC_BARCODE"
};
/**
* The enumeration of the types of the tag, the type of a tag could be either
* one of those types defined in NFC Forum (type1 ~ type 4), or it could be a
* NXP-specific tag, like Mifare Classic.
*/
enum NFCTagType {
"type1",
"type2",
"type3",
"type4",
"mifare_classic"
};
[JSImplementation="@mozilla.org/nfc/tag;1", AvailableIn="PrivilegedApps"]
interface MozNFCTag {
/**
* The supported technologies of this tag, null if unknown.
*/
[Cached, Pure] readonly attribute sequence<NFCTechType>? techList;
/**
* The identifier of this tag.
*/
[Pure, Constant] readonly attribute Uint8Array? id;
/**
* The type of this tag, null if unknown.
*/
readonly attribute NFCTagType? type;
/**
* The maximum size of the NDEF supported on this tag, null if unknown.
*/
readonly attribute long? maxNDEFSize;
/**
* Indicate if this tag is Read-Only, null if unknown.
*/
readonly attribute boolean? isReadOnly;
/**
* Indicate if this tag is formatable, null if unknown.
*/
readonly attribute boolean? isFormatable;
/**
* Indicate if this tag could be made Read-Only, null if unknown.
*/
readonly attribute boolean? canBeMadeReadOnly;
/**
* Read current NDEF data on the tag.
*/
[Throws]
Promise<sequence<MozNDEFRecord>> readNDEF();
/**
* Write NDEF data to the tag.
*/
[Throws]
Promise<void> writeNDEF(sequence<MozNDEFRecord> records);
/**
* Make a tag read-only.
*/
[Throws]
Promise<void> makeReadOnly();
/**
* Format a tag as NDEF.
*/
[Throws]
Promise<void> format();
};
// Mozilla Only
partial interface MozNFCTag {
[ChromeOnly]
attribute DOMString session;
/**
* Indicate if this tag is already lost.
*/
readonly attribute boolean isLost;
};