2012-05-21 04:12:37 -07: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/. */
|
2011-12-04 23:58:27 -08:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
2012-04-19 14:33:25 -07:00
|
|
|
#include "nsIMobileConnectionProvider.idl"
|
|
|
|
|
|
|
|
interface nsIDOMMozMobileConnectionInfo;
|
|
|
|
interface nsIDOMDOMRequest;
|
|
|
|
interface nsIDOMWindow;
|
2012-07-18 20:26:49 -07:00
|
|
|
interface nsIDOMMozVoicemailStatus;
|
2011-12-04 23:58:27 -08:00
|
|
|
|
2012-05-14 21:13:06 -07:00
|
|
|
[scriptable, uuid(c14c71b8-afba-403b-8320-94593de9380f)]
|
2012-01-19 12:53:32 -08:00
|
|
|
interface nsIRILTelephonyCallback : nsISupports
|
2011-12-23 21:02:52 -08:00
|
|
|
{
|
2012-01-19 12:53:32 -08:00
|
|
|
/**
|
|
|
|
* 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.
|
2012-05-14 21:13:06 -07:00
|
|
|
* @param isActive
|
|
|
|
* Indicates whether this call is the currently active one.
|
2012-01-19 12:53:32 -08:00
|
|
|
*/
|
2012-01-09 14:28:47 -08:00
|
|
|
void callStateChanged(in unsigned long callIndex,
|
|
|
|
in unsigned short callState,
|
2012-05-14 21:13:06 -07:00
|
|
|
in AString number,
|
|
|
|
in boolean isActive);
|
2011-12-04 23:58:27 -08:00
|
|
|
|
2012-01-19 12:53:32 -08:00
|
|
|
/**
|
2012-04-24 08:44:42 -07:00
|
|
|
* Called when nsIRILContentHelper is asked to enumerate the current
|
|
|
|
* telephony call state (nsIRILContentHelper::enumerateCalls). This is
|
2012-01-19 12:53:32 -08:00
|
|
|
* 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.
|
|
|
|
*/
|
2012-01-09 14:28:47 -08:00
|
|
|
boolean enumerateCallState(in unsigned long callIndex,
|
|
|
|
in unsigned short callState,
|
|
|
|
in AString number,
|
|
|
|
in boolean isActive);
|
2012-05-14 21:13:06 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
2011-12-04 23:58:27 -08:00
|
|
|
};
|
|
|
|
|
2012-07-20 17:19:38 -07:00
|
|
|
[scriptable, uuid(521cfe4a-bf79-4134-a9fc-e2242164d657)]
|
2012-07-18 20:26:49 -07:00
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
2012-08-13 18:54:42 -07:00
|
|
|
[scriptable, uuid(1e602d20-d066-4399-8997-daf36b3158ef)]
|
2012-01-19 12:53:32 -08:00
|
|
|
interface nsIRILDataCallInfo : nsISupports
|
2012-01-17 17:34:09 -08:00
|
|
|
{
|
2012-06-25 23:43:22 -07:00
|
|
|
/**
|
|
|
|
* Current data call state, one of the
|
|
|
|
* nsINetworkInterface::NETWORK_STATE_* constants.
|
|
|
|
*/
|
2012-06-21 22:53:12 -07:00
|
|
|
readonly attribute unsigned long state;
|
2012-01-17 17:34:09 -08:00
|
|
|
readonly attribute AString cid;
|
|
|
|
readonly attribute AString apn;
|
2012-06-21 22:53:12 -07:00
|
|
|
readonly attribute AString ifname;
|
2012-08-13 18:54:42 -07:00
|
|
|
readonly attribute AString ip;
|
|
|
|
readonly attribute AString netmask;
|
|
|
|
readonly attribute AString broadcast;
|
|
|
|
readonly attribute AString gw;
|
|
|
|
readonly attribute jsval dns;
|
2012-01-17 17:34:09 -08:00
|
|
|
};
|
|
|
|
|
2012-06-21 22:53:12 -07:00
|
|
|
[scriptable, uuid(5bcac053-c245-46f0-bb45-d0039bfb89f5)]
|
2012-01-19 12:53:32 -08:00
|
|
|
interface nsIRILDataCallback : nsISupports
|
2012-01-17 17:34:09 -08:00
|
|
|
{
|
|
|
|
/**
|
2012-01-19 12:53:32 -08:00
|
|
|
* Notified when a data call changes state.
|
2012-01-17 17:34:09 -08:00
|
|
|
*
|
2012-06-21 22:53:12 -07:00
|
|
|
* @param dataCall
|
|
|
|
* A nsIRILDataCallInfo object.
|
2012-01-17 17:34:09 -08:00
|
|
|
*/
|
2012-06-21 22:53:12 -07:00
|
|
|
void dataCallStateChanged(in nsIRILDataCallInfo dataCall);
|
2012-01-17 17:34:09 -08:00
|
|
|
|
2012-01-19 12:53:32 -08:00
|
|
|
/**
|
|
|
|
* 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);
|
2012-01-17 17:34:09 -08:00
|
|
|
};
|
|
|
|
|
2012-09-06 01:10:52 -07:00
|
|
|
[scriptable, function, uuid(a94282b6-da60-4daf-95c1-82ee6889d0df)]
|
2012-05-07 11:53:42 -07:00
|
|
|
interface nsIRILContactCallback : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Called when nsIRadioInterfaceLayer is asked to provide ICC contacts.
|
|
|
|
*
|
2012-09-06 01:10:52 -07:00
|
|
|
* @param errorMsg
|
|
|
|
* error message from RIL.
|
2012-09-05 20:36:12 -07:00
|
|
|
* @param contactType
|
2012-05-07 11:53:42 -07:00
|
|
|
* Type of the dialling number, i.e. ADN, FDN.
|
|
|
|
* @param contacts
|
|
|
|
* Array of the ICC contacts of the specified type.
|
|
|
|
*/
|
2012-09-06 01:10:52 -07:00
|
|
|
void receiveContactsList(in DOMString errorMsg,
|
|
|
|
in DOMString contactType,
|
|
|
|
in jsval contacts);
|
2012-05-07 11:53:42 -07:00
|
|
|
};
|
|
|
|
|
2012-04-19 14:33:25 -07:00
|
|
|
/**
|
|
|
|
* Helper that runs in the content process and exposes information
|
|
|
|
* to the DOM.
|
|
|
|
*/
|
2012-10-09 03:07:11 -07:00
|
|
|
[scriptable, uuid(2abe554b-e07c-44b0-9719-02190460188d)]
|
2012-04-19 14:33:25 -07:00
|
|
|
interface nsIRILContentHelper : nsIMobileConnectionProvider
|
|
|
|
{
|
2012-04-24 08:44:42 -07:00
|
|
|
void registerTelephonyCallback(in nsIRILTelephonyCallback callback);
|
|
|
|
void unregisterTelephonyCallback(in nsIRILTelephonyCallback callback);
|
|
|
|
|
2012-07-18 20:26:49 -07:00
|
|
|
void registerVoicemailCallback(in nsIRILVoicemailCallback callback);
|
|
|
|
void unregisterVoicemailCallback(in nsIRILVoicemailCallback callback);
|
|
|
|
|
2012-10-09 03:07:11 -07:00
|
|
|
/**
|
|
|
|
* Called when a content process registers receiving unsolicited messages from
|
2012-10-28 20:55:55 -07:00
|
|
|
* RadioInterfaceLayer in the chrome process. Only a content process that has
|
|
|
|
* the 'telephony' permission is allowed to register. Note that content
|
|
|
|
* doesn't need to unregister because the chrome process will remove it from
|
|
|
|
* the registration list once the chrome receives a 'child-process-shutdown'
|
|
|
|
* message.
|
2012-10-09 03:07:11 -07:00
|
|
|
*/
|
2012-10-28 20:55:55 -07:00
|
|
|
void registerTelephonyMsg();
|
2012-10-09 03:07:11 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when a content process registers receiving unsolicited messages from
|
2012-10-28 20:55:55 -07:00
|
|
|
* RadioInterfaceLayer in the chrome process. Only a content process that has
|
|
|
|
* the 'voicemail' permission is allowed to register. Note that content
|
|
|
|
* doesn't need to unregister because the chrome process will remove it from
|
|
|
|
* the registration list once the chrome receives a 'child-process-shutdown'
|
|
|
|
* message.
|
2012-10-09 03:07:11 -07:00
|
|
|
*/
|
2012-10-28 20:55:55 -07:00
|
|
|
void registerVoicemailMsg();
|
2012-10-09 03:07:11 -07:00
|
|
|
|
2012-04-24 08:44:42 -07:00
|
|
|
/**
|
|
|
|
* 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);
|
2012-07-20 05:08:24 -07:00
|
|
|
void dialEmergency(in DOMString number);
|
2012-04-24 08:44:42 -07:00
|
|
|
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;
|
2012-07-18 20:26:49 -07:00
|
|
|
|
|
|
|
readonly attribute nsIDOMMozVoicemailStatus voicemailStatus;
|
2012-07-20 17:19:38 -07:00
|
|
|
readonly attribute DOMString voicemailNumber;
|
|
|
|
readonly attribute DOMString voicemailDisplayName;
|
2012-04-19 14:33:25 -07:00
|
|
|
};
|
|
|
|
|
2012-09-17 04:33:35 -07:00
|
|
|
[scriptable, uuid(4efdb1d4-1e49-4f5d-a656-44e6180062a7)]
|
2012-06-10 23:50:13 -07:00
|
|
|
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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Abbreviated dialling numbers
|
|
|
|
*/
|
|
|
|
readonly attribute jsval adn;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fixed Dialling Numbers
|
|
|
|
*/
|
|
|
|
readonly attribute jsval fdn;
|
|
|
|
};
|
|
|
|
|
2012-08-15 18:36:56 -07:00
|
|
|
[scriptable, uuid(e6dc89f2-0d4e-46fc-902c-cfeeaee15e40)]
|
2012-06-10 23:50:13 -07:00
|
|
|
interface nsIRilContext : nsISupports
|
|
|
|
{
|
|
|
|
readonly attribute DOMString radioState;
|
|
|
|
|
|
|
|
readonly attribute DOMString cardState;
|
|
|
|
|
|
|
|
readonly attribute nsIICCRecords icc;
|
|
|
|
|
|
|
|
readonly attribute nsIDOMMozMobileConnectionInfo voice;
|
|
|
|
|
|
|
|
readonly attribute nsIDOMMozMobileConnectionInfo data;
|
|
|
|
};
|
|
|
|
|
2012-09-26 05:57:37 -07:00
|
|
|
[scriptable, uuid(a90fef2c-44aa-4f2b-a0ee-a590e9dd345e)]
|
2012-01-19 12:53:32 -08:00
|
|
|
interface nsIRadioInterfaceLayer : nsISupports
|
2011-12-23 21:02:52 -08:00
|
|
|
{
|
2012-01-09 14:28:47 -08:00
|
|
|
const unsigned short CALL_STATE_UNKNOWN = 0;
|
|
|
|
const unsigned short CALL_STATE_DIALING = 1;
|
2012-03-14 04:03:33 -07:00
|
|
|
const unsigned short CALL_STATE_ALERTING = 2;
|
2012-01-09 14:28:47 -08:00
|
|
|
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;
|
|
|
|
|
2012-05-23 22:12:07 -07:00
|
|
|
/**
|
|
|
|
* Activates or deactivates radio power.
|
|
|
|
*/
|
|
|
|
void setRadioEnabled(in bool value);
|
|
|
|
|
2012-06-10 23:50:13 -07:00
|
|
|
readonly attribute nsIRilContext rilContext;
|
2012-01-09 14:28:47 -08:00
|
|
|
|
2012-01-19 12:53:32 -08:00
|
|
|
/**
|
|
|
|
* PDP APIs
|
|
|
|
*/
|
2012-09-26 05:57:37 -07:00
|
|
|
void setupDataCallByType(in DOMString apntype);
|
|
|
|
void deactivateDataCallByType(in DOMString apntype);
|
|
|
|
long getDataCallStateByType(in DOMString apntype);
|
2012-01-17 17:34:09 -08:00
|
|
|
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();
|
2012-02-19 15:44:29 -08:00
|
|
|
|
2012-01-19 12:53:32 -08:00
|
|
|
void registerDataCallCallback(in nsIRILDataCallback callback);
|
|
|
|
void unregisterDataCallCallback(in nsIRILDataCallback callback);
|
2012-01-17 17:34:09 -08:00
|
|
|
|
2011-12-23 21:02:52 -08:00
|
|
|
/**
|
|
|
|
* SMS-related functionality.
|
|
|
|
*/
|
|
|
|
unsigned short getNumberOfMessagesForText(in DOMString text);
|
2012-02-19 15:44:29 -08:00
|
|
|
void sendSMS(in DOMString number,
|
|
|
|
in DOMString message,
|
|
|
|
in long requestId,
|
|
|
|
in unsigned long long processId);
|
2012-05-07 11:53:42 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ICC-related functionality.
|
|
|
|
*/
|
2012-09-05 20:36:12 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get ICC Contact List.
|
|
|
|
*
|
|
|
|
* @param contactType One of the values below.
|
|
|
|
* "ADN" (Abbreviated Dialling Numbers)
|
|
|
|
* "FDN" (Fixed Dialling Numbers)
|
|
|
|
* @param callback A nsIRILContactCallback object.
|
|
|
|
*/
|
|
|
|
void getICCContacts(in DOMString contactType,
|
|
|
|
in nsIRILContactCallback callback);
|
2011-12-04 23:58:27 -08:00
|
|
|
};
|