michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIDOMDOMRequest; michael@0: interface nsIDOMMozMobileCFInfo; michael@0: interface nsIDOMMozMobileConnectionInfo; michael@0: interface nsIDOMMozMobileNetworkInfo; michael@0: interface nsIDOMWindow; michael@0: interface nsIVariant; michael@0: michael@0: [scriptable, uuid(5013f5cc-24f9-45dc-ba03-f5dc031a3a6b)] michael@0: interface nsIMobileConnectionListener : nsISupports michael@0: { michael@0: void notifyVoiceChanged(); michael@0: void notifyDataChanged(); michael@0: void notifyUssdReceived(in DOMString message, michael@0: in boolean sessionEnded); michael@0: void notifyDataError(in DOMString message); michael@0: void notifyCFStateChange(in boolean success, michael@0: in unsigned short action, michael@0: in unsigned short reason, michael@0: in DOMString number, michael@0: in unsigned short timeSeconds, michael@0: in unsigned short serviceClass); michael@0: void notifyEmergencyCbModeChanged(in boolean active, michael@0: in unsigned long timeoutMs); michael@0: void notifyOtaStatusChanged(in DOMString status); michael@0: void notifyIccChanged(); michael@0: void notifyRadioStateChanged(); michael@0: }; michael@0: michael@0: /** michael@0: * XPCOM component (in the content process) that provides the mobile michael@0: * network information. michael@0: */ michael@0: [scriptable, uuid(987fc93a-e538-4fd3-9e4d-0e0f0934f019)] michael@0: interface nsIMobileConnectionProvider : nsISupports michael@0: { michael@0: /** michael@0: * Called when a content process registers receiving unsolicited messages from michael@0: * RadioInterfaceLayer in the chrome process. Only a content process that has michael@0: * the 'mobileconnection' permission is allowed to register. michael@0: */ michael@0: void registerMobileConnectionMsg(in unsigned long clientId, michael@0: in nsIMobileConnectionListener listener); michael@0: void unregisterMobileConnectionMsg(in unsigned long clientId, michael@0: in nsIMobileConnectionListener listener); michael@0: michael@0: /** michael@0: * These two fields require the 'mobilenetwork' permission. michael@0: */ michael@0: DOMString getLastKnownNetwork(in unsigned long clientId); michael@0: DOMString getLastKnownHomeNetwork(in unsigned long clientId); michael@0: michael@0: /** michael@0: * All fields below require the 'mobileconnection' permission. michael@0: */ michael@0: nsIDOMMozMobileConnectionInfo getVoiceConnectionInfo(in unsigned long clientId); michael@0: nsIDOMMozMobileConnectionInfo getDataConnectionInfo(in unsigned long clientId); michael@0: DOMString getIccId(in unsigned long clientId); michael@0: DOMString getNetworkSelectionMode(in unsigned long clientId); michael@0: DOMString getRadioState(in unsigned long clientId); michael@0: nsIVariant getSupportedNetworkTypes(in unsigned long clientId); michael@0: michael@0: nsIDOMDOMRequest getNetworks(in unsigned long clientId, michael@0: in nsIDOMWindow window); michael@0: nsIDOMDOMRequest selectNetwork(in unsigned long clientId, michael@0: in nsIDOMWindow window, michael@0: in nsIDOMMozMobileNetworkInfo network); michael@0: nsIDOMDOMRequest selectNetworkAutomatically(in unsigned long clientId, michael@0: in nsIDOMWindow window); michael@0: michael@0: nsIDOMDOMRequest setPreferredNetworkType(in unsigned long clientId, michael@0: in nsIDOMWindow window, michael@0: in DOMString type); michael@0: nsIDOMDOMRequest getPreferredNetworkType(in unsigned long clientId, michael@0: in nsIDOMWindow window); michael@0: michael@0: nsIDOMDOMRequest setRoamingPreference(in unsigned long clientId, michael@0: in nsIDOMWindow window, michael@0: in DOMString mode); michael@0: nsIDOMDOMRequest getRoamingPreference(in unsigned long clientId, michael@0: in nsIDOMWindow window); michael@0: michael@0: nsIDOMDOMRequest setVoicePrivacyMode(in unsigned long clientId, michael@0: in nsIDOMWindow window, michael@0: in bool enabled); michael@0: nsIDOMDOMRequest getVoicePrivacyMode(in unsigned long clientId, michael@0: in nsIDOMWindow window); michael@0: michael@0: nsIDOMDOMRequest sendMMI(in unsigned long clientId, michael@0: in nsIDOMWindow window, michael@0: in DOMString mmi); michael@0: nsIDOMDOMRequest cancelMMI(in unsigned long clientId, michael@0: in nsIDOMWindow window); michael@0: michael@0: nsIDOMDOMRequest getCallForwardingOption(in unsigned long clientId, michael@0: in nsIDOMWindow window, michael@0: in unsigned short reason); michael@0: nsIDOMDOMRequest setCallForwardingOption(in unsigned long clientId, michael@0: in nsIDOMWindow window, michael@0: in nsIDOMMozMobileCFInfo CFInfo); michael@0: michael@0: nsIDOMDOMRequest getCallBarringOption(in unsigned long clientId, michael@0: in nsIDOMWindow window, michael@0: in jsval option); michael@0: nsIDOMDOMRequest setCallBarringOption(in unsigned long clientId, michael@0: in nsIDOMWindow window, michael@0: in jsval option); michael@0: nsIDOMDOMRequest changeCallBarringPassword(in unsigned long clientId, michael@0: in nsIDOMWindow window, michael@0: in jsval info); michael@0: michael@0: nsIDOMDOMRequest setCallWaitingOption(in unsigned long clientId, michael@0: in nsIDOMWindow window, michael@0: in bool enabled); michael@0: nsIDOMDOMRequest getCallWaitingOption(in unsigned long clientId, michael@0: in nsIDOMWindow window); michael@0: michael@0: nsIDOMDOMRequest setCallingLineIdRestriction(in unsigned long clientId, michael@0: in nsIDOMWindow window, michael@0: in unsigned short clirMode); michael@0: nsIDOMDOMRequest getCallingLineIdRestriction(in unsigned long clientId, michael@0: in nsIDOMWindow window); michael@0: michael@0: nsIDOMDOMRequest exitEmergencyCbMode(in unsigned long clientId, michael@0: in nsIDOMWindow window); michael@0: michael@0: nsIDOMDOMRequest setRadioEnabled(in unsigned long clientId, in nsIDOMWindow window, in bool enabled); michael@0: };