mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
265 lines
6.7 KiB
Plaintext
265 lines
6.7 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/. */
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
interface nsIVariant;
|
|
interface nsIDOMWindow;
|
|
|
|
[scriptable, uuid(9b43bdda-52f4-4712-b28c-ad7cba736e14)]
|
|
interface nsINfcTagEvent : nsISupports
|
|
{
|
|
readonly attribute nsIVariant techList;
|
|
|
|
// one of NFCTagType defined in MozNFCTag.webidl.
|
|
readonly attribute DOMString tagType;
|
|
|
|
readonly attribute long maxNDEFSize;
|
|
|
|
readonly attribute boolean isReadOnly;
|
|
|
|
readonly attribute boolean isFormatable;
|
|
};
|
|
|
|
[scriptable, uuid(fcbd98d6-3d04-4657-bd64-1164e311b399)]
|
|
interface nsINfcEventListener : nsISupports
|
|
{
|
|
/**
|
|
* Callback function used to notify tagfound.
|
|
*
|
|
* @param sessionToken
|
|
* SessionToken received from parent process
|
|
* @param event
|
|
* nsINfcTagFoundEvent received from parent process.
|
|
* @param ndefRecords
|
|
* NDEF records pre-read during tag-discovered.
|
|
*/
|
|
void notifyTagFound(in DOMString sessionToken,
|
|
in nsINfcTagEvent event,
|
|
in nsIVariant ndefRecords);
|
|
|
|
/**
|
|
* Callback function used to notify taglost.
|
|
*
|
|
* @param sessionToken
|
|
* SessionToken received from parent process
|
|
*/
|
|
void notifyTagLost(in DOMString sessionToken);
|
|
|
|
/**
|
|
* Callback function used to notify peerfound/peerready.
|
|
* @param sessionToken
|
|
* SessionToken received from parent process
|
|
* @param isPeerReady
|
|
* Set to true to dispatch peerready instead of peerfound
|
|
*/
|
|
void notifyPeerFound(in DOMString sessionToken, [optional] in boolean isPeerReady);
|
|
|
|
/**
|
|
* Callback function used to notify peerlost.
|
|
*
|
|
* @param sessionToken
|
|
* SessionToken received from parent process
|
|
*/
|
|
void notifyPeerLost(in DOMString sessionToken);
|
|
|
|
/**
|
|
* Callback function used to notify RF state change.
|
|
*
|
|
* @param rfState
|
|
* RF state received from parent process
|
|
*/
|
|
void notifyRFStateChange(in DOMString rfState);
|
|
};
|
|
|
|
[scriptable, uuid(a8ef3590-d853-4766-b54a-a4547da4dde4)]
|
|
interface nsINfcRequestCallback : nsISupports
|
|
{
|
|
DOMString getCallbackId();
|
|
|
|
void notifySuccess();
|
|
|
|
void notifySuccessWithBoolean(in boolean result);
|
|
|
|
void notifySuccessWithNDEFRecords(in nsIVariant records);
|
|
|
|
void notifyError(in DOMString errorMsg);
|
|
};
|
|
|
|
[scriptable, uuid(c5fdf956-735e-45d3-aa25-3a871bd3e2f8)]
|
|
interface nsINfcContentHelper : nsISupports
|
|
{
|
|
void init(in nsIDOMWindow window);
|
|
|
|
/**
|
|
* Read current NDEF data on the tag.
|
|
*
|
|
* @param sessionToken
|
|
* Current token
|
|
*
|
|
* @param callback
|
|
* Called when request is finished
|
|
*/
|
|
void readNDEF(in DOMString sessionToken,
|
|
in nsINfcRequestCallback callback);
|
|
|
|
/**
|
|
* Write NDEF data to a peer device or a tag.
|
|
*
|
|
* @param records
|
|
* NDEF records to be written
|
|
*
|
|
* @param sessionToken
|
|
* Current token
|
|
*
|
|
* @param callback
|
|
* Called when request is finished
|
|
*/
|
|
void writeNDEF(in nsIVariant records,
|
|
in DOMString sessionToken,
|
|
in nsINfcRequestCallback callback);
|
|
|
|
/**
|
|
* Make a tag read-only
|
|
*
|
|
* @param sessionToken
|
|
* Current token
|
|
*
|
|
* @param callback
|
|
* Called when request is finished
|
|
*/
|
|
void makeReadOnly(in DOMString sessionToken,
|
|
in nsINfcRequestCallback callback);
|
|
|
|
/**
|
|
* Format a tag as NDEF
|
|
*
|
|
* @param sessionToken
|
|
* Current token
|
|
*
|
|
* @param callback
|
|
* Called when request is finished
|
|
*/
|
|
void format(in DOMString sessionToken,
|
|
in nsINfcRequestCallback callback);
|
|
|
|
/**
|
|
* Enable I/O operations to the tag
|
|
*
|
|
* @param techType
|
|
* Interface to a technology in a Tag
|
|
*
|
|
* @param sessionToken
|
|
* Current token
|
|
*
|
|
* @param callback
|
|
* Called when request is finished
|
|
*/
|
|
void connect(in unsigned long techType,
|
|
in DOMString sessionToken,
|
|
in nsINfcRequestCallback callback);
|
|
|
|
/**
|
|
* Disable I/O operations to the tag
|
|
*
|
|
* @param sessionToken
|
|
* Current token
|
|
*
|
|
* @param callback
|
|
* Called when request is finished
|
|
*/
|
|
void close(in DOMString sessionToken,
|
|
in nsINfcRequestCallback callback);
|
|
|
|
/**
|
|
* Get current RF state.
|
|
*/
|
|
DOMString queryRFState();
|
|
|
|
/**
|
|
* Initiate send file operation.
|
|
*
|
|
* @param blob
|
|
* Raw data of the file to be sent. This object represents a file-like
|
|
* (nsIDOMFile) object of immutable, raw data. The blob data needs
|
|
* to be 'object wrapped' before calling this interface.
|
|
*
|
|
* @param sessionToken
|
|
* Current token
|
|
*
|
|
* @param callback
|
|
* Called when request is finished
|
|
*/
|
|
void sendFile(in jsval blob,
|
|
in DOMString sessionToken,
|
|
in nsINfcRequestCallback callback);
|
|
|
|
/**
|
|
* Add the event listener.
|
|
*
|
|
* @param listener
|
|
* An instance of the nsINfcEventListener.
|
|
*/
|
|
void addEventListener(in nsINfcEventListener listener);
|
|
|
|
/**
|
|
* Register the given application id with parent process
|
|
*
|
|
* @param appId
|
|
* Application ID to be registered
|
|
*/
|
|
void registerTargetForPeerReady(in unsigned long appId);
|
|
|
|
/**
|
|
* Unregister the given application id with parent process
|
|
*
|
|
* @param appId
|
|
* Application ID to be registered
|
|
*/
|
|
void unregisterTargetForPeerReady(in unsigned long appId);
|
|
|
|
/**
|
|
* Checks if the given application's id is a registered peer target (with the parent process)
|
|
*
|
|
* @param appId
|
|
* Application ID to be updated with parent process
|
|
*
|
|
* @param callback
|
|
* Called when request is finished
|
|
*/
|
|
void checkP2PRegistration(in unsigned long appId,
|
|
in nsINfcRequestCallback callback);
|
|
|
|
/**
|
|
* Notify the parent process that user has accepted to share nfc message on P2P UI
|
|
*
|
|
* @param appId
|
|
* Application ID that is capable of handling NFC_EVENT_PEER_READY event
|
|
*/
|
|
void notifyUserAcceptedP2P(in unsigned long appId);
|
|
|
|
/**
|
|
* Notify the status of sendFile operation to parent process
|
|
*
|
|
* @param status
|
|
* Status of sendFile operation
|
|
*
|
|
* @param requestId
|
|
* Request ID of SendFile DOM Request
|
|
*/
|
|
void notifySendFileStatus(in octet status,
|
|
in DOMString requestId);
|
|
|
|
/**
|
|
* Change RF state.
|
|
*
|
|
* @param rfState. Possible values are 'idle', 'listen' and 'discovery'.
|
|
*
|
|
* @param callback
|
|
* Called when request is finished
|
|
*/
|
|
void changeRFState(in DOMString rfState,
|
|
in nsINfcRequestCallback callback);
|
|
};
|