2012-04-19 14:33:25 -07: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 "nsIDOMEventTarget.idl"
|
|
|
|
|
|
|
|
interface nsIDOMEventListener;
|
|
|
|
interface nsIDOMDOMRequest;
|
2012-09-03 14:43:09 -07:00
|
|
|
interface nsIDOMMozMobileICCInfo;
|
2012-04-19 14:33:25 -07:00
|
|
|
interface nsIDOMMozMobileConnectionInfo;
|
2012-06-12 14:05:50 -07:00
|
|
|
interface nsIDOMMozMobileNetworkInfo;
|
2012-08-15 18:36:43 -07:00
|
|
|
interface nsIDOMMozMobileCellInfo;
|
2012-08-12 18:55:26 -07:00
|
|
|
interface nsIDOMMozIccManager;
|
2012-04-19 14:33:25 -07:00
|
|
|
|
2012-10-02 23:29:07 -07:00
|
|
|
[scriptable, builtinclass, uuid(5362762c-7091-4da9-aecd-ba878bc51b3d)]
|
2012-04-19 14:33:25 -07:00
|
|
|
interface nsIDOMMozMobileConnection : nsIDOMEventTarget
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Indicates the state of the device's ICC card.
|
|
|
|
*
|
|
|
|
* Possible values: null, 'absent', 'pinRequired', 'pukRequired',
|
|
|
|
* 'networkLocked', 'ready'.
|
|
|
|
*/
|
|
|
|
readonly attribute DOMString cardState;
|
|
|
|
|
2012-09-03 14:43:09 -07:00
|
|
|
/**
|
|
|
|
* Information stored in the device's ICC card.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIDOMMozMobileICCInfo iccInfo;
|
|
|
|
|
2012-04-19 14:33:25 -07:00
|
|
|
/**
|
|
|
|
* Information about the voice connection.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIDOMMozMobileConnectionInfo voice;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Information about the data connection.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIDOMMozMobileConnectionInfo data;
|
|
|
|
|
2012-06-19 15:52:06 -07:00
|
|
|
/**
|
|
|
|
* The selection mode of the voice and data networks.
|
|
|
|
*
|
|
|
|
* Possible values: null (unknown), 'automatic', 'manual'
|
|
|
|
*/
|
|
|
|
readonly attribute DOMString networkSelectionMode;
|
|
|
|
|
2012-08-12 18:55:26 -07:00
|
|
|
/**
|
|
|
|
* IccManager provides access to ICC related funcionality.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIDOMMozIccManager icc;
|
|
|
|
|
2012-04-19 14:33:25 -07:00
|
|
|
/**
|
|
|
|
* Search for available networks.
|
|
|
|
*
|
2012-06-01 14:10:39 -07:00
|
|
|
* If successful, the request's onsuccess will be called, and the request's
|
2012-06-12 14:05:50 -07:00
|
|
|
* result will be an array of nsIDOMMozMobileNetworkInfo.
|
2012-06-01 14:10:39 -07:00
|
|
|
*
|
|
|
|
* Otherwise, the request's onerror will be called, and the request's error
|
2012-06-19 15:52:06 -07:00
|
|
|
* will be either 'RadioNotAvailable', 'RequestNotSupported',
|
|
|
|
* or 'GenericFailure'.
|
2012-04-19 14:33:25 -07:00
|
|
|
*/
|
|
|
|
nsIDOMDOMRequest getNetworks();
|
|
|
|
|
2012-06-19 15:52:06 -07:00
|
|
|
/**
|
|
|
|
* Manually selects the passed in network, overriding the radio's current
|
|
|
|
* selection.
|
|
|
|
*
|
|
|
|
* If successful, the request's onsuccess will be called.
|
|
|
|
* Note: If the network was actually changed by this request,
|
|
|
|
* the 'voicechange' and 'datachange' events will also be fired.
|
|
|
|
*
|
|
|
|
* Otherwise, the request's onerror will be called, and the request's error
|
|
|
|
* will be either 'RadioNotAvailable', 'RequestNotSupported',
|
|
|
|
* 'IllegalSIMorME', or 'GenericFailure'
|
|
|
|
*/
|
|
|
|
nsIDOMDOMRequest selectNetwork(in nsIDOMMozMobileNetworkInfo network);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tell the radio to automatically select a network.
|
|
|
|
*
|
|
|
|
* If successful, the request's onsuccess will be called.
|
|
|
|
* Note: If the network was actually changed by this request, the
|
|
|
|
* 'voicechange' and 'datachange' events will also be fired.
|
|
|
|
*
|
|
|
|
* Otherwise, the request's onerror will be called, and the request's error
|
|
|
|
* will be either 'RadioNotAvailable', 'RequestNotSupported',
|
|
|
|
* 'IllegalSIMorME', or 'GenericFailure'
|
|
|
|
*/
|
|
|
|
nsIDOMDOMRequest selectNetworkAutomatically();
|
|
|
|
|
2012-04-11 21:01:49 -07:00
|
|
|
/**
|
|
|
|
* Find out about the status of an ICC lock (e.g. the PIN lock).
|
|
|
|
*
|
|
|
|
* @param lockType
|
|
|
|
* Identifies the lock type, e.g. "pin" for the PIN lock.
|
|
|
|
*
|
|
|
|
* @return a DOM Request.
|
2012-06-09 14:07:18 -07:00
|
|
|
* The request's result will be an object containing
|
2012-04-11 21:01:49 -07:00
|
|
|
* information about the specified lock's status,
|
|
|
|
* e.g. {lockType: "pin", enabled: true}.
|
|
|
|
*/
|
|
|
|
nsIDOMDOMRequest getCardLock(in DOMString lockType);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unlock a card lock.
|
|
|
|
*
|
|
|
|
* @param info
|
|
|
|
* An object containing the information necessary to unlock
|
|
|
|
* the given lock. At a minimum, this object must have a
|
|
|
|
* "lockType" attribute which specifies the type of lock, e.g.
|
|
|
|
* "pin" for the PIN lock. Other attributes are dependent on
|
|
|
|
* the lock type.
|
|
|
|
*
|
|
|
|
* Examples:
|
|
|
|
*
|
|
|
|
* (1) Unlocking the PIN:
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "pin",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
2012-09-28 03:46:47 -07:00
|
|
|
* (2) Network depersonalization. Unlocking the network control key (NCK).
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "nck",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
|
|
|
* (3) Unlocking the PUK and supplying a new PIN:
|
2012-04-11 21:01:49 -07:00
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "puk",
|
|
|
|
* puk: "...",
|
|
|
|
* newPin: "..."});
|
|
|
|
*
|
|
|
|
* @return a nsIDOMDOMRequest.
|
2012-06-09 14:07:18 -07:00
|
|
|
* The request's result will be an object containing
|
2012-04-11 21:01:49 -07:00
|
|
|
* information about the unlock operation.
|
|
|
|
*
|
|
|
|
* Examples:
|
|
|
|
*
|
|
|
|
* (1) Unlocking failed:
|
|
|
|
*
|
|
|
|
* {
|
|
|
|
* lockType: "pin",
|
|
|
|
* result: false,
|
|
|
|
* retryCount: 2
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* (2) Unlocking succeeded:
|
|
|
|
*
|
|
|
|
* {
|
|
|
|
* lockType: "pin",
|
|
|
|
* result: true
|
|
|
|
* }
|
|
|
|
*/
|
|
|
|
nsIDOMDOMRequest unlockCardLock(in jsval info);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Modify the state of a card lock.
|
|
|
|
*
|
|
|
|
* @param info
|
|
|
|
* An object containing information about the lock and
|
|
|
|
* how to modify its state. At a minimum, this object
|
|
|
|
* must have a "lockType" attribute which specifies the
|
|
|
|
* type of lock, e.g. "pin" for the PIN lock. Other
|
|
|
|
* attributes are dependent on the lock type.
|
|
|
|
*
|
|
|
|
* Examples:
|
|
|
|
*
|
|
|
|
* (1) Disabling the PIN lock:
|
|
|
|
*
|
|
|
|
* setCardLock({lockType: "pin",
|
|
|
|
* pin: "...",
|
|
|
|
* enabled: false});
|
|
|
|
*
|
|
|
|
* (2) Changing the PIN:
|
|
|
|
*
|
|
|
|
* setCardLock({lockType: "pin",
|
|
|
|
* pin: "...",
|
|
|
|
* newPin: "..."});
|
|
|
|
*
|
|
|
|
* @return a nsIDOMDOMRequest.
|
2012-06-09 14:07:18 -07:00
|
|
|
* The request's result will be an object containing
|
2012-04-11 21:01:49 -07:00
|
|
|
* information about the operation.
|
|
|
|
*
|
|
|
|
* Examples:
|
|
|
|
*
|
|
|
|
* (1) Enabling/Disabling card lock failed or change card lock failed.
|
|
|
|
*
|
|
|
|
* {
|
|
|
|
* lockType: "pin",
|
|
|
|
* result: false,
|
|
|
|
* retryCount: 2
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* (2) Enabling/Disabling card lock succeed or change card lock succeed.
|
|
|
|
*
|
|
|
|
* {
|
|
|
|
* lockType: "pin",
|
|
|
|
* result: true
|
|
|
|
* }
|
|
|
|
*/
|
|
|
|
nsIDOMDOMRequest setCardLock(in jsval info);
|
2012-06-09 14:07:18 -07:00
|
|
|
|
|
|
|
/**
|
2012-10-05 07:08:55 -07:00
|
|
|
* Send a MMI message.
|
|
|
|
*
|
|
|
|
* @param mmi
|
|
|
|
* DOMString containing an MMI string that can be associated to a
|
|
|
|
* USSD request or other RIL functionality.
|
|
|
|
*
|
|
|
|
* @return a nsIDOMDOMRequest
|
|
|
|
* The request's result will be an object containing information
|
|
|
|
* about the operation.
|
|
|
|
*
|
|
|
|
* In case that the MMI code requires sending an USSD request, the DOMrequest
|
|
|
|
* 'success' event means that the RIL has successfully processed and sent the
|
|
|
|
* USSD request to the network. The network reply will be reported via
|
|
|
|
* 'onussdreceived' event. If the MMI code is not associated to a USSD but to
|
|
|
|
* other RIL request its result, if one is needed, will be notified via the
|
|
|
|
* returned DOMRequest 'success' or 'error' event.
|
2012-06-09 14:07:18 -07:00
|
|
|
*/
|
2012-10-05 07:08:55 -07:00
|
|
|
nsIDOMDOMRequest sendMMI(in DOMString mmi);
|
2012-06-09 14:07:18 -07:00
|
|
|
|
|
|
|
/**
|
2012-10-05 07:08:55 -07:00
|
|
|
* Cancel the current MMI request if one exists.
|
2012-06-09 14:07:18 -07:00
|
|
|
*/
|
2012-10-05 07:08:55 -07:00
|
|
|
nsIDOMDOMRequest cancelMMI();
|
2012-06-09 14:07:18 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The 'cardstatechange' event is notified when the 'cardState' attribute
|
|
|
|
* changes value.
|
|
|
|
*/
|
2012-08-30 20:45:16 -07:00
|
|
|
[implicit_jscontext] attribute jsval oncardstatechange;
|
2012-06-09 14:07:18 -07:00
|
|
|
|
2012-09-03 14:43:09 -07:00
|
|
|
/**
|
|
|
|
* The 'iccinfochange' event is notified whenever the icc info object
|
|
|
|
* changes.
|
|
|
|
*/
|
|
|
|
[implicit_jscontext] attribute jsval oniccinfochange;
|
|
|
|
|
2012-06-09 14:07:18 -07:00
|
|
|
/**
|
|
|
|
* The 'voicechange' event is notified whenever the voice connection object
|
|
|
|
* changes.
|
|
|
|
*/
|
2012-08-30 20:45:16 -07:00
|
|
|
[implicit_jscontext] attribute jsval onvoicechange;
|
2012-06-09 14:07:18 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The 'datachange' event is notified whenever the data connection object
|
|
|
|
* changes values.
|
|
|
|
*/
|
2012-08-30 20:45:16 -07:00
|
|
|
[implicit_jscontext] attribute jsval ondatachange;
|
2012-06-09 14:07:18 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The 'ussdreceived' event is notified whenever a new USSD message is
|
|
|
|
* received.
|
|
|
|
*/
|
2012-08-30 20:45:16 -07:00
|
|
|
[implicit_jscontext] attribute jsval onussdreceived;
|
2012-09-25 12:22:38 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The 'dataerror' event is notified whenever the data connection object
|
|
|
|
* receives an error from the RIL
|
|
|
|
*/
|
|
|
|
[implicit_jscontext] attribute jsval ondataerror;
|
2012-10-02 23:29:07 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The 'icccardlockerror' event is notified whenever 'unlockCardLock' or
|
|
|
|
* 'setCardLock' fails.
|
|
|
|
*/
|
|
|
|
[implicit_jscontext] attribute jsval onicccardlockerror;
|
2012-04-19 14:33:25 -07:00
|
|
|
};
|
|
|
|
|
2012-08-15 18:36:43 -07:00
|
|
|
[scriptable, uuid(5ea0e4a9-4684-40da-9930-8ebb61d187f3)]
|
2012-04-19 14:33:25 -07:00
|
|
|
interface nsIDOMMozMobileConnectionInfo : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
2012-08-07 12:11:48 -07:00
|
|
|
* State of the connection.
|
|
|
|
*
|
|
|
|
* Possible values: 'notSearching', 'searching', 'denied', 'registered'.
|
|
|
|
* null if the state is unknown.
|
|
|
|
*/
|
|
|
|
readonly attribute DOMString state;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates whether the connection is ready. This may be different
|
2012-04-19 14:33:25 -07:00
|
|
|
*/
|
|
|
|
readonly attribute bool connected;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates whether only emergency calls are possible.
|
|
|
|
*
|
|
|
|
* This flag is only relevant to voice connections and when 'connected' is
|
|
|
|
* false.
|
|
|
|
*/
|
|
|
|
readonly attribute bool emergencyCallsOnly;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates whether the connection is going through a foreign operator
|
|
|
|
* (roaming) or not.
|
|
|
|
*/
|
|
|
|
readonly attribute bool roaming;
|
|
|
|
|
|
|
|
/**
|
2012-06-12 14:05:50 -07:00
|
|
|
* Network operator
|
2012-04-19 14:33:25 -07:00
|
|
|
*/
|
2012-06-12 14:05:50 -07:00
|
|
|
readonly attribute nsIDOMMozMobileNetworkInfo network;
|
2012-04-19 14:33:25 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Type of connection.
|
|
|
|
*
|
|
|
|
* Possible values: 'gsm', 'cdma', gprs', 'edge', 'umts', 'hsdpa', 'evdo0',
|
|
|
|
* 'evdoa', 'evdob', etc.
|
|
|
|
*/
|
|
|
|
readonly attribute DOMString type;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Signal strength in dBm, or null if no service is available.
|
|
|
|
*/
|
|
|
|
readonly attribute jsval signalStrength;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Signal strength, represented linearly as a number between 0 (weakest
|
|
|
|
* signal) and 100 (full signal).
|
|
|
|
*/
|
|
|
|
readonly attribute jsval relSignalStrength;
|
|
|
|
|
2012-08-15 18:36:43 -07:00
|
|
|
/**
|
|
|
|
* Cell location.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIDOMMozMobileCellInfo cell;
|
|
|
|
|
2012-04-19 14:33:25 -07:00
|
|
|
};
|
2012-06-01 14:10:39 -07:00
|
|
|
|
2012-06-12 14:05:50 -07:00
|
|
|
[scriptable, uuid(3bd866c7-98a5-4ef4-a464-c22d8cc6b992)]
|
|
|
|
interface nsIDOMMozMobileNetworkInfo: nsISupports
|
2012-06-01 14:10:39 -07:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Short name of the network operator
|
|
|
|
*/
|
|
|
|
readonly attribute DOMString shortName;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Long name of the network operator
|
|
|
|
*/
|
|
|
|
readonly attribute DOMString longName;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mobile Country Code (MCC) of the network operator
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned short mcc;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mobile Network Code (MNC) of the network operator
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned short mnc;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* State of this network operator.
|
|
|
|
*
|
|
|
|
* Possible values: 'available', 'connected', 'forbidden', or null (unknown)
|
|
|
|
*/
|
|
|
|
readonly attribute DOMString state;
|
|
|
|
};
|
2012-08-15 18:36:43 -07:00
|
|
|
|
|
|
|
[scriptable, uuid(aa546788-4f34-488b-8c3e-2786e02ab992)]
|
|
|
|
interface nsIDOMMozMobileCellInfo: nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Mobile Location Area Code (LAC) for GSM/WCDMA networks.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned short gsmLocationAreaCode;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mobile Cell ID for GSM/WCDMA networks.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long gsmCellId;
|
|
|
|
};
|
2012-09-03 14:43:09 -07:00
|
|
|
|
2012-10-22 23:54:51 -07:00
|
|
|
[scriptable, uuid(a71c66ed-dfb0-4c33-9942-049e6f03dbed)]
|
2012-09-03 14:43:09 -07:00
|
|
|
interface nsIDOMMozMobileICCInfo : nsISupports
|
|
|
|
{
|
2012-09-14 03:30:30 -07:00
|
|
|
/**
|
|
|
|
* Integrated Circuit Card Identifier.
|
|
|
|
*/
|
|
|
|
readonly attribute DOMString iccid;
|
|
|
|
|
2012-09-03 14:43:09 -07:00
|
|
|
/**
|
|
|
|
* Mobile Country Code (MCC) of the subscriber's home network.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned short mcc;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mobile Network Code (MNC) of the subscriber's home network.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned short mnc;
|
2012-10-22 23:54:51 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Service Provider Name (SPN) of the subscriber's home network.
|
|
|
|
*/
|
|
|
|
readonly attribute DOMString spn;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mobile Station ISDN Number (MSISDN) of the subscriber's, aka
|
|
|
|
* his phone number.
|
|
|
|
*/
|
|
|
|
readonly attribute DOMString msisdn;
|
2012-09-03 14:43:09 -07:00
|
|
|
};
|