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.
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/. */
5 #include "nsIDOMEventTarget.idl"
7 interface nsIDOMEventListener;
8 interface nsIDOMDOMRequest;
9 interface nsIDOMMozMobileConnectionInfo;
10 interface nsIDOMMozMobileNetworkInfo;
11 interface nsIDOMMozMobileCellInfo;
12 interface nsIDOMMozMobileCFInfo;
13 interface nsIVariant;
15 [scriptable, builtinclass, uuid(389ad352-4e43-4c1a-85e9-bae745554326)]
16 interface nsIDOMMozMobileConnection : nsIDOMEventTarget
17 {
18 const long ICC_SERVICE_CLASS_VOICE = (1 << 0);
19 const long ICC_SERVICE_CLASS_DATA = (1 << 1);
20 const long ICC_SERVICE_CLASS_FAX = (1 << 2);
21 const long ICC_SERVICE_CLASS_SMS = (1 << 3);
22 const long ICC_SERVICE_CLASS_DATA_SYNC = (1 << 4);
23 const long ICC_SERVICE_CLASS_DATA_ASYNC = (1 << 5);
24 const long ICC_SERVICE_CLASS_PACKET = (1 << 6);
25 const long ICC_SERVICE_CLASS_PAD = (1 << 7);
26 const long ICC_SERVICE_CLASS_MAX = (1 << 7);
28 /**
29 * Call barring program.
30 *
31 * (0) all outgoing.
32 * (1) outgoing international.
33 * (2) outgoing international except to home country.
34 * (3) all incoming.
35 * (4) incoming when roaming outside the home country.
36 */
37 const long CALL_BARRING_PROGRAM_ALL_OUTGOING = 0;
38 const long CALL_BARRING_PROGRAM_OUTGOING_INTERNATIONAL = 1;
39 const long CALL_BARRING_PROGRAM_OUTGOING_INTERNATIONAL_EXCEPT_HOME = 2;
40 const long CALL_BARRING_PROGRAM_ALL_INCOMING = 3;
41 const long CALL_BARRING_PROGRAM_INCOMING_ROAMING = 4;
43 /**
44 * Calling line identification restriction constants.
45 *
46 * @see 3GPP TS 27.007 7.7 Defined values
47 *
48 * (0) Uses subscription default value.
49 * (1) Restricts CLI presentation.
50 * (2) Allows CLI presentation.
51 */
52 const long CLIR_DEFAULT = 0;
53 const long CLIR_INVOCATION = 1;
54 const long CLIR_SUPPRESSION = 2;
56 /**
57 * These two fields can be accessed by privileged applications with the
58 * 'mobilenetwork' permission.
59 */
60 readonly attribute DOMString lastKnownNetwork;
61 readonly attribute DOMString lastKnownHomeNetwork;
63 /**
64 * Information about the voice connection.
65 */
66 readonly attribute nsIDOMMozMobileConnectionInfo voice;
68 /**
69 * Information about the data connection.
70 */
71 readonly attribute nsIDOMMozMobileConnectionInfo data;
73 /**
74 * Integrated Circuit Card Identifier of the SIM this
75 * mobile connection corresponds to.
76 */
77 readonly attribute DOMString iccId;
79 /**
80 * The selection mode of the voice and data networks.
81 *
82 * Possible values: null (unknown), 'automatic', 'manual'
83 */
84 readonly attribute DOMString networkSelectionMode;
86 /**
87 * The current radio state.
88 *
89 * Possible values: null (unknown), 'enabling', 'enabled', 'disabling',
90 * 'disabled'
91 */
92 readonly attribute DOMString radioState;
94 /**
95 * Array of network types that are supported by this radio.
96 *
97 * Possible values: 'gsm', 'wcdma', 'cdma', 'evdo', 'lte'
98 */
99 readonly attribute nsIVariant supportedNetworkTypes;
101 /**
102 * Search for available networks.
103 *
104 * If successful, the request's onsuccess will be called, and the request's
105 * result will be an array of nsIDOMMozMobileNetworkInfo.
106 *
107 * Otherwise, the request's onerror will be called, and the request's error
108 * will be either 'RadioNotAvailable', 'RequestNotSupported',
109 * or 'GenericFailure'.
110 */
111 nsIDOMDOMRequest getNetworks();
113 /**
114 * Manually selects the passed in network, overriding the radio's current
115 * selection.
116 *
117 * If successful, the request's onsuccess will be called.
118 * Note: If the network was actually changed by this request,
119 * the 'voicechange' and 'datachange' events will also be fired.
120 *
121 * Otherwise, the request's onerror will be called, and the request's error
122 * will be either 'RadioNotAvailable', 'RequestNotSupported',
123 * 'IllegalSIMorME', or 'GenericFailure'
124 */
125 nsIDOMDOMRequest selectNetwork(in nsIDOMMozMobileNetworkInfo network);
127 /**
128 * Tell the radio to automatically select a network.
129 *
130 * If successful, the request's onsuccess will be called.
131 * Note: If the network was actually changed by this request, the
132 * 'voicechange' and 'datachange' events will also be fired.
133 *
134 * Otherwise, the request's onerror will be called, and the request's error
135 * will be either 'RadioNotAvailable', 'RequestNotSupported',
136 * 'IllegalSIMorME', or 'GenericFailure'
137 */
138 nsIDOMDOMRequest selectNetworkAutomatically();
140 /**
141 * Set preferred network type
142 *
143 * @param type
144 * DOMString indicates the desired preferred network type.
145 * Possible values: 'wcdma/gsm', 'gsm', 'wcdma', 'wcdma/gsm-auto',
146 * 'cdma/evdo', 'cdma', 'evdo', 'wcdma/gsm/cdma/evdo',
147 * 'lte/cdma/evdo', 'lte/wcdma/gsm',
148 * 'lte/wcdma/gsm/cdma/evdo' or 'lte'.
149 *
150 * If successful, the request's onsuccess will be called.
151 *
152 * Otherwise, the request's onerror will be called, and the request's error
153 * will be either 'RadioNotAvailable', 'RequestNotSupported',
154 * 'InvalidParameter', 'ModeNotSupported' or 'GenericFailure'
155 *
156 * TODO: param "type" should be a WebIDL enum when this interface is converted
157 * to WebIDL
158 */
159 nsIDOMDOMRequest setPreferredNetworkType(in DOMString type);
161 /**
162 * Query current preferred network type
163 *
164 * If successful, the request's onsuccess will be called. And the request's
165 * result will be a string indicating the current preferred network type.
166 * The value will be either 'wcdma/gsm', 'gsm', 'wcdma', 'wcdma/gsm-auto',
167 * 'cdma/evdo', 'cdma', 'evdo', 'wcdma/gsm/cdma/evdo', 'lte/cdma/evdo',
168 * 'lte/wcdma/gsm', 'lte/wcdma/gsm/cdma/evdo' or 'lte'.
169 *
170 * Otherwise, the request's onerror will be called, and the request's error
171 * will be either 'RadioNotAvailable', 'RequestNotSupported',
172 * or 'GenericFailure'
173 */
174 nsIDOMDOMRequest getPreferredNetworkType();
176 /**
177 * Set roaming preference
178 *
179 * @param mode
180 * DOMString indicates the desired roaming preference.
181 * Possible values: 'home', 'affiliated', or 'any'.
182 *
183 * If successful, the request's onsuccess will be called.
184 *
185 * Otherwise, the request's onerror will be called, and the request's error
186 * will be either 'RadioNotAvailable', 'RequestNotSupported',
187 * 'IllegalSIMorME', 'InvalidParameter', or 'GenericFailure'
188 *
189 * TODO: param "mode" should be a WebIDL enum when this interface is converted
190 * to WebIDL
191 */
192 nsIDOMDOMRequest setRoamingPreference(in DOMString mode);
194 /**
195 * Query current roaming preference
196 *
197 * If successful, the request's onsuccess will be called. And the request's
198 * result will be a string indicating the current roaming preference.
199 * The value will be either 'home', 'affiliated', or 'any'.
200 *
201 * Otherwise, the request's onerror will be called, and the request's error
202 * will be either 'RadioNotAvailable', 'RequestNotSupported',
203 * 'IllegalSIMorME', or 'GenericFailure'
204 */
205 nsIDOMDOMRequest getRoamingPreference();
207 /**
208 * Set voice privacy preference.
209 *
210 * @param enabled
211 * Boolean indicates the preferred voice privacy mode used in voice
212 * scrambling in CDMA networks. 'True' means the enhanced voice security
213 * is required.
214 *
215 * If successful, the request's onsuccess will be called.
216 *
217 * Otherwise, the request's onerror will be called, and the request's error
218 * will be either 'RadioNotAvailable', 'RequestNotSupported',
219 * 'IllegalSIMorME', 'InvalidParameter', or 'GenericFailure'
220 */
221 nsIDOMDOMRequest setVoicePrivacyMode(in bool enabled);
223 /**
224 * Query current voice privacy mode.
225 *
226 * If successful, the request's onsuccess will be called. And the request's
227 * result will be a boolean indicating the current voice privacy mode.
228 *
229 * Otherwise, the request's onerror will be called, and the request's error
230 * will be either 'RadioNotAvailable', 'RequestNotSupported',
231 * 'IllegalSIMorME', or 'GenericFailure'
232 */
233 nsIDOMDOMRequest getVoicePrivacyMode();
235 /**
236 * Send a MMI message.
237 *
238 * @param mmi
239 * DOMString containing an MMI string that can be associated to a
240 * USSD request or other RIL functionality.
241 *
242 * @return a nsIDOMDOMRequest
243 * The request's result will be an object containing information
244 * about the operation.
245 *
246 * In case that the MMI code requires sending an USSD request, the DOMrequest
247 * 'success' event means that the RIL has successfully processed and sent the
248 * USSD request to the network. The network reply will be reported via
249 * 'onussdreceived' event. If the MMI code is not associated to a USSD but to
250 * other RIL request its result, if one is needed, will be notified via the
251 * returned DOMRequest 'success' or 'error' event.
252 */
253 nsIDOMDOMRequest sendMMI(in DOMString mmi);
255 /**
256 * Cancel the current MMI request if one exists.
257 */
258 nsIDOMDOMRequest cancelMMI();
260 /**
261 * Configures call forward options.
262 *
263 * @param CFInfo
264 * An object containing the call forward rule to set.
265 *
266 * If successful, the request's onsuccess will be called.
267 *
268 * Otherwise, the request's onerror will be called, and the request's error
269 * will be either 'RadioNotAvailable', 'RequestNotSupported',
270 * 'IllegalSIMorME', 'InvalidParameter', or 'GenericFailure'
271 */
272 nsIDOMDOMRequest setCallForwardingOption(in nsIDOMMozMobileCFInfo CFInfo);
274 /**
275 * Queries current call forward options.
276 *
277 * @param reason
278 * Indicates the reason the call is being forwarded. It will be either
279 * unconditional (0), mobile busy (1), no reply (2), not reachable (3),
280 * all call forwarding (4), or all conditional call forwarding (5).
281 *
282 * If successful, the request's onsuccess will be called, and the request's
283 * result will be an array of nsIDOMMozMobileCFInfo.
284 *
285 * Otherwise, the request's onerror will be called, and the request's error
286 * will be either 'RadioNotAvailable', 'RequestNotSupported',
287 * 'InvalidParameter', or 'GenericFailure'.
288 */
289 nsIDOMDOMRequest getCallForwardingOption(in unsigned short reason);
291 /**
292 * Configures call barring option.
293 *
294 * @param option
295 * An object containing the call barring rule to set.
296 * @see MozCallBarringOption for the detail of info.
297 *
298 * If successful, the request's onsuccess will be called.
299 *
300 * Otherwise, the request's onerror will be called, and the request's error
301 * will be either 'RadioNotAvailable', 'RequestNotSupported',
302 * 'IllegalSIMorME', 'InvalidParameter', or 'GenericFailure'
303 */
304 nsIDOMDOMRequest setCallBarringOption(in jsval option);
306 /**
307 * Queries current call barring status.
308 *
309 * @param info
310 * An object containing the call barring rule to query. No need to
311 * specify 'enabled' property.
312 * @see MozCallBarringOption for the detail of info.
313 *
314 * If successful, the request's onsuccess will be called, and the request's
315 * result will be an object of MozCallBarringOption with correct 'enabled'
316 * property indicating the status of this rule.
317 *
318 * Otherwise, the request's onerror will be called, and the request's error
319 * will be either 'RadioNotAvailable', 'RequestNotSupported',
320 * 'InvalidParameter', or 'GenericFailure'.
321 */
322 nsIDOMDOMRequest getCallBarringOption(in jsval option);
324 /**
325 * Change call barring facility password.
326 *
327 * @param info
328 * An object containing information about pin and newPin, and,
329 * this object must have both "pin" and "newPin" attributes
330 * to change the call barring facility password.
331 *
332 * Example:
333 *
334 * changeCallBarringPassword({pin: "...",
335 * newPin: "..."});
336 */
337 nsIDOMDOMRequest changeCallBarringPassword(in jsval info);
339 /**
340 * Configures call waiting options.
341 *
342 * @param enabled
343 * Value containing the desired call waiting status.
344 *
345 * If successful, the request's onsuccess will be called.
346 *
347 * Otherwise, the request's onerror will be called, and the request's error
348 * will be either 'RadioNotAvailable', 'RequestNotSupported',
349 * 'IllegalSIMorME', or 'GenericFailure'
350 */
351 nsIDOMDOMRequest setCallWaitingOption(in bool enabled);
353 /**
354 * Queries current call waiting options.
355 *
356 * If successful, the request's onsuccess will be called, and the request's
357 * result will be a boolean indicating the call waiting status.
358 *
359 *
360 * Otherwise, the request's onerror will be called, and the request's error
361 * will be either 'RadioNotAvailable', 'RequestNotSupported',
362 * or 'GenericFailure'.
363 */
364 nsIDOMDOMRequest getCallWaitingOption();
366 /**
367 * Enables or disables the presentation of the calling line identity (CLI) to
368 * the called party when originating a call.
369 *
370 * @param clirMode
371 * Is one of the CLIR_* constants.
372 *
373 * If successful, the request's onsuccess will be called.
374 *
375 * Otherwise, the request's onerror will be called, and the request's error
376 * will be either 'RadioNotAvailable', 'RequestNotSupported',
377 */
378 nsIDOMDOMRequest setCallingLineIdRestriction(in unsigned short clirMode);
380 /**
381 * Queries current CLIR status.
382 *
383 * If successful, the request's onsuccess will be called, and the request's
384 * result will be a DOMCLIRStatus dictionary containing CLIR 'n' and 'm'
385 * parameter.
386 *
387 * Otherwise, the request's onerror will be called, and the request's error
388 * will be either 'RadioNotAvailable', 'RequestNotSupported',
389 * or 'GenericFailure'.
390 */
391 nsIDOMDOMRequest getCallingLineIdRestriction();
393 /**
394 * Exit emergency callback mode.
395 *
396 * If successful, the request's onsuccess will be called.
397 *
398 * Otherwise, the request's onerror will be called, and the request's error
399 * will be either 'RequestNotSupported' or 'GenericFailure'.
400 */
401 nsIDOMDOMRequest exitEmergencyCbMode();
403 /**
404 * Set radio enabled/disabled.
405 *
406 * @param enabled
407 * True to enable the radio.
408 *
409 * If successful, the request's onsuccess will be called.
410 *
411 * Otherwise, the request's onerror will be called, and the request's error
412 * will be either 'InvalidStateError', 'RadioNotAvailable', or
413 * 'GenericFailure'.
414 *
415 * Note: Request is not available when radioState is null, 'enabling', or
416 * 'disabling'. Calling the function in above conditions will receive
417 * 'InvalidStateError' error.
418 */
419 nsIDOMDOMRequest setRadioEnabled(in boolean enabled);
421 /**
422 * The 'voicechange' event is notified whenever the voice connection object
423 * changes.
424 */
425 [implicit_jscontext] attribute jsval onvoicechange;
427 /**
428 * The 'datachange' event is notified whenever the data connection object
429 * changes values.
430 */
431 [implicit_jscontext] attribute jsval ondatachange;
433 /**
434 * The 'ussdreceived' event is notified whenever a new USSD message is
435 * received.
436 */
437 [implicit_jscontext] attribute jsval onussdreceived;
439 /**
440 * The 'dataerror' event is notified whenever the data connection object
441 * receives an error from the RIL
442 */
443 [implicit_jscontext] attribute jsval ondataerror;
445 /**
446 * The 'oncfstatechange' event is notified whenever the call forwarding
447 * state changes.
448 */
449 [implicit_jscontext] attribute jsval oncfstatechange;
451 /**
452 * The 'emergencycbmodechange' event is notified whenever the emergency
453 * callback mode changes.
454 */
455 [implicit_jscontext] attribute jsval onemergencycbmodechange;
457 /**
458 * The 'onotastatuschange' event is notified whenever the ota provision status
459 * changes.
460 */
461 [implicit_jscontext] attribute jsval onotastatuschange;
463 /**
464 * The 'oniccchange' event is notified whenever the iccid value
465 * changes.
466 */
467 [implicit_jscontext] attribute jsval oniccchange;
469 /**
470 * The 'onradiostatechange' event is notified whenever the radio state
471 * changes.
472 */
473 [implicit_jscontext] attribute jsval onradiostatechange;
474 };
476 [scriptable, uuid(49706beb-a160-40b7-b745-50f62e389a2c)]
477 interface nsIDOMMozMobileConnectionInfo : nsISupports
478 {
479 /**
480 * State of the connection.
481 *
482 * Possible values: 'notSearching', 'searching', 'denied', 'registered'.
483 * null if the state is unknown.
484 */
485 readonly attribute DOMString state;
487 /**
488 * Indicates whether the connection is ready. This may be different
489 */
490 readonly attribute bool connected;
492 /**
493 * Indicates whether only emergency calls are possible.
494 *
495 * This flag is only relevant to voice connections and when 'connected' is
496 * false.
497 */
498 readonly attribute bool emergencyCallsOnly;
500 /**
501 * Indicates whether the connection is going through a foreign operator
502 * (roaming) or not.
503 */
504 readonly attribute bool roaming;
506 /**
507 * Network operator
508 */
509 readonly attribute nsIDOMMozMobileNetworkInfo network;
511 /**
512 * Type of connection.
513 *
514 * Possible values: 'gsm', 'cdma', gprs', 'edge', 'umts', 'hsdpa', 'evdo0',
515 * 'evdoa', 'evdob', etc.
516 */
517 readonly attribute DOMString type;
519 /**
520 * Signal strength in dBm, or null if no service is available.
521 */
522 readonly attribute jsval signalStrength;
524 /**
525 * Signal strength, represented linearly as a number between 0 (weakest
526 * signal) and 100 (full signal).
527 */
528 readonly attribute jsval relSignalStrength;
530 /**
531 * Cell location.
532 */
533 readonly attribute nsIDOMMozMobileCellInfo cell;
535 };
537 [scriptable, uuid(40018fc7-4c42-47b6-8de6-3591a9c622bc)]
538 interface nsIDOMMozMobileNetworkInfo: nsISupports
539 {
540 /**
541 * Short name of the network operator
542 */
543 readonly attribute DOMString shortName;
545 /**
546 * Long name of the network operator
547 */
548 readonly attribute DOMString longName;
550 /**
551 * Mobile Country Code (MCC) of the network operator
552 */
553 readonly attribute DOMString mcc;
555 /**
556 * Mobile Network Code (MNC) of the network operator
557 */
558 readonly attribute DOMString mnc;
560 /**
561 * State of this network operator.
562 *
563 * Possible values: 'available', 'connected', 'forbidden', or null (unknown)
564 */
565 readonly attribute DOMString state;
566 };
568 [scriptable, uuid(9750b3a7-d913-436e-95d4-7ef2973ec6a1)]
569 interface nsIDOMMozMobileCellInfo: nsISupports
570 {
571 /**
572 * Mobile Location Area Code (LAC) for GSM/WCDMA networks.
573 *
574 * Possible ranges from 0x0000 to 0xffff.
575 * -1 if the LAC is unknown.
576 */
577 readonly attribute long gsmLocationAreaCode;
579 /**
580 * Mobile Cell ID for GSM/WCDMA networks.
581 *
582 * Possible ranges from 0x00000000 to 0xffffffff.
583 * -1 if the cell id is unknown.
584 */
585 readonly attribute long long gsmCellId;
587 /**
588 * Base Station ID for CDMA networks.
589 *
590 * Possible ranges from 0 to 65535
591 * -1 if the base station id is unknown.
592 */
593 readonly attribute long cdmaBaseStationId;
595 /**
596 * Base Station Latitude for CDMA networks.
597 *
598 * Possible ranges from -1296000 to 1296000.
599 * -2147483648 if the latitude is unknown.
600 *
601 * @see 3GPP2 C.S0005-A v6.0.
602 */
603 readonly attribute long cdmaBaseStationLatitude;
605 /**
606 * Base Station Longitude for CDMA networks.
607 *
608 * Possible ranges from -2592000 to 2592000.
609 * -2147483648 if the longitude is unknown.
610 *
611 * @see 3GPP2 C.S0005-A v6.0.
612 */
613 readonly attribute long cdmaBaseStationLongitude;
615 /**
616 * System ID for CDMA networks.
617 *
618 * Possible ranges from 0 to 32767.
619 * -1 if the system id is unknown.
620 */
621 readonly attribute long cdmaSystemId;
623 /**
624 * Network ID for CDMA networks.
625 *
626 * Possible ranges from 0 to 65535.
627 * -1 if the network id is unknown.
628 */
629 readonly attribute long cdmaNetworkId;
630 };
632 [scriptable, uuid(d1b35ad8-99aa-47cc-ab49-2e72b00e39df)]
633 interface nsIDOMMozMobileCFInfo : nsISupports
634 {
635 /**
636 * Call forwarding rule status.
637 *
638 * It will be either not active (false), or active (true).
639 *
640 * Note: Unused for setting call forwarding options. It reports
641 * the status of the rule when getting how the rule is
642 * configured.
643 *
644 * @see 3GPP TS 27.007 7.11 "status".
645 */
646 readonly attribute bool active;
648 const long CALL_FORWARD_ACTION_DISABLE = 0;
649 const long CALL_FORWARD_ACTION_ENABLE = 1;
650 const long CALL_FORWARD_ACTION_QUERY_STATUS = 2;
651 const long CALL_FORWARD_ACTION_REGISTRATION = 3;
652 const long CALL_FORWARD_ACTION_ERASURE = 4;
654 /**
655 * Indicates what to do with the rule.
656 *
657 * One of the CALL_FORWARD_ACTION_* constants. It will be either disable (0),
658 * enable (1), query status (2), registration (3), or erasure (4).
659 *
660 * @see 3GPP TS 27.007 7.11 "mode".
661 */
662 readonly attribute unsigned short action;
664 const long CALL_FORWARD_REASON_UNCONDITIONAL = 0;
665 const long CALL_FORWARD_REASON_MOBILE_BUSY = 1;
666 const long CALL_FORWARD_REASON_NO_REPLY = 2;
667 const long CALL_FORWARD_REASON_NOT_REACHABLE = 3;
668 const long CALL_FORWARD_REASON_ALL_CALL_FORWARDING = 4;
669 const long CALL_FORWARD_REASON_ALL_CONDITIONAL_CALL_FORWARDING = 5;
671 /**
672 * Indicates the reason the call is being forwarded.
673 *
674 * One of the CALL_FORWARD_REASON_* constants. It will be either
675 * unconditional (0), mobile busy (1), no reply (2), not reachable (3),
676 * all call forwarding (4), or all conditional call forwarding (5).
677 *
678 * @see 3GPP TS 27.007 7.11 "reason".
679 */
680 readonly attribute unsigned short reason;
682 /**
683 * Phone number of forwarding address.
684 */
685 readonly attribute DOMString number;
687 /**
688 * When "no reply" is enabled or queried, this gives the time in
689 * seconds to wait before call is forwarded.
690 */
691 readonly attribute unsigned short timeSeconds;
693 /**
694 * Service for which the call forward is set up. It should be one of the
695 * nsIDOMMozMobileConnection.ICC_SERVICE_CLASS_* values.
696 */
697 readonly attribute unsigned short serviceClass;
698 };