gecko/dom/system/gonk/nsIRadioInterfaceLayer.idl

297 lines
8.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/. */
#include "nsISupports.idl"
#include "nsIMobileConnectionProvider.idl"
interface nsIDOMMozMobileConnectionInfo;
interface nsIDOMDOMRequest;
interface nsIDOMWindow;
interface nsIDOMMozVoicemailStatus;
[scriptable, uuid(c14c71b8-afba-403b-8320-94593de9380f)]
interface nsIRILTelephonyCallback : nsISupports
{
/**
* Notified when a telephony call changes state.
*
* @param callIndex
* Call identifier assigned by the RIL.
* @param callState
* One of the nsIRadioInterfaceLayer::CALL_STATE_* values.
* @param number
* Number of the other party.
* @param isActive
* Indicates whether this call is the currently active one.
*/
void callStateChanged(in unsigned long callIndex,
in unsigned short callState,
in AString number,
in boolean isActive);
/**
* Called when nsIRILContentHelper is asked to enumerate the current
* telephony call state (nsIRILContentHelper::enumerateCalls). This is
* called once per call that is currently managed by the RIL.
*
* @param callIndex
* Call identifier assigned by the RIL.
* @param callState
* One of the nsIRadioInterfaceLayer::CALL_STATE_* values.
* @param number
* Number of the other party.
* @param isActive
* Indicates whether this call is the active one.
*
* @return true to continue enumeration or false to cancel.
*/
boolean enumerateCallState(in unsigned long callIndex,
in unsigned short callState,
in AString number,
in boolean isActive);
/**
* Called when RIL error occurs.
*
* @param callIndex
* Call identifier assigned by the RIL. -1 if no connection
* @param error
* Error from RIL.
*/
void notifyError(in long callIndex,
in AString error);
};
[scriptable, uuid(521cfe4a-bf79-4134-a9fc-e2242164d657)]
interface nsIRILVoicemailCallback : nsISupports
{
/**
* Called when a voicemail notification has been received by the network.
*
* @param status
* The new voicemail status
*/
void voicemailNotification(in nsIDOMMozVoicemailStatus status);
};
[scriptable, uuid(8a711703-1ee5-4675-9d9a-0b188e944cfe)]
interface nsIRILDataCallInfo : nsISupports
{
/**
* Current data call state, one of the
* nsINetworkInterface::NETWORK_STATE_* constants.
*/
readonly attribute unsigned long state;
readonly attribute AString cid;
readonly attribute AString apn;
readonly attribute AString ifname;
};
[scriptable, uuid(5bcac053-c245-46f0-bb45-d0039bfb89f5)]
interface nsIRILDataCallback : nsISupports
{
/**
* Notified when a data call changes state.
*
* @param dataCall
* A nsIRILDataCallInfo object.
*/
void dataCallStateChanged(in nsIRILDataCallInfo dataCall);
/**
* Called when nsIRadioInterfaceLayer is asked to enumerate the current
* data call state.
*
* @param datacalls
* Array of nsIRILDataCallInfo objects.
* @param length
* Lenght of the aforementioned array.
*/
void receiveDataCallList([array,size_is(length)] in nsIRILDataCallInfo dataCalls,
in unsigned long length);
};
[scriptable, function, uuid(2bc2f51a-78be-4c0e-95dd-55a3ce2ded40)]
interface nsIRILContactCallback : nsISupports
{
/**
* Called when nsIRadioInterfaceLayer is asked to provide ICC contacts.
*
* @param type
* Type of the dialling number, i.e. ADN, FDN.
* @param contacts
* Array of the ICC contacts of the specified type.
*/
void receiveContactsList(in DOMString type, in jsval contacts);
};
/**
* Helper that runs in the content process and exposes information
* to the DOM.
*/
[scriptable, uuid(d2ec602f-9746-4ada-b0c6-f1c1a3cf3578)]
interface nsIRILContentHelper : nsIMobileConnectionProvider
{
void registerTelephonyCallback(in nsIRILTelephonyCallback callback);
void unregisterTelephonyCallback(in nsIRILTelephonyCallback callback);
void registerVoicemailCallback(in nsIRILVoicemailCallback callback);
void unregisterVoicemailCallback(in nsIRILVoicemailCallback callback);
/**
* Will continue calling callback.enumerateCallState until the callback
* returns false.
*/
void enumerateCalls(in nsIRILTelephonyCallback callback);
/**
* Functionality for making and managing phone calls.
*/
void dial(in DOMString number);
void hangUp(in unsigned long callIndex);
void startTone(in DOMString dtmfChar);
void stopTone();
void answerCall(in unsigned long callIndex);
void rejectCall(in unsigned long callIndex);
void holdCall(in unsigned long callIndex);
void resumeCall(in unsigned long callIndex);
attribute bool microphoneMuted;
attribute bool speakerEnabled;
readonly attribute nsIDOMMozVoicemailStatus voicemailStatus;
readonly attribute DOMString voicemailNumber;
readonly attribute DOMString voicemailDisplayName;
};
[scriptable, uuid(fd9e8b38-b839-4d56-8482-3bf1f5c8f2ee)]
interface nsIICCRecords : nsISupports
{
/**
* Mobile Subscriber ISDN Number
*/
readonly attribute DOMString msisdn;
/**
* Administrative Data
*/
readonly attribute jsval ad;
/**
* International Mobile Subscriber Identity
*/
readonly attribute DOMString imsi;
/**
* Mobile Country Code
*/
readonly attribute unsigned short mcc;
/**
* Mobile Network Code
*/
readonly attribute unsigned short mnc;
/**
* USIM Service Table
*/
readonly attribute jsval ust;
/**
* Abbreviated dialling numbers
*/
readonly attribute jsval adn;
/**
* Fixed Dialling Numbers
*/
readonly attribute jsval fdn;
};
[scriptable, uuid(1b47459d-d0bc-4e91-8509-cc106054b9ee)]
interface nsICellLocation : nsISupports
{
/**
* Location Area Code
*/
readonly attribute unsigned short lac;
/**
* Cell Identity
*/
readonly attribute unsigned long cid;
};
[scriptable, uuid(a6f6977e-f4ee-42b4-ae79-798c8c47c360)]
interface nsIRilContext : nsISupports
{
readonly attribute DOMString radioState;
readonly attribute DOMString cardState;
readonly attribute nsIICCRecords icc;
readonly attribute nsICellLocation cell;
readonly attribute nsIDOMMozMobileConnectionInfo voice;
readonly attribute nsIDOMMozMobileConnectionInfo data;
};
[scriptable, uuid(8b649965-6687-46a8-88fa-a5495ce90735)]
interface nsIRadioInterfaceLayer : nsISupports
{
const unsigned short CALL_STATE_UNKNOWN = 0;
const unsigned short CALL_STATE_DIALING = 1;
const unsigned short CALL_STATE_ALERTING = 2;
const unsigned short CALL_STATE_BUSY = 3;
const unsigned short CALL_STATE_CONNECTING = 4;
const unsigned short CALL_STATE_CONNECTED = 5;
const unsigned short CALL_STATE_HOLDING = 6;
const unsigned short CALL_STATE_HELD = 7;
const unsigned short CALL_STATE_RESUMING = 8;
const unsigned short CALL_STATE_DISCONNECTING = 9;
const unsigned short CALL_STATE_DISCONNECTED = 10;
const unsigned short CALL_STATE_INCOMING = 11;
/**
* Activates or deactivates radio power.
*/
void setRadioEnabled(in bool value);
readonly attribute nsIRilContext rilContext;
/**
* PDP APIs
*/
void setupDataCall(in long radioTech,
in DOMString apn,
in DOMString user,
in DOMString passwd,
in long chappap,
in DOMString pdptype);
void deactivateDataCall(in DOMString cid,
in DOMString reason);
void getDataCallList();
void registerDataCallCallback(in nsIRILDataCallback callback);
void unregisterDataCallCallback(in nsIRILDataCallback callback);
/**
* SMS-related functionality.
*/
unsigned short getNumberOfMessagesForText(in DOMString text);
void sendSMS(in DOMString number,
in DOMString message,
in long requestId,
in unsigned long long processId);
/**
* ICC-related functionality.
*/
void getICCContacts(in DOMString type, in nsIRILContactCallback callback);
};