2013-03-06 13:53:08 +04: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-10-31 16:05:51 +04:00
|
|
|
[scriptable, uuid(707c4c43-a0d7-4093-af52-d4d6a3a333c3)]
|
2013-03-06 13:53:08 +04:00
|
|
|
interface nsITelephonyListener : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Notified when a telephony call changes state.
|
|
|
|
*
|
2013-10-31 16:05:51 +04:00
|
|
|
* @param clientId
|
|
|
|
Indicate the RIL client, 0 ~ (number of client - 1).
|
2013-03-06 13:53:08 +04:00
|
|
|
* @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 14:39:05 +04:00
|
|
|
* @param isOutgoing
|
|
|
|
* Indicates whether this call is outgoing or incoming.
|
2013-05-14 10:02:58 +04:00
|
|
|
* @param isEmergency
|
|
|
|
* Indicates whether this call is an emergency call.
|
2013-07-20 10:46:35 +04:00
|
|
|
* @param isConference
|
|
|
|
* Indicates whether this call is a conference call.
|
2013-03-06 13:53:08 +04:00
|
|
|
*/
|
2013-10-31 16:05:51 +04:00
|
|
|
void callStateChanged(in unsigned long clientId,
|
|
|
|
in unsigned long callIndex,
|
2013-03-06 13:53:08 +04:00
|
|
|
in unsigned short callState,
|
|
|
|
in AString number,
|
2013-05-08 14:39:05 +04:00
|
|
|
in boolean isActive,
|
2013-05-14 10:02:58 +04:00
|
|
|
in boolean isOutgoing,
|
2013-07-20 10:46:35 +04:00
|
|
|
in boolean isEmergency,
|
|
|
|
in boolean isConference);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when participants of a conference call have been updated, and the
|
|
|
|
* conference call state changes.
|
|
|
|
*
|
|
|
|
* @param callState
|
|
|
|
* Possible values are: nsITelephonyProvider::CALL_STATE_UNKNOWN,
|
|
|
|
* nsITelephonyProvider::CALL_STATE_HELD,
|
|
|
|
* nsITelephonyProvider::CALL_STATE_CONNECTED.
|
|
|
|
*/
|
|
|
|
void conferenceCallStateChanged(in unsigned short callState);
|
2013-03-06 13:53:08 +04:00
|
|
|
|
|
|
|
/**
|
2013-05-09 14:44:13 +04:00
|
|
|
* Called when enumeration asked by nsITelephonyProvider::enumerateCalls
|
|
|
|
* is completed.
|
|
|
|
*/
|
|
|
|
void enumerateCallStateComplete();
|
|
|
|
|
|
|
|
/**
|
2013-03-06 13:53:08 +04: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.
|
|
|
|
*
|
2013-10-31 16:05:51 +04:00
|
|
|
* @param clientId
|
|
|
|
Indicate the RIL client, 0 ~ (number of client - 1).
|
2013-03-06 13:53:08 +04:00
|
|
|
* @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 14:39:05 +04:00
|
|
|
* @param isOutgoing
|
|
|
|
* Indicates whether this call is outgoing or incoming.
|
2013-07-20 10:46:35 +04:00
|
|
|
* @param isConference
|
|
|
|
* Indicates whether this call is a conference call.
|
2013-03-06 13:53:08 +04:00
|
|
|
*/
|
2013-10-31 16:05:51 +04:00
|
|
|
void enumerateCallState(in unsigned long clientId,
|
|
|
|
in unsigned long callIndex,
|
2013-09-07 10:19:50 +04:00
|
|
|
in unsigned short callState,
|
|
|
|
in AString number,
|
|
|
|
in boolean isActive,
|
|
|
|
in boolean isOutgoing,
|
|
|
|
in boolean isEmergency,
|
|
|
|
in boolean isConference);
|
2013-03-06 13:53:08 +04:00
|
|
|
|
2013-08-06 00:27:50 +04:00
|
|
|
/**
|
|
|
|
* Notify when RIL receives supplementary service notification.
|
|
|
|
*
|
2013-10-31 16:05:51 +04:00
|
|
|
* @param clientId
|
|
|
|
Indicate the RIL client, 0 ~ (number of client - 1).
|
2013-08-06 00:27:50 +04:00
|
|
|
* @param callIndex
|
|
|
|
* Call identifier assigned by the RIL. -1 if not specified
|
|
|
|
* @param notification
|
|
|
|
* One of the nsITelephonyProvider::NOTIFICATION_* values.
|
|
|
|
*/
|
2013-10-31 16:05:51 +04:00
|
|
|
void supplementaryServiceNotification(in unsigned long clientId,
|
|
|
|
in long callIndex,
|
2013-08-06 00:27:50 +04:00
|
|
|
in unsigned short notification);
|
|
|
|
|
2013-03-06 13:53:08 +04:00
|
|
|
/**
|
|
|
|
* Called when RIL error occurs.
|
|
|
|
*
|
2013-10-31 16:05:51 +04:00
|
|
|
* @param clientId
|
|
|
|
Indicate the RIL client, 0 ~ (number of client - 1).
|
2013-03-06 13:53:08 +04:00
|
|
|
* @param callIndex
|
|
|
|
* Call identifier assigned by the RIL. -1 if no connection
|
|
|
|
* @param error
|
|
|
|
* Error from RIL.
|
|
|
|
*/
|
2013-10-31 16:05:51 +04:00
|
|
|
void notifyError(in unsigned long clientId,
|
|
|
|
in long callIndex,
|
2013-03-06 13:53:08 +04:00
|
|
|
in AString error);
|
2013-08-06 16:07:40 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when a waiting call comes in CDMA networks.
|
|
|
|
*
|
2013-10-31 16:05:51 +04:00
|
|
|
* @param clientId
|
|
|
|
Indicate the RIL client, 0 ~ (number of client - 1).
|
2013-08-06 16:07:40 +04:00
|
|
|
* @param number
|
|
|
|
* Number of the other party.
|
|
|
|
*/
|
2013-10-31 16:05:51 +04:00
|
|
|
void notifyCdmaCallWaiting(in unsigned long clientId, in AString number);
|
2013-03-06 13:53:08 +04:00
|
|
|
};
|
|
|
|
|
2013-09-07 10:19:50 +04:00
|
|
|
%{C++
|
|
|
|
#define TELEPHONY_PROVIDER_CID \
|
|
|
|
{ 0x9cf8aa52, 0x7c1c, 0x4cde, { 0x97, 0x4e, 0xed, 0x2a, 0xa0, 0xe7, 0x35, 0xfa } }
|
|
|
|
#define TELEPHONY_PROVIDER_CONTRACTID \
|
|
|
|
"@mozilla.org/telephony/telephonyprovider;1"
|
|
|
|
%}
|
|
|
|
|
2013-03-06 13:53:08 +04:00
|
|
|
/**
|
|
|
|
* XPCOM component (in the content process) that provides the telephony
|
|
|
|
* information.
|
|
|
|
*/
|
2013-10-31 16:05:51 +04:00
|
|
|
[scriptable, uuid(4ff3ecb7-b024-4752-9dd6-c3623c6e6b8a)]
|
2013-03-06 13:53:08 +04: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 16:53:25 +04: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 13:53:08 +04:00
|
|
|
|
2013-08-06 00:27:50 +04:00
|
|
|
const unsigned short NOTIFICATION_REMOTE_HELD = 0;
|
|
|
|
const unsigned short NOTIFICATION_REMOTE_RESUMED = 1;
|
|
|
|
|
2013-10-24 12:14:50 +04:00
|
|
|
readonly attribute unsigned long defaultServiceId;
|
|
|
|
|
2013-03-06 13:53:08 +04: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.
|
|
|
|
*/
|
2013-09-07 10:19:50 +04:00
|
|
|
void registerListener(in nsITelephonyListener listener);
|
|
|
|
void unregisterListener(in nsITelephonyListener listener);
|
2013-03-06 13:53:08 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Will continue calling listener.enumerateCallState until the listener
|
|
|
|
* returns false.
|
|
|
|
*/
|
|
|
|
void enumerateCalls(in nsITelephonyListener listener);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Functionality for making and managing phone calls.
|
|
|
|
*/
|
2013-10-31 16:05:51 +04:00
|
|
|
void dial(in unsigned long clientId, in DOMString number,
|
2013-09-07 10:19:50 +04:00
|
|
|
in boolean isEmergency);
|
2013-10-31 16:05:51 +04:00
|
|
|
void hangUp(in unsigned long clientId, in unsigned long callIndex);
|
2013-03-06 13:53:08 +04:00
|
|
|
|
2013-10-31 16:05:51 +04:00
|
|
|
void startTone(in unsigned long clientId, in DOMString dtmfChar);
|
|
|
|
void stopTone(in unsigned long clientId);
|
2013-03-06 13:53:08 +04:00
|
|
|
|
2013-10-31 16:05:51 +04:00
|
|
|
void answerCall(in unsigned long clientId, in unsigned long callIndex);
|
|
|
|
void rejectCall(in unsigned long clientId, in unsigned long callIndex);
|
|
|
|
void holdCall(in unsigned long clientId, in unsigned long callIndex);
|
|
|
|
void resumeCall(in unsigned long clientId, in unsigned long callIndex);
|
2013-03-06 13:53:08 +04:00
|
|
|
|
2013-10-31 16:05:51 +04:00
|
|
|
void conferenceCall(in unsigned long clientId);
|
|
|
|
void separateCall(in unsigned long clientId, in unsigned long callIndex);
|
|
|
|
void holdConference(in unsigned long clientId);
|
|
|
|
void resumeConference(in unsigned long clientId);
|
2013-07-20 10:46:35 +04:00
|
|
|
|
2013-03-06 13:53:08 +04:00
|
|
|
attribute bool microphoneMuted;
|
|
|
|
attribute bool speakerEnabled;
|
|
|
|
};
|