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