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;
|
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-01-19 12:53:32 -08:00
|
|
|
[scriptable, uuid(66a55943-e63b-4731-aece-9c04bfc14019)]
|
|
|
|
interface nsIRILDataCallInfo : nsISupports
|
2012-01-17 17:34:09 -08:00
|
|
|
{
|
|
|
|
readonly attribute unsigned long callState;
|
|
|
|
readonly attribute AString cid;
|
|
|
|
readonly attribute AString apn;
|
|
|
|
};
|
|
|
|
|
2012-01-19 12:53:32 -08:00
|
|
|
[scriptable, uuid(cea91bcb-3cfb-42bb-8638-dae89e8870fc)]
|
|
|
|
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-01-19 12:53:32 -08:00
|
|
|
* @param cid
|
|
|
|
* The CID of the data call.
|
|
|
|
* @param interfaceName
|
|
|
|
* Name of the associated network interface.
|
|
|
|
* @param dataState
|
|
|
|
* One of the nsIRadioInterfaceLayer::DATACALL_STATE_* values.
|
2012-01-17 17:34:09 -08:00
|
|
|
*/
|
|
|
|
void dataCallStateChanged(in AString cid,
|
|
|
|
in AString interfaceName,
|
|
|
|
in unsigned short callState);
|
|
|
|
|
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-05-07 11:53:42 -07:00
|
|
|
[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);
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:33:25 -07:00
|
|
|
/**
|
|
|
|
* Helper that runs in the content process and exposes information
|
|
|
|
* to the DOM.
|
|
|
|
*/
|
2012-04-24 08:44:42 -07:00
|
|
|
[scriptable, uuid(2f8b0929-2ecf-498c-bfa7-42690509696e)]
|
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);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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;
|
2012-04-19 14:33:25 -07:00
|
|
|
};
|
|
|
|
|
2012-05-07 11:53:42 -07:00
|
|
|
[scriptable, uuid(fa923335-4cbd-40d7-8d4a-5689a6db2b6d)]
|
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-01-17 17:34:09 -08:00
|
|
|
// Keep consistent with GECKO_DATACALL_STATE_* values in ril_consts.js
|
|
|
|
const unsigned short DATACALL_STATE_UNKNOWN = 0;
|
|
|
|
const unsigned short DATACALL_STATE_CONNECTING = 1;
|
|
|
|
const unsigned short DATACALL_STATE_CONNECTED = 2;
|
|
|
|
const unsigned short DATACALL_STATE_DISCONNECTING = 3;
|
|
|
|
const unsigned short DATACALL_STATE_DISCONNECTED = 4;
|
|
|
|
|
2012-05-23 22:12:07 -07:00
|
|
|
/**
|
|
|
|
* Activates or deactivates radio power.
|
|
|
|
*/
|
|
|
|
void setRadioEnabled(in bool value);
|
|
|
|
|
2012-03-12 16:45:57 -07:00
|
|
|
readonly attribute jsval radioState;
|
2012-01-09 14:28:47 -08:00
|
|
|
|
2012-01-19 12:53:32 -08:00
|
|
|
/**
|
|
|
|
* PDP APIs
|
|
|
|
*/
|
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.
|
|
|
|
*/
|
|
|
|
void getICCContacts(in DOMString type, in nsIRILContactCallback callback);
|
2011-12-04 23:58:27 -08:00
|
|
|
};
|