mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
0a8edebc6d
The chrome process is the arbitrator / mediator between the content process that issued the nfc 'sendFile' operation and the system-process (content) that is responsible for performing handover to an alternate carrier(AC). The chrome process notifies the system process through a 'nfc-manager-send-file' system-message to initiate the handover process. The system-process subsequently handovers the data to alternate carrier's (AC's : BT / WiFi) 'sendFile' interface.
122 lines
4.0 KiB
Plaintext
122 lines
4.0 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"
|
|
#include "nsIDOMDOMRequest.idl"
|
|
|
|
interface nsIVariant;
|
|
|
|
[scriptable, function, uuid(26673d1a-4af4-470a-ba96-f1f54b1f2052)]
|
|
interface nsINfcPeerCallback : nsISupports
|
|
{
|
|
/**
|
|
* Callback function used to notify NFC peer events.
|
|
*
|
|
* @param event
|
|
* An event indicating 'PeerReady' or 'PeerLost'
|
|
* One of NFC_EVENT_PEER_XXXX
|
|
*
|
|
* @param sessionToken
|
|
* SessionToken received from Chrome process
|
|
*/
|
|
void peerNotification(in unsigned long event,
|
|
in DOMString sessionToken);
|
|
};
|
|
|
|
[scriptable, uuid(91c2760a-f41c-4174-ad68-614840d4e201)]
|
|
interface nsINfcContentHelper : nsISupports
|
|
{
|
|
const long NFC_EVENT_PEER_READY = 0x01;
|
|
const long NFC_EVENT_PEER_LOST = 0x02;
|
|
|
|
void setSessionToken(in DOMString sessionToken);
|
|
|
|
nsIDOMDOMRequest getDetailsNDEF(in nsIDOMWindow window, in DOMString sessionToken);
|
|
nsIDOMDOMRequest readNDEF(in nsIDOMWindow window, in DOMString sessionToken);
|
|
nsIDOMDOMRequest writeNDEF(in nsIDOMWindow window, in nsIVariant records, in DOMString sessionToken);
|
|
nsIDOMDOMRequest makeReadOnlyNDEF(in nsIDOMWindow window, in DOMString sessionToken);
|
|
|
|
nsIDOMDOMRequest connect(in nsIDOMWindow window, in unsigned long techType, in DOMString sessionToken);
|
|
nsIDOMDOMRequest close(in nsIDOMWindow window, in DOMString sessionToken);
|
|
|
|
/**
|
|
* Initiate Send file operation
|
|
*
|
|
* @param window
|
|
* Current window
|
|
*
|
|
* @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
|
|
*
|
|
* Returns DOMRequest, if initiation of send file operation is successful
|
|
* then 'onsuccess' is called else 'onerror'
|
|
*/
|
|
nsIDOMDOMRequest sendFile(in nsIDOMWindow window,
|
|
in jsval blob,
|
|
in DOMString sessionToken);
|
|
|
|
/**
|
|
* Register the given application id with Chrome process
|
|
*
|
|
* @param window
|
|
* Current window
|
|
*
|
|
* @param appId
|
|
* Application ID to be registered
|
|
*
|
|
* @param event
|
|
* Event to be registered. Either NFC_EVENT_PEER_READY or NFC_EVENT_PEER_LOST
|
|
*
|
|
* @param callback
|
|
* Callback that is used to notify upper layers whenever PeerEvents happen.
|
|
*/
|
|
void registerTargetForPeerEvent(in nsIDOMWindow window,
|
|
in unsigned long appId,
|
|
in octet event,
|
|
in nsINfcPeerCallback callback);
|
|
/**
|
|
* Unregister the given application id with Chrome process
|
|
*
|
|
* @param window
|
|
* Current window
|
|
*
|
|
* @param appId
|
|
* Application ID to be registered
|
|
*
|
|
* @param event
|
|
* Event to be unregistered. Either NFC_EVENT_PEER_READY or NFC_EVENT_PEER_LOST
|
|
*/
|
|
void unregisterTargetForPeerEvent(in nsIDOMWindow window,
|
|
in unsigned long appId,
|
|
in octet event);
|
|
/**
|
|
* Checks if the given application's id is a registered peer target (with the Chrome process)
|
|
*
|
|
* @param window
|
|
* Current window
|
|
*
|
|
* @param appId
|
|
* Application ID to be updated with Chrome process
|
|
*
|
|
* Returns DOMRequest, if appId is registered then 'onsuccess' is called else 'onerror'
|
|
*/
|
|
nsIDOMDOMRequest checkP2PRegistration(in nsIDOMWindow window, in unsigned long appId);
|
|
|
|
/**
|
|
* Notify the Chrome process that user has accepted to share nfc message on P2P UI
|
|
*
|
|
* @param window
|
|
* Current window
|
|
*
|
|
* @param appId
|
|
* Application ID that is capable of handling NFC_EVENT_PEER_READY event
|
|
*/
|
|
void notifyUserAcceptedP2P(in nsIDOMWindow window, in unsigned long appId);
|
|
};
|