2012-05-21 11:12:37 +00: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-05 07:58:27 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
2012-04-19 21:33:25 +00:00
|
|
|
#include "nsIMobileConnectionProvider.idl"
|
|
|
|
|
|
|
|
interface nsIDOMMozMobileConnectionInfo;
|
|
|
|
interface nsIDOMDOMRequest;
|
|
|
|
interface nsIDOMWindow;
|
2011-12-05 07:58:27 +00:00
|
|
|
|
2012-05-15 04:13:06 +00:00
|
|
|
[scriptable, uuid(c14c71b8-afba-403b-8320-94593de9380f)]
|
2012-01-19 20:53:32 +00:00
|
|
|
interface nsIRILTelephonyCallback : nsISupports
|
2011-12-24 05:02:52 +00:00
|
|
|
{
|
2012-01-19 20:53:32 +00: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-15 04:13:06 +00:00
|
|
|
* @param isActive
|
|
|
|
* Indicates whether this call is the currently active one.
|
2012-01-19 20:53:32 +00:00
|
|
|
*/
|
2012-01-09 22:28:47 +00:00
|
|
|
void callStateChanged(in unsigned long callIndex,
|
|
|
|
in unsigned short callState,
|
2012-05-15 04:13:06 +00:00
|
|
|
in AString number,
|
|
|
|
in boolean isActive);
|
2011-12-05 07:58:27 +00:00
|
|
|
|
2012-01-19 20:53:32 +00:00
|
|
|
/**
|
2012-04-24 15:44:42 +00:00
|
|
|
* Called when nsIRILContentHelper is asked to enumerate the current
|
|
|
|
* telephony call state (nsIRILContentHelper::enumerateCalls). This is
|
2012-01-19 20:53:32 +00: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 22:28:47 +00:00
|
|
|
boolean enumerateCallState(in unsigned long callIndex,
|
|
|
|
in unsigned short callState,
|
|
|
|
in AString number,
|
|
|
|
in boolean isActive);
|
2012-05-15 04:13:06 +00: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-05 07:58:27 +00:00
|
|
|
};
|
|
|
|
|
2012-01-19 20:53:32 +00:00
|
|
|
[scriptable, uuid(66a55943-e63b-4731-aece-9c04bfc14019)]
|
|
|
|
interface nsIRILDataCallInfo : nsISupports
|
2012-01-18 01:34:09 +00:00
|
|
|
{
|
|
|
|
readonly attribute unsigned long callState;
|
|
|
|
readonly attribute AString cid;
|
|
|
|
readonly attribute AString apn;
|
|
|
|
};
|
|
|
|
|
2012-01-19 20:53:32 +00:00
|
|
|
[scriptable, uuid(cea91bcb-3cfb-42bb-8638-dae89e8870fc)]
|
|
|
|
interface nsIRILDataCallback : nsISupports
|
2012-01-18 01:34:09 +00:00
|
|
|
{
|
|
|
|
/**
|
2012-01-19 20:53:32 +00:00
|
|
|
* Notified when a data call changes state.
|
2012-01-18 01:34:09 +00:00
|
|
|
*
|
2012-01-19 20:53:32 +00: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-18 01:34:09 +00:00
|
|
|
*/
|
|
|
|
void dataCallStateChanged(in AString cid,
|
|
|
|
in AString interfaceName,
|
|
|
|
in unsigned short callState);
|
|
|
|
|
2012-01-19 20:53:32 +00: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-18 01:34:09 +00:00
|
|
|
};
|
|
|
|
|
2012-04-19 21:33:25 +00:00
|
|
|
/**
|
|
|
|
* Helper that runs in the content process and exposes information
|
|
|
|
* to the DOM.
|
|
|
|
*/
|
2012-04-24 15:44:42 +00:00
|
|
|
[scriptable, uuid(2f8b0929-2ecf-498c-bfa7-42690509696e)]
|
2012-04-19 21:33:25 +00:00
|
|
|
interface nsIRILContentHelper : nsIMobileConnectionProvider
|
|
|
|
{
|
2012-04-24 15:44:42 +00: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 21:33:25 +00:00
|
|
|
};
|
|
|
|
|
2012-04-24 15:44:42 +00:00
|
|
|
[scriptable, uuid(d976f4c2-af5b-4fe1-97c2-c9c5d0d1af5c)]
|
2012-01-19 20:53:32 +00:00
|
|
|
interface nsIRadioInterfaceLayer : nsISupports
|
2011-12-24 05:02:52 +00:00
|
|
|
{
|
2012-01-09 22:28:47 +00:00
|
|
|
const unsigned short CALL_STATE_UNKNOWN = 0;
|
|
|
|
const unsigned short CALL_STATE_DIALING = 1;
|
2012-03-14 11:03:33 +00:00
|
|
|
const unsigned short CALL_STATE_ALERTING = 2;
|
2012-01-09 22:28:47 +00: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-18 01:34:09 +00: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-03-12 23:45:57 +00:00
|
|
|
readonly attribute jsval radioState;
|
2012-01-09 22:28:47 +00:00
|
|
|
|
2012-01-19 20:53:32 +00:00
|
|
|
/**
|
|
|
|
* PDP APIs
|
|
|
|
*/
|
2012-01-18 01:34:09 +00: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 23:44:29 +00:00
|
|
|
|
2012-01-19 20:53:32 +00:00
|
|
|
void registerDataCallCallback(in nsIRILDataCallback callback);
|
|
|
|
void unregisterDataCallCallback(in nsIRILDataCallback callback);
|
2012-01-18 01:34:09 +00:00
|
|
|
|
2011-12-24 05:02:52 +00:00
|
|
|
/**
|
|
|
|
* SMS-related functionality.
|
|
|
|
*/
|
|
|
|
unsigned short getNumberOfMessagesForText(in DOMString text);
|
2012-02-19 23:44:29 +00:00
|
|
|
void sendSMS(in DOMString number,
|
|
|
|
in DOMString message,
|
|
|
|
in long requestId,
|
|
|
|
in unsigned long long processId);
|
2011-12-05 07:58:27 +00:00
|
|
|
};
|