2013-03-06 01:53:08 -08: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/. */
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2013-08-06 05:07:40 -07:00
|
|
|
[scriptable, uuid(3fb573c3-6fc4-41d3-80c1-f0e60662691e)]
|
2013-03-06 01:53:08 -08:00
|
|
|
interface nsITelephonyListener : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Notified when a telephony call changes state.
|
|
|
|
*
|
|
|
|
* @param callIndex
|
|
|
|
* Call identifier assigned by the RIL.
|
|
|
|
* @param callState
|
|
|
|
* One of the nsITelephonyProvider::CALL_STATE_* values.
|
|
|
|
* @param number
|
|
|
|
* Number of the other party.
|
|
|
|
* @param isActive
|
|
|
|
* Indicates whether this call is the currently active one.
|
2013-05-08 03:39:05 -07:00
|
|
|
* @param isOutgoing
|
|
|
|
* Indicates whether this call is outgoing or incoming.
|
2013-05-13 23:02:58 -07:00
|
|
|
* @param isEmergency
|
|
|
|
* Indicates whether this call is an emergency call.
|
2013-03-06 01:53:08 -08:00
|
|
|
*/
|
|
|
|
void callStateChanged(in unsigned long callIndex,
|
|
|
|
in unsigned short callState,
|
|
|
|
in AString number,
|
2013-05-08 03:39:05 -07:00
|
|
|
in boolean isActive,
|
2013-05-13 23:02:58 -07:00
|
|
|
in boolean isOutgoing,
|
|
|
|
in boolean isEmergency);
|
2013-03-06 01:53:08 -08:00
|
|
|
|
|
|
|
/**
|
2013-05-09 03:44:13 -07:00
|
|
|
* Called when enumeration asked by nsITelephonyProvider::enumerateCalls
|
|
|
|
* is completed.
|
|
|
|
*/
|
|
|
|
void enumerateCallStateComplete();
|
|
|
|
|
|
|
|
/**
|
2013-03-06 01:53:08 -08:00
|
|
|
* Called when nsITelephonyProvider is asked to enumerate the current
|
|
|
|
* telephony call state (nsITelephonyProvider::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 nsITelephonyProvider::CALL_STATE_* values.
|
|
|
|
* @param number
|
|
|
|
* Number of the other party.
|
|
|
|
* @param isActive
|
|
|
|
* Indicates whether this call is the active one.
|
2013-05-08 03:39:05 -07:00
|
|
|
* @param isOutgoing
|
|
|
|
* Indicates whether this call is outgoing or incoming.
|
2013-03-06 01:53:08 -08:00
|
|
|
*
|
|
|
|
* @return true to continue enumeration or false to cancel.
|
|
|
|
*/
|
|
|
|
boolean enumerateCallState(in unsigned long callIndex,
|
|
|
|
in unsigned short callState,
|
|
|
|
in AString number,
|
2013-05-08 03:39:05 -07:00
|
|
|
in boolean isActive,
|
2013-05-13 23:02:58 -07:00
|
|
|
in boolean isOutgoing,
|
|
|
|
in boolean isEmergency);
|
2013-03-06 01:53:08 -08:00
|
|
|
|
2013-08-05 13:27:50 -07:00
|
|
|
/**
|
|
|
|
* Notify when RIL receives supplementary service notification.
|
|
|
|
*
|
|
|
|
* @param callIndex
|
|
|
|
* Call identifier assigned by the RIL. -1 if not specified
|
|
|
|
* @param notification
|
|
|
|
* One of the nsITelephonyProvider::NOTIFICATION_* values.
|
|
|
|
*/
|
|
|
|
void supplementaryServiceNotification(in long callIndex,
|
|
|
|
in unsigned short notification);
|
|
|
|
|
2013-03-06 01:53:08 -08: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);
|
2013-08-06 05:07:40 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when a waiting call comes in CDMA networks.
|
|
|
|
*
|
|
|
|
* @param number
|
|
|
|
* Number of the other party.
|
|
|
|
*/
|
|
|
|
void notifyCdmaCallWaiting(in AString number);
|
2013-03-06 01:53:08 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* XPCOM component (in the content process) that provides the telephony
|
|
|
|
* information.
|
|
|
|
*/
|
2013-08-05 13:27:50 -07:00
|
|
|
[scriptable, uuid(eddb7ff6-29af-4973-83de-1159365c7d7d)]
|
2013-03-06 01:53:08 -08:00
|
|
|
interface nsITelephonyProvider : nsISupports
|
|
|
|
{
|
|
|
|
const unsigned short CALL_STATE_UNKNOWN = 0;
|
|
|
|
const unsigned short CALL_STATE_DIALING = 1;
|
|
|
|
const unsigned short CALL_STATE_ALERTING = 2;
|
2013-07-15 05:53:25 -07:00
|
|
|
const unsigned short CALL_STATE_CONNECTING = 3;
|
|
|
|
const unsigned short CALL_STATE_CONNECTED = 4;
|
|
|
|
const unsigned short CALL_STATE_HOLDING = 5;
|
|
|
|
const unsigned short CALL_STATE_HELD = 6;
|
|
|
|
const unsigned short CALL_STATE_RESUMING = 7;
|
|
|
|
const unsigned short CALL_STATE_DISCONNECTING = 8;
|
|
|
|
const unsigned short CALL_STATE_DISCONNECTED = 9;
|
|
|
|
const unsigned short CALL_STATE_INCOMING = 10;
|
2013-03-06 01:53:08 -08:00
|
|
|
|
2013-08-05 13:27:50 -07:00
|
|
|
const unsigned short NOTIFICATION_REMOTE_HELD = 0;
|
|
|
|
const unsigned short NOTIFICATION_REMOTE_RESUMED = 1;
|
|
|
|
|
2013-03-06 01:53:08 -08:00
|
|
|
/**
|
|
|
|
* Called when a content process registers receiving unsolicited messages from
|
|
|
|
* RadioInterfaceLayer in the chrome process. Only a content process that has
|
|
|
|
* the 'telephony' permission is allowed to register.
|
|
|
|
*/
|
|
|
|
void registerTelephonyMsg(in nsITelephonyListener listener);
|
|
|
|
void unregisterTelephonyMsg(in nsITelephonyListener listener);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Will continue calling listener.enumerateCallState until the listener
|
|
|
|
* returns false.
|
|
|
|
*/
|
|
|
|
void enumerateCalls(in nsITelephonyListener listener);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Functionality for making and managing phone calls.
|
|
|
|
*/
|
|
|
|
void dial(in DOMString number);
|
|
|
|
void dialEmergency(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;
|
|
|
|
};
|