Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #include "nsISupports.idl" |
michael@0 | 6 | |
michael@0 | 7 | [scriptable, uuid(c25d3993-6481-4e12-acee-55e32f6e1454)] |
michael@0 | 8 | interface nsITelephonyListener : nsISupports |
michael@0 | 9 | { |
michael@0 | 10 | /** |
michael@0 | 11 | * Notified when a telephony call changes state. |
michael@0 | 12 | * |
michael@0 | 13 | * @param clientId |
michael@0 | 14 | Indicate the RIL client, 0 ~ (number of client - 1). |
michael@0 | 15 | * @param callIndex |
michael@0 | 16 | * Call identifier assigned by the RIL. |
michael@0 | 17 | * @param callState |
michael@0 | 18 | * One of the nsITelephonyProvider::CALL_STATE_* values. |
michael@0 | 19 | * @param number |
michael@0 | 20 | * Number of the other party. |
michael@0 | 21 | * @param isActive |
michael@0 | 22 | * Indicates whether this call is the currently active one. |
michael@0 | 23 | * @param isOutgoing |
michael@0 | 24 | * Indicates whether this call is outgoing or incoming. |
michael@0 | 25 | * @param isEmergency |
michael@0 | 26 | * Indicates whether this call is an emergency call. |
michael@0 | 27 | * @param isConference |
michael@0 | 28 | * Indicates whether this call is a conference call. |
michael@0 | 29 | * @param isSwitchable |
michael@0 | 30 | * Indicates whether this call can be switched between states of |
michael@0 | 31 | * nsITelephonyProvider::CALL_STATE_CONNECTED and |
michael@0 | 32 | * nsITelephonyProvider::CALL_STATE_HELD. |
michael@0 | 33 | * @param isMergeable |
michael@0 | 34 | * Indicates whether this call be be added into a conference. |
michael@0 | 35 | */ |
michael@0 | 36 | void callStateChanged(in unsigned long clientId, |
michael@0 | 37 | in unsigned long callIndex, |
michael@0 | 38 | in unsigned short callState, |
michael@0 | 39 | in AString number, |
michael@0 | 40 | in boolean isActive, |
michael@0 | 41 | in boolean isOutgoing, |
michael@0 | 42 | in boolean isEmergency, |
michael@0 | 43 | in boolean isConference, |
michael@0 | 44 | in boolean isSwitchable, |
michael@0 | 45 | in boolean isMergeable); |
michael@0 | 46 | |
michael@0 | 47 | /** |
michael@0 | 48 | * Called when participants of a conference call have been updated, and the |
michael@0 | 49 | * conference call state changes. |
michael@0 | 50 | * |
michael@0 | 51 | * @param callState |
michael@0 | 52 | * Possible values are: nsITelephonyProvider::CALL_STATE_UNKNOWN, |
michael@0 | 53 | * nsITelephonyProvider::CALL_STATE_HELD, |
michael@0 | 54 | * nsITelephonyProvider::CALL_STATE_CONNECTED. |
michael@0 | 55 | */ |
michael@0 | 56 | void conferenceCallStateChanged(in unsigned short callState); |
michael@0 | 57 | |
michael@0 | 58 | /** |
michael@0 | 59 | * Called when enumeration asked by nsITelephonyProvider::enumerateCalls |
michael@0 | 60 | * is completed. |
michael@0 | 61 | */ |
michael@0 | 62 | void enumerateCallStateComplete(); |
michael@0 | 63 | |
michael@0 | 64 | /** |
michael@0 | 65 | * Called when nsITelephonyProvider is asked to enumerate the current |
michael@0 | 66 | * telephony call state (nsITelephonyProvider::enumerateCalls). This is |
michael@0 | 67 | * called once per call that is currently managed by the RIL. |
michael@0 | 68 | * |
michael@0 | 69 | * @param clientId |
michael@0 | 70 | Indicate the RIL client, 0 ~ (number of client - 1). |
michael@0 | 71 | * @param callIndex |
michael@0 | 72 | * Call identifier assigned by the RIL. |
michael@0 | 73 | * @param callState |
michael@0 | 74 | * One of the nsITelephonyProvider::CALL_STATE_* values. |
michael@0 | 75 | * @param number |
michael@0 | 76 | * Number of the other party. |
michael@0 | 77 | * @param isActive |
michael@0 | 78 | * Indicates whether this call is the active one. |
michael@0 | 79 | * @param isOutgoing |
michael@0 | 80 | * Indicates whether this call is outgoing or incoming. |
michael@0 | 81 | * @param isConference |
michael@0 | 82 | * Indicates whether this call is a conference call. |
michael@0 | 83 | * @param isSwitchable |
michael@0 | 84 | * Indicates whether this call can be switched between states of |
michael@0 | 85 | * nsITelephonyProvider::CALL_STATE_CONNECTED and |
michael@0 | 86 | * nsITelephonyProvider::CALL_STATE_HELD. |
michael@0 | 87 | * @param isMergeable |
michael@0 | 88 | * Indicates whether this call be be added into a conference. |
michael@0 | 89 | */ |
michael@0 | 90 | void enumerateCallState(in unsigned long clientId, |
michael@0 | 91 | in unsigned long callIndex, |
michael@0 | 92 | in unsigned short callState, |
michael@0 | 93 | in AString number, |
michael@0 | 94 | in boolean isActive, |
michael@0 | 95 | in boolean isOutgoing, |
michael@0 | 96 | in boolean isEmergency, |
michael@0 | 97 | in boolean isConference, |
michael@0 | 98 | in boolean isSwitchable, |
michael@0 | 99 | in boolean isMergeable); |
michael@0 | 100 | |
michael@0 | 101 | /** |
michael@0 | 102 | * Notify when RIL receives supplementary service notification. |
michael@0 | 103 | * |
michael@0 | 104 | * @param clientId |
michael@0 | 105 | Indicate the RIL client, 0 ~ (number of client - 1). |
michael@0 | 106 | * @param callIndex |
michael@0 | 107 | * Call identifier assigned by the RIL. -1 if not specified |
michael@0 | 108 | * @param notification |
michael@0 | 109 | * One of the nsITelephonyProvider::NOTIFICATION_* values. |
michael@0 | 110 | */ |
michael@0 | 111 | void supplementaryServiceNotification(in unsigned long clientId, |
michael@0 | 112 | in long callIndex, |
michael@0 | 113 | in unsigned short notification); |
michael@0 | 114 | |
michael@0 | 115 | /** |
michael@0 | 116 | * Called when RIL error occurs. |
michael@0 | 117 | * |
michael@0 | 118 | * @param clientId |
michael@0 | 119 | Indicate the RIL client, 0 ~ (number of client - 1). |
michael@0 | 120 | * @param callIndex |
michael@0 | 121 | * Call identifier assigned by the RIL. -1 if no connection |
michael@0 | 122 | * @param error |
michael@0 | 123 | * Error from RIL. |
michael@0 | 124 | */ |
michael@0 | 125 | void notifyError(in unsigned long clientId, |
michael@0 | 126 | in long callIndex, |
michael@0 | 127 | in AString error); |
michael@0 | 128 | |
michael@0 | 129 | /** |
michael@0 | 130 | * Called when a waiting call comes in CDMA networks. |
michael@0 | 131 | * |
michael@0 | 132 | * @param clientId |
michael@0 | 133 | Indicate the RIL client, 0 ~ (number of client - 1). |
michael@0 | 134 | * @param number |
michael@0 | 135 | * Number of the other party. |
michael@0 | 136 | */ |
michael@0 | 137 | void notifyCdmaCallWaiting(in unsigned long clientId, in AString number); |
michael@0 | 138 | |
michael@0 | 139 | /** |
michael@0 | 140 | * Called when RIL error occurs to creating or separating a conference call. |
michael@0 | 141 | * |
michael@0 | 142 | * @param name |
michael@0 | 143 | * Error name. Possible values are addError and removeError. |
michael@0 | 144 | * @param message |
michael@0 | 145 | * Detailed error message from RIL. |
michael@0 | 146 | */ |
michael@0 | 147 | void notifyConferenceError(in AString name, |
michael@0 | 148 | in AString message); |
michael@0 | 149 | }; |
michael@0 | 150 | |
michael@0 | 151 | [scriptable, uuid(c095aa82-aacb-4e53-a787-56a89c3f638e)] |
michael@0 | 152 | interface nsITelephonyCallback : nsISupports |
michael@0 | 153 | { |
michael@0 | 154 | /** |
michael@0 | 155 | * Called when a dial request fails. |
michael@0 | 156 | * @param error |
michael@0 | 157 | * Error from RIL. |
michael@0 | 158 | */ |
michael@0 | 159 | void notifyDialError(in AString error); |
michael@0 | 160 | |
michael@0 | 161 | /** |
michael@0 | 162 | * Called when a dial request succeeds. |
michael@0 | 163 | */ |
michael@0 | 164 | void notifyDialSuccess(); |
michael@0 | 165 | }; |
michael@0 | 166 | |
michael@0 | 167 | %{C++ |
michael@0 | 168 | #define TELEPHONY_PROVIDER_CID \ |
michael@0 | 169 | { 0x9cf8aa52, 0x7c1c, 0x4cde, { 0x97, 0x4e, 0xed, 0x2a, 0xa0, 0xe7, 0x35, 0xfa } } |
michael@0 | 170 | #define TELEPHONY_PROVIDER_CONTRACTID \ |
michael@0 | 171 | "@mozilla.org/telephony/telephonyprovider;1" |
michael@0 | 172 | %} |
michael@0 | 173 | |
michael@0 | 174 | /** |
michael@0 | 175 | * XPCOM component (in the content process) that provides the telephony |
michael@0 | 176 | * information. |
michael@0 | 177 | */ |
michael@0 | 178 | [scriptable, uuid(b16ca98f-994f-4ae1-8c2d-e7b18e08d1f3)] |
michael@0 | 179 | interface nsITelephonyProvider : nsISupports |
michael@0 | 180 | { |
michael@0 | 181 | const unsigned short CALL_STATE_UNKNOWN = 0; |
michael@0 | 182 | const unsigned short CALL_STATE_DIALING = 1; |
michael@0 | 183 | const unsigned short CALL_STATE_ALERTING = 2; |
michael@0 | 184 | const unsigned short CALL_STATE_CONNECTING = 3; |
michael@0 | 185 | const unsigned short CALL_STATE_CONNECTED = 4; |
michael@0 | 186 | const unsigned short CALL_STATE_HOLDING = 5; |
michael@0 | 187 | const unsigned short CALL_STATE_HELD = 6; |
michael@0 | 188 | const unsigned short CALL_STATE_RESUMING = 7; |
michael@0 | 189 | const unsigned short CALL_STATE_DISCONNECTING = 8; |
michael@0 | 190 | const unsigned short CALL_STATE_DISCONNECTED = 9; |
michael@0 | 191 | const unsigned short CALL_STATE_INCOMING = 10; |
michael@0 | 192 | |
michael@0 | 193 | const unsigned short NOTIFICATION_REMOTE_HELD = 0; |
michael@0 | 194 | const unsigned short NOTIFICATION_REMOTE_RESUMED = 1; |
michael@0 | 195 | |
michael@0 | 196 | readonly attribute unsigned long defaultServiceId; |
michael@0 | 197 | |
michael@0 | 198 | /** |
michael@0 | 199 | * Called when a content process registers receiving unsolicited messages from |
michael@0 | 200 | * RadioInterfaceLayer in the chrome process. Only a content process that has |
michael@0 | 201 | * the 'telephony' permission is allowed to register. |
michael@0 | 202 | */ |
michael@0 | 203 | void registerListener(in nsITelephonyListener listener); |
michael@0 | 204 | void unregisterListener(in nsITelephonyListener listener); |
michael@0 | 205 | |
michael@0 | 206 | /** |
michael@0 | 207 | * Will continue calling listener.enumerateCallState until the listener |
michael@0 | 208 | * returns false. |
michael@0 | 209 | */ |
michael@0 | 210 | void enumerateCalls(in nsITelephonyListener listener); |
michael@0 | 211 | |
michael@0 | 212 | /** |
michael@0 | 213 | * Functionality for making and managing phone calls. |
michael@0 | 214 | */ |
michael@0 | 215 | void dial(in unsigned long clientId, in DOMString number, |
michael@0 | 216 | in boolean isEmergency, in nsITelephonyCallback callback); |
michael@0 | 217 | void hangUp(in unsigned long clientId, in unsigned long callIndex); |
michael@0 | 218 | |
michael@0 | 219 | void startTone(in unsigned long clientId, in DOMString dtmfChar); |
michael@0 | 220 | void stopTone(in unsigned long clientId); |
michael@0 | 221 | |
michael@0 | 222 | void answerCall(in unsigned long clientId, in unsigned long callIndex); |
michael@0 | 223 | void rejectCall(in unsigned long clientId, in unsigned long callIndex); |
michael@0 | 224 | void holdCall(in unsigned long clientId, in unsigned long callIndex); |
michael@0 | 225 | void resumeCall(in unsigned long clientId, in unsigned long callIndex); |
michael@0 | 226 | |
michael@0 | 227 | void conferenceCall(in unsigned long clientId); |
michael@0 | 228 | void separateCall(in unsigned long clientId, in unsigned long callIndex); |
michael@0 | 229 | void holdConference(in unsigned long clientId); |
michael@0 | 230 | void resumeConference(in unsigned long clientId); |
michael@0 | 231 | |
michael@0 | 232 | attribute bool microphoneMuted; |
michael@0 | 233 | attribute bool speakerEnabled; |
michael@0 | 234 | }; |