gecko-dev/dom/mobileconnection/interfaces/nsIMobileConnectionProvider.idl

750 lines
26 KiB
Plaintext

/* 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"
interface nsIDOMDOMRequest;
interface nsIDOMWindow;
interface nsIMobileConnectionInfo;
interface nsIMobileNetworkInfo;
interface nsIVariant;
[scriptable, uuid(c6d98e6a-d96f-45fe-aa86-01453a6daf9e)]
interface nsIMobileConnectionListener : nsISupports
{
/**
* Notify when voice info is changed.
*/
void notifyVoiceChanged();
/**
* Notify when data info is changed.
*/
void notifyDataChanged();
/**
* Notify when ussd is received.
*
* @param message
* The ussd request in string format.
* @param sessionEnded
* Indicates whether the session is ended.
*/
void notifyUssdReceived(in DOMString message,
in boolean sessionEnded);
/**
* Notify when data call is failed to establish.
*
* @param message
* Error message from RIL.
*/
void notifyDataError(in DOMString message);
/**
* Notify when call forwarding state is changed.
*
* @param success
* Indicates whether the set call forwarding request is success.
* @param action
* One of the nsIMobileConnectionProvider.CALL_FORWARD_ACTION_* values.
* @param reason
* One of the nsIMobileConnectionProvider.CALL_FORWARD_REASON_* values.
* @param number
* Phone number of forwarding address.
* @param timeSeconds
* The time in seconds should wait before call is forwarded.
* @param serviceClass
* One of the nsIMobileConnectionProvider.ICC_SERVICE_CLASS_* values.
*/
void notifyCFStateChange(in boolean success,
in unsigned short action,
in unsigned short reason,
in DOMString number,
in unsigned short timeSeconds,
in unsigned short serviceClass);
/**
* Notify when emergency callback mode is changed.
*
* @param active
* Indicates whether the emergency callback mode is activated.
* @param timeoutMs
* The timeout in millisecond for emergency callback mode.
*/
void notifyEmergencyCbModeChanged(in boolean active,
in unsigned long timeoutMs);
/**
* Notify when ota status is changed.
*
* @param status
* Ota status. Possible values: 'spl_unlocked', 'spc_retries_exceeded',
* 'a_key_exchanged', 'ssd_updated', 'nam_downloaded', 'mdn_downloaded',
* 'imsi_downloaded', 'prl_downloaded', 'committed', 'otapa_started',
* 'otapa_stopped', 'otapa_aborted'.
*/
void notifyOtaStatusChanged(in DOMString status);
/**
* Notify when icc id is changed.
*/
void notifyIccChanged();
/**
* Notify when radio state is changed.
*/
void notifyRadioStateChanged();
/**
* Notify when clir mode is changed.
*
* @param mode
* One of the nsIMobileConnectionProvider.CLIR_* values.
*/
void notifyClirModeChanged(in unsigned long mode);
};
/**
* XPCOM component (in the content process) that provides the mobile
* network information.
*/
[scriptable, uuid(2a3af80f-9f8e-447d-becd-034f95e4cd4d)]
interface nsIMobileConnectionProvider : nsISupports
{
const long ICC_SERVICE_CLASS_VOICE = (1 << 0);
const long ICC_SERVICE_CLASS_DATA = (1 << 1);
const long ICC_SERVICE_CLASS_FAX = (1 << 2);
const long ICC_SERVICE_CLASS_SMS = (1 << 3);
const long ICC_SERVICE_CLASS_DATA_SYNC = (1 << 4);
const long ICC_SERVICE_CLASS_DATA_ASYNC = (1 << 5);
const long ICC_SERVICE_CLASS_PACKET = (1 << 6);
const long ICC_SERVICE_CLASS_PAD = (1 << 7);
const long ICC_SERVICE_CLASS_MAX = (1 << 7);
/**
* Call forwarding action.
*
* @see 3GPP TS 27.007 7.11 "mode".
*/
const long CALL_FORWARD_ACTION_DISABLE = 0;
const long CALL_FORWARD_ACTION_ENABLE = 1;
const long CALL_FORWARD_ACTION_QUERY_STATUS = 2;
const long CALL_FORWARD_ACTION_REGISTRATION = 3;
const long CALL_FORWARD_ACTION_ERASURE = 4;
/**
* Call forwarding reason.
*
* @see 3GPP TS 27.007 7.11 "reason".
*/
const long CALL_FORWARD_REASON_UNCONDITIONAL = 0;
const long CALL_FORWARD_REASON_MOBILE_BUSY = 1;
const long CALL_FORWARD_REASON_NO_REPLY = 2;
const long CALL_FORWARD_REASON_NOT_REACHABLE = 3;
const long CALL_FORWARD_REASON_ALL_CALL_FORWARDING = 4;
const long CALL_FORWARD_REASON_ALL_CONDITIONAL_CALL_FORWARDING = 5;
/**
* Call barring program.
*/
const long CALL_BARRING_PROGRAM_ALL_OUTGOING = 0;
const long CALL_BARRING_PROGRAM_OUTGOING_INTERNATIONAL = 1;
const long CALL_BARRING_PROGRAM_OUTGOING_INTERNATIONAL_EXCEPT_HOME = 2;
const long CALL_BARRING_PROGRAM_ALL_INCOMING = 3;
const long CALL_BARRING_PROGRAM_INCOMING_ROAMING = 4;
/**
* Calling line identification restriction constants.
*
* @see 3GPP TS 27.007 7.7 Defined values.
*/
const long CLIR_DEFAULT = 0;
const long CLIR_INVOCATION = 1;
const long CLIR_SUPPRESSION = 2;
/**
* Called when a content process registers receiving unsolicited messages from
* RadioInterfaceLayer in the chrome process. Only a content process that has
* the 'mobileconnection' permission is allowed to register.
*/
void registerMobileConnectionMsg(in unsigned long clientId,
in nsIMobileConnectionListener listener);
void unregisterMobileConnectionMsg(in unsigned long clientId,
in nsIMobileConnectionListener listener);
/**
* These two fields require the 'mobilenetwork' permission.
*/
DOMString getLastKnownNetwork(in unsigned long clientId);
DOMString getLastKnownHomeNetwork(in unsigned long clientId);
/**
* All fields below require the 'mobileconnection' permission.
*/
/**
* Get the connection information about the voice.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
*
* @return a nsIMobileConnectionInfo
*/
nsIMobileConnectionInfo getVoiceConnectionInfo(in unsigned long clientId);
/**
* Get the connection information about the data.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
*
* @return a nsIMobileConnectionInfo
*/
nsIMobileConnectionInfo getDataConnectionInfo(in unsigned long clientId);
/**
* Get the integrated circuit card identifier of the SIM.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
*
* @return a DOMString indicates the iccId
*/
DOMString getIccId(in unsigned long clientId);
/**
* Get the selection mode of the voice and data networks.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
*
* @return a DOMString
* Possible values: 'automatic', 'manual', null (unknown).
*/
DOMString getNetworkSelectionMode(in unsigned long clientId);
/**
* Get the current radio state.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
*
* @return a DOMString
* Possible values: 'enabling', 'enabled', 'disabling', 'disabled',
* null (unknown).
*/
DOMString getRadioState(in unsigned long clientId);
/**
* Get the network types that are supported by this radio.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
*
* @return an array of DOMString
* Possible values: 'gsm', 'wcdma', 'cdma', 'evdo', 'lte'.
*/
nsIVariant getSupportedNetworkTypes(in unsigned long clientId);
/**
* Search for available networks.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be an array of nsIMobileNetworkInfo.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest getNetworks(in unsigned long clientId,
in nsIDOMWindow window);
/**
* Manually selects the passed in network, overriding the radio's current
* selection.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
* @param network
* The manually selecting network.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest selectNetwork(in unsigned long clientId,
in nsIDOMWindow window,
in nsIMobileNetworkInfo network);
/**
* Tell the radio to automatically select a network.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest selectNetworkAutomatically(in unsigned long clientId,
in nsIDOMWindow window);
/**
* Set preferred network type.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
* @param type
* DOMString indicates the desired preferred network type.
* Possible values: 'wcdma/gsm', 'gsm', 'wcdma', 'wcdma/gsm-auto',
* 'cdma/evdo', 'cdma', 'evdo', 'wcdma/gsm/cdma/evdo',
* 'lte/cdma/evdo', 'lte/wcdma/gsm', 'lte/wcdma/gsm/cdma/evdo' or
* 'lte'.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest setPreferredNetworkType(in unsigned long clientId,
in nsIDOMWindow window,
in DOMString type);
/**
* Query current preferred network type.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be a string indicating the current preferred network type.
* The value will be either 'wcdma/gsm', 'gsm', 'wcdma', 'wcdma/gsm-auto',
* 'cdma/evdo', 'cdma', 'evdo', 'wcdma/gsm/cdma/evdo', 'lte/cdma/evdo',
* 'lte/wcdma/gsm', 'lte/wcdma/gsm/cdma/evdo' or 'lte'.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest getPreferredNetworkType(in unsigned long clientId,
in nsIDOMWindow window);
/**
* Set roaming preference.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
* @param mode
* DOMString indicates the desired roaming preference.
* Possible values: 'home', 'affiliated', or 'any'.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest setRoamingPreference(in unsigned long clientId,
in nsIDOMWindow window,
in DOMString mode);
/**
* Query current roaming preference.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be a string indicating the current roaming preference.
* The value will be either 'home', 'affiliated', or 'any'.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest getRoamingPreference(in unsigned long clientId,
in nsIDOMWindow window);
/**
* Set voice privacy preference.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
* @param enabled
* Boolean indicates the preferred voice privacy mode used in voice
* scrambling in CDMA networks. 'True' means the enhanced voice security
* is required.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest setVoicePrivacyMode(in unsigned long clientId,
in nsIDOMWindow window,
in bool enabled);
/**
* Query current voice privacy mode.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be a boolean indicating the current voice privacy mode.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest getVoicePrivacyMode(in unsigned long clientId,
in nsIDOMWindow window);
/**
* Send a MMI message.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
* @param mmi
* DOMString containing an MMI string that can be associated to a
* USSD request or other RIL functionality.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be an object containing information about the operation.
* @see MozMMIResult for the detail of result.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be a DOMMMIError.
* @see DOMMMIError for the detail of error.
*/
nsIDOMDOMRequest sendMMI(in unsigned long clientId,
in nsIDOMWindow window,
in DOMString mmi);
/**
* Cancel the current MMI request if one exists.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be an object containing information about the operation.
* @see MozMMIResult for the detail of result.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be a DOMMMIError.
* @see DOMMMIError for the detail of error.
*/
nsIDOMDOMRequest cancelMMI(in unsigned long clientId,
in nsIDOMWindow window);
/**
* Queries current call forwarding options.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
* @param reason
* Indicates the reason the call is being forwarded. It shall be one of
* the nsIMobileConnectionProvider.CALL_FORWARD_REASON_* values.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be an array of MozCallForwardingOptions.
* @see MozCallForwardingOptions for the detail of result.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest getCallForwarding(in unsigned long clientId,
in nsIDOMWindow window,
in unsigned short reason);
/**
* Configures call forwarding options.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
* @param options
* An object containing the call forward rule to set.
* @see MozCallForwardingOptions for the detail of options.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'
*/
nsIDOMDOMRequest setCallForwarding(in unsigned long clientId,
in nsIDOMWindow window,
in jsval options);
/**
* Queries current call barring status.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
* @param options
* An object containing the call barring rule to query. No need to
* specify 'enabled' property.
* @see MozCallBarringOptions for the detail of options.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be an object of MozCallBarringOptions with correct 'enabled'
* property indicating the status of this rule.
* @see MozCallBarringOptions for the detail of result.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest getCallBarring(in unsigned long clientId,
in nsIDOMWindow window,
in jsval options);
/**
* Configures call barring option.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
* @param options
* An object containing the call barring rule to set.
* @see MozCallBarringOptions for the detail of options.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'
*/
nsIDOMDOMRequest setCallBarring(in unsigned long clientId,
in nsIDOMWindow window,
in jsval options);
/**
* Change call barring facility password.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
* @param options
* An object containing information about pin and newPin, and,
* this object must have both "pin" and "newPin" attributes
* to change the call barring facility password.
* @see MozCallBarringOptions for the detail of options.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest changeCallBarringPassword(in unsigned long clientId,
in nsIDOMWindow window,
in jsval options);
/**
* Configures call waiting options.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
* @param enabled
* Boolean indicates the desired call waiting status.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest setCallWaiting(in unsigned long clientId,
in nsIDOMWindow window,
in bool enabled);
/**
* Queries current call waiting options.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be a boolean indicating the call waiting status.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest getCallWaiting(in unsigned long clientId,
in nsIDOMWindow window);
/**
* Enables or disables the presentation of the calling line identity (CLI) to
* the called party when originating a call.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
* @param clirMode
* One of the nsIMobileConnectionProvider.CLIR_* values.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest setCallingLineIdRestriction(in unsigned long clientId,
in nsIDOMWindow window,
in unsigned short clirMode);
/**
* Queries current CLIR status.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be a an object containing CLIR 'n' and 'm' parameter.
* @see MozClirStatus for the detail of result.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest getCallingLineIdRestriction(in unsigned long clientId,
in nsIDOMWindow window);
/**
* Exit emergency callback mode.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
nsIDOMDOMRequest exitEmergencyCbMode(in unsigned long clientId,
in nsIDOMWindow window);
/**
* Set radio enabled/disabled.
*
* @param clientId
* Indicate the RIL client, 0 ~ (number of client - 1).
* @param window
* Current window.
* @param enabled
* Boolean indicates the desired radio power. True to enable the radio.
*
* @return a nsIDOMDOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'InvalidStateError', 'RadioNotAvailable',
* 'IllegalSIMorME', or 'GenericFailure'.
*
* Note: Request is not available when radioState is null, 'enabling', or
* 'disabling'. Calling the function in above conditions will receive
* 'InvalidStateError' error.
*/
nsIDOMDOMRequest setRadioEnabled(in unsigned long clientId,
in nsIDOMWindow window,
in bool enabled);
};