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"
|
|
|
|
|
2014-11-06 05:20:48 +03:00
|
|
|
interface nsIMobileCallForwardingOptions;
|
|
|
|
|
2014-04-16 15:07:11 +04:00
|
|
|
[scriptable, uuid(464d4cf8-454a-4cdb-9329-bfe7ede97103)]
|
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
|
2014-06-03 18:15:25 +04:00
|
|
|
* One of the nsITelephonyService::CALL_STATE_* values.
|
2013-03-06 13:53:08 +04:00
|
|
|
* @param number
|
|
|
|
* Number of the other party.
|
2014-04-16 15:07:11 +04:00
|
|
|
* @param numberPresentation
|
|
|
|
* Presentation of the call number.
|
|
|
|
* One of the nsITelephonyProvider::CALL_PRESENTATION_* values.
|
|
|
|
* @param name
|
|
|
|
* Name of the other party.
|
|
|
|
* @param namePresentation
|
|
|
|
* Presentation of the call name.
|
|
|
|
* One of the nsITelephonyProvider::CALL_PRESENTATION_* values.
|
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.
|
2014-02-21 13:51:07 +04:00
|
|
|
* @param isSwitchable
|
|
|
|
* Indicates whether this call can be switched between states of
|
2014-06-03 18:15:25 +04:00
|
|
|
* nsITelephonyService::CALL_STATE_CONNECTED and
|
|
|
|
* nsITelephonyService::CALL_STATE_HELD.
|
2014-02-21 13:51:07 +04:00
|
|
|
* @param isMergeable
|
|
|
|
* Indicates whether this call be be added into a conference.
|
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,
|
2014-04-16 15:07:11 +04:00
|
|
|
in unsigned short numberPresentation,
|
|
|
|
in AString name,
|
|
|
|
in unsigned short namePresentation,
|
2013-05-14 10:02:58 +04:00
|
|
|
in boolean isOutgoing,
|
2013-07-20 10:46:35 +04:00
|
|
|
in boolean isEmergency,
|
2014-02-21 13:51:07 +04:00
|
|
|
in boolean isConference,
|
|
|
|
in boolean isSwitchable,
|
|
|
|
in boolean isMergeable);
|
2013-07-20 10:46:35 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when participants of a conference call have been updated, and the
|
|
|
|
* conference call state changes.
|
|
|
|
*
|
|
|
|
* @param callState
|
2014-06-03 18:15:25 +04:00
|
|
|
* Possible values are: nsITelephonyService::CALL_STATE_UNKNOWN,
|
|
|
|
* nsITelephonyService::CALL_STATE_HELD,
|
|
|
|
* nsITelephonyService::CALL_STATE_CONNECTED.
|
2013-07-20 10:46:35 +04:00
|
|
|
*/
|
|
|
|
void conferenceCallStateChanged(in unsigned short callState);
|
2013-03-06 13:53:08 +04:00
|
|
|
|
|
|
|
/**
|
2014-06-03 18:15:25 +04:00
|
|
|
* Called when enumeration asked by nsITelephonyService::enumerateCalls
|
2013-05-09 14:44:13 +04:00
|
|
|
* is completed.
|
|
|
|
*/
|
|
|
|
void enumerateCallStateComplete();
|
|
|
|
|
|
|
|
/**
|
2014-06-03 18:15:25 +04:00
|
|
|
* Called when nsITelephonyService is asked to enumerate the current
|
|
|
|
* telephony call state (nsITelephonyService::enumerateCalls). This is
|
2013-03-06 13:53:08 +04:00
|
|
|
* 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
|
2014-06-03 18:15:25 +04:00
|
|
|
* One of the nsITelephonyService::CALL_STATE_* values.
|
2013-03-06 13:53:08 +04:00
|
|
|
* @param number
|
|
|
|
* Number of the other party.
|
2014-04-16 15:07:11 +04:00
|
|
|
* @param numberPresentation
|
|
|
|
* Presentation of the call number.
|
|
|
|
* One of the nsITelephonyProvider::CALL_PRESENTATION_* values.
|
|
|
|
* @param name
|
|
|
|
* Name of the other party.
|
|
|
|
* @param namePresentation
|
|
|
|
* Presentation of the call name.
|
|
|
|
* One of the nsITelephonyProvider::CALL_PRESENTATION_* values.
|
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.
|
2014-02-21 13:51:07 +04:00
|
|
|
* @param isSwitchable
|
|
|
|
* Indicates whether this call can be switched between states of
|
2014-06-03 18:15:25 +04:00
|
|
|
* nsITelephonyService::CALL_STATE_CONNECTED and
|
|
|
|
* nsITelephonyService::CALL_STATE_HELD.
|
2014-02-21 13:51:07 +04:00
|
|
|
* @param isMergeable
|
|
|
|
* Indicates whether this call be be added into a conference.
|
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,
|
2014-04-16 15:07:11 +04:00
|
|
|
in unsigned short numberPresentation,
|
|
|
|
in AString name,
|
|
|
|
in unsigned short namePresentation,
|
2013-09-07 10:19:50 +04:00
|
|
|
in boolean isOutgoing,
|
|
|
|
in boolean isEmergency,
|
2014-02-21 13:51:07 +04:00
|
|
|
in boolean isConference,
|
|
|
|
in boolean isSwitchable,
|
|
|
|
in boolean isMergeable);
|
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
|
2014-06-03 18:15:25 +04:00
|
|
|
* One of the nsITelephonyService::NOTIFICATION_* values.
|
2013-08-06 00:27:50 +04:00
|
|
|
*/
|
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.
|
2014-04-16 15:07:11 +04:00
|
|
|
* @param numberPresentation
|
|
|
|
* Presentation of the call number.
|
|
|
|
* One of the nsITelephonyProvider::CALL_PRESENTATION_* values.
|
|
|
|
* @param name
|
|
|
|
* Name of the other party.
|
|
|
|
* @param namePresentation
|
|
|
|
* Presentation of the call name.
|
|
|
|
* One of the nsITelephonyProvider::CALL_PRESENTATION_* values.
|
2013-08-06 16:07:40 +04:00
|
|
|
*/
|
2014-04-16 15:07:11 +04:00
|
|
|
void notifyCdmaCallWaiting(in unsigned long clientId,
|
|
|
|
in AString number,
|
|
|
|
in unsigned short numberPresentation,
|
|
|
|
in AString name,
|
|
|
|
in unsigned short namePresentation);
|
2013-10-28 10:39:33 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when RIL error occurs to creating or separating a conference call.
|
|
|
|
*
|
|
|
|
* @param name
|
|
|
|
* Error name. Possible values are addError and removeError.
|
|
|
|
* @param message
|
|
|
|
* Detailed error message from RIL.
|
|
|
|
*/
|
|
|
|
void notifyConferenceError(in AString name,
|
|
|
|
in AString message);
|
2013-03-06 13:53:08 +04:00
|
|
|
};
|
|
|
|
|
2014-09-22 09:35:00 +04:00
|
|
|
/**
|
2014-10-15 10:50:00 +04:00
|
|
|
* A callback interface for handling asynchronous response.
|
2014-09-22 09:35:00 +04:00
|
|
|
*/
|
2014-10-15 10:50:00 +04:00
|
|
|
[scriptable, uuid(cffc3f9d-2c88-4a14-8ebc-f216caf0cc1d)]
|
2014-02-27 10:12:30 +04:00
|
|
|
interface nsITelephonyCallback : nsISupports
|
2014-10-15 10:50:00 +04:00
|
|
|
{
|
|
|
|
void notifySuccess();
|
|
|
|
void notifyError(in AString error);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A callback interface for handling asynchronous response for telephony.dial.
|
|
|
|
*/
|
2014-12-23 10:46:09 +03:00
|
|
|
[scriptable, uuid(e16c6e6f-93c6-4e1e-99bf-592b98f67e15)]
|
2014-10-15 10:50:00 +04:00
|
|
|
interface nsITelephonyDialCallback : nsITelephonyCallback
|
2014-02-27 10:12:30 +04:00
|
|
|
{
|
2014-09-22 09:35:00 +04:00
|
|
|
/**
|
|
|
|
* Called when a dial request is treated as an MMI code and it is about to
|
|
|
|
* process the request.
|
|
|
|
*
|
|
|
|
* @param serviceCode
|
|
|
|
* MMI service code key string that defined in MMI_KS_SC_*
|
|
|
|
*/
|
|
|
|
void notifyDialMMI(in AString serviceCode);
|
|
|
|
|
2014-02-27 10:12:30 +04:00
|
|
|
/**
|
2014-09-22 09:35:00 +04:00
|
|
|
* Called when a dial request is treated as a call setup and the result
|
|
|
|
* succeeds.
|
|
|
|
*
|
2014-12-23 10:46:09 +03:00
|
|
|
* @param clientId
|
|
|
|
Indicate the RIL client, 0 ~ (number of client - 1).
|
2014-09-22 09:35:00 +04:00
|
|
|
* @param callIndex
|
|
|
|
* Call index from RIL.
|
|
|
|
* @param number
|
|
|
|
* Dialed out phone number (ex: Temporary CLIR prefix will be removed)
|
2014-02-27 10:12:30 +04:00
|
|
|
*/
|
2014-12-23 10:46:09 +03:00
|
|
|
void notifyDialCallSuccess(in unsigned long cliendId,
|
|
|
|
in unsigned long callIndex,
|
|
|
|
in AString number);
|
2014-09-22 09:35:00 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when a MMI code request succeeds.
|
|
|
|
* The function should only be called after notifyDialMMI.
|
|
|
|
*/
|
2014-11-06 05:20:48 +03:00
|
|
|
void notifyDialMMISuccess(in AString statusMessage);
|
|
|
|
void notifyDialMMISuccessWithInteger(in AString statusMessage,
|
|
|
|
in unsigned short aAdditionalInformation);
|
|
|
|
void notifyDialMMISuccessWithStrings(in AString statusMessage,
|
|
|
|
in unsigned long aLength,
|
|
|
|
[array, size_is(aLength)] in wstring aAdditionalInformation);
|
|
|
|
void notifyDialMMISuccessWithCallForwardingOptions(in AString statusMessage,
|
|
|
|
in unsigned long aLength,
|
|
|
|
[array, size_is(aLength)] in nsIMobileCallForwardingOptions aAdditionalInformation);
|
2014-09-22 09:35:00 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when a MMI code request fails.
|
|
|
|
* The function should only be called after notifyDialMMI.
|
|
|
|
*/
|
|
|
|
void notifyDialMMIError(in AString error);
|
|
|
|
void notifyDialMMIErrorWithInfo(in AString error, in unsigned short info);
|
2014-02-27 10:12:30 +04:00
|
|
|
};
|
|
|
|
|
2013-09-07 10:19:50 +04:00
|
|
|
%{C++
|
2014-06-03 18:15:25 +04:00
|
|
|
#define TELEPHONY_SERVICE_CID \
|
2013-09-07 10:19:50 +04:00
|
|
|
{ 0x9cf8aa52, 0x7c1c, 0x4cde, { 0x97, 0x4e, 0xed, 0x2a, 0xa0, 0xe7, 0x35, 0xfa } }
|
2014-06-03 18:15:25 +04:00
|
|
|
#define TELEPHONY_SERVICE_CONTRACTID \
|
|
|
|
"@mozilla.org/telephony/telephonyservice;1"
|
2013-09-07 10:19:50 +04:00
|
|
|
%}
|
|
|
|
|
2013-03-06 13:53:08 +04:00
|
|
|
/**
|
|
|
|
* XPCOM component (in the content process) that provides the telephony
|
|
|
|
* information.
|
|
|
|
*/
|
2015-01-07 09:37:03 +03:00
|
|
|
[scriptable, uuid(a91fa6be-0acc-4d36-99f1-3e3a88e83ae9)]
|
2014-06-03 18:15:25 +04:00
|
|
|
interface nsITelephonyService : nsISupports
|
2013-03-06 13:53:08 +04:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
|
2014-04-16 15:07:11 +04:00
|
|
|
const unsigned short CALL_PRESENTATION_ALLOWED = 0;
|
|
|
|
const unsigned short CALL_PRESENTATION_RESTRICTED = 1;
|
|
|
|
const unsigned short CALL_PRESENTATION_UNKNOWN = 2;
|
|
|
|
const unsigned short CALL_PRESENTATION_PAYPHONE = 3;
|
|
|
|
|
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,
|
2014-10-15 10:50:00 +04:00
|
|
|
in boolean isEmergency, in nsITelephonyDialCallback callback);
|
2013-03-06 13:53:08 +04:00
|
|
|
|
2015-01-07 09:37:03 +03:00
|
|
|
void sendTones(in unsigned long clientId, in DOMString dtmfChars,
|
|
|
|
in unsigned long pauseDuration, in unsigned long toneDuration,
|
|
|
|
in nsITelephonyCallback callback);
|
|
|
|
|
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
|
|
|
|
2014-12-24 07:39:00 +03:00
|
|
|
void answerCall(in unsigned long clientId,
|
|
|
|
in unsigned long callIndex,
|
|
|
|
in nsITelephonyCallback callback);
|
|
|
|
void rejectCall(in unsigned long clientId,
|
|
|
|
in unsigned long callIndex,
|
|
|
|
in nsITelephonyCallback callback);
|
|
|
|
void hangUpCall(in unsigned long clientId,
|
|
|
|
in unsigned long callIndex,
|
|
|
|
in nsITelephonyCallback callback);
|
|
|
|
void holdCall(in unsigned long clientId,
|
|
|
|
in unsigned long callIndex,
|
|
|
|
in nsITelephonyCallback callback);
|
|
|
|
void resumeCall(in unsigned long clientId,
|
|
|
|
in unsigned long callIndex,
|
|
|
|
in nsITelephonyCallback callback);
|
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);
|
2014-10-20 11:12:00 +04:00
|
|
|
void hangUpConference(in unsigned long clientId,
|
|
|
|
in nsITelephonyCallback callback);
|
2013-10-31 16:05:51 +04:00
|
|
|
void holdConference(in unsigned long clientId);
|
|
|
|
void resumeConference(in unsigned long clientId);
|
2013-07-20 10:46:35 +04:00
|
|
|
|
2014-10-15 10:51:00 +04:00
|
|
|
/**
|
|
|
|
* Send an USSD on existing session. It results in error if the session is
|
|
|
|
* not existed.
|
|
|
|
*
|
|
|
|
* If successful, callback.notifySuccess() will be called.
|
|
|
|
* Otherwise, callback.notifyError() will be called.
|
|
|
|
*/
|
|
|
|
void sendUSSD(in unsigned long clientId, in DOMString ussd,
|
|
|
|
in nsITelephonyCallback callback);
|
|
|
|
|
2015-01-07 10:28:44 +03:00
|
|
|
/**
|
|
|
|
* Cancel an existing USSD session.
|
|
|
|
*
|
|
|
|
* If successful, callback.notifySuccess() will be called.
|
|
|
|
* Otherwise, callback.notifyError() will be called.
|
|
|
|
*/
|
|
|
|
void cancelUSSD(in unsigned long cliendId, in nsITelephonyCallback callback);
|
|
|
|
|
2013-03-06 13:53:08 +04:00
|
|
|
attribute bool microphoneMuted;
|
|
|
|
attribute bool speakerEnabled;
|
|
|
|
};
|
2014-09-21 11:24:44 +04:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
template<typename T> struct already_AddRefed;
|
|
|
|
|
|
|
|
already_AddRefed<nsITelephonyService>
|
|
|
|
NS_CreateTelephonyService();
|
|
|
|
%}
|