2011-12-05 07:58:27 +00:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is Telephony.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* the Mozilla Foundation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2011
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
2012-01-19 20:53:32 +00:00
|
|
|
* Philipp von Weitershausen <philipp@weitershausen.de>
|
|
|
|
* Ben Turner <bent.mozilla@gmail.com>
|
|
|
|
* Sinker Li <thinker@codemud.net>
|
2011-12-05 07:58:27 +00:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2012-01-19 20:53:32 +00:00
|
|
|
[scriptable, uuid(03eafd60-d138-4f09-81b4-90cd4996b3c7)]
|
|
|
|
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-01-09 22:28:47 +00:00
|
|
|
void callStateChanged(in unsigned long callIndex,
|
|
|
|
in unsigned short callState,
|
|
|
|
in AString number);
|
2011-12-05 07:58:27 +00:00
|
|
|
|
2012-01-19 20:53:32 +00:00
|
|
|
/**
|
|
|
|
* Called when nsIRadioInterfaceLayer is asked to enumerate the current
|
|
|
|
* telephony call state (nsIRadioInterfaceLayer::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.
|
|
|
|
*/
|
2012-01-09 22:28:47 +00:00
|
|
|
boolean enumerateCallState(in unsigned long callIndex,
|
|
|
|
in unsigned short callState,
|
|
|
|
in AString number,
|
|
|
|
in boolean isActive);
|
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-05 08:12:42 +00:00
|
|
|
[scriptable, uuid(d2025763-fc32-436e-b207-0228ea1ccd12)]
|
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
|
|
|
void registerCallback(in nsIRILTelephonyCallback callback);
|
|
|
|
void unregisterCallback(in nsIRILTelephonyCallback callback);
|
2011-12-05 07:58:27 +00:00
|
|
|
|
2012-01-09 22:28:47 +00:00
|
|
|
/**
|
|
|
|
* Will continue calling callback.enumerateCallState until the callback
|
|
|
|
* returns false.
|
|
|
|
*/
|
2012-01-19 20:53:32 +00:00
|
|
|
void enumerateCalls(in nsIRILTelephonyCallback callback);
|
2012-01-09 22:28:47 +00:00
|
|
|
|
2011-12-24 05:02:52 +00:00
|
|
|
/**
|
|
|
|
* Functionality for making and managing phone calls.
|
|
|
|
*/
|
2011-12-05 07:58:27 +00:00
|
|
|
void dial(in DOMString number);
|
2012-01-09 22:28:47 +00:00
|
|
|
void hangUp(in unsigned long callIndex);
|
|
|
|
|
2011-12-16 21:47:32 +00:00
|
|
|
void startTone(in DOMString dtmfChar);
|
|
|
|
void stopTone();
|
2012-01-09 22:28:47 +00:00
|
|
|
|
|
|
|
void answerCall(in unsigned long callIndex);
|
|
|
|
void rejectCall(in unsigned long callIndex);
|
2012-04-05 08:12:42 +00:00
|
|
|
void holdCall(in unsigned long callIndex);
|
|
|
|
void resumeCall(in unsigned long callIndex);
|
2012-01-09 22:28:47 +00:00
|
|
|
|
2011-12-12 18:30:43 +00:00
|
|
|
attribute bool microphoneMuted;
|
|
|
|
attribute bool speakerEnabled;
|
2011-12-05 07:58:27 +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
|
|
|
};
|