From 1f2748f899be5c32a880a66dcb20d3ab9a3f40ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Jim=C3=83=C2=A9nez?= Date: Sat, 9 Jun 2012 17:07:18 -0400 Subject: [PATCH] Bug 734145 - B2G RIL: Support USSD codes. Part 1: IDLs. r=philikon --- dom/network/interfaces/Makefile.in | 1 + .../interfaces/nsIDOMMobileConnection.idl | 65 ++++++++++++------- .../interfaces/nsIDOMUSSDReceivedEvent.idl | 11 ++++ .../nsIMobileConnectionProvider.idl | 4 +- 4 files changed, 58 insertions(+), 23 deletions(-) create mode 100644 dom/network/interfaces/nsIDOMUSSDReceivedEvent.idl diff --git a/dom/network/interfaces/Makefile.in b/dom/network/interfaces/Makefile.in index dd7c44891f87..b9cc218e82b6 100644 --- a/dom/network/interfaces/Makefile.in +++ b/dom/network/interfaces/Makefile.in @@ -18,6 +18,7 @@ XPIDLSRCS = \ nsIDOMConnection.idl \ nsIDOMMobileConnection.idl \ nsIMobileConnectionProvider.idl \ + nsIDOMUSSDReceivedEvent.idl \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/dom/network/interfaces/nsIDOMMobileConnection.idl b/dom/network/interfaces/nsIDOMMobileConnection.idl index 64770ac05fe6..70ce5a3c484a 100644 --- a/dom/network/interfaces/nsIDOMMobileConnection.idl +++ b/dom/network/interfaces/nsIDOMMobileConnection.idl @@ -8,7 +8,7 @@ interface nsIDOMEventListener; interface nsIDOMDOMRequest; interface nsIDOMMozMobileConnectionInfo; -[scriptable, builtinclass, uuid(962298cd-3443-423e-9e47-f22e24ad850b)] +[scriptable, builtinclass, uuid(e7309c47-9a2e-4e12-84ab-f8f39214eaba)] interface nsIDOMMozMobileConnection : nsIDOMEventTarget { /** @@ -40,24 +40,6 @@ interface nsIDOMMozMobileConnection : nsIDOMEventTarget */ nsIDOMDOMRequest getNetworks(); - /** - * The 'cardstatechange' event is notified when the 'cardState' attribute - * changes value. - */ - attribute nsIDOMEventListener oncardstatechange; - - /** - * The 'voicechange' event is notified whenever the voice connection object - * changes. - */ - attribute nsIDOMEventListener onvoicechange; - - /** - * The 'datachange' event is notified whenever the data connection object - * changes values. - */ - attribute nsIDOMEventListener ondatachange; - /** * Find out about the status of an ICC lock (e.g. the PIN lock). * @@ -65,7 +47,7 @@ interface nsIDOMMozMobileConnection : nsIDOMEventTarget * Identifies the lock type, e.g. "pin" for the PIN lock. * * @return a DOM Request. - * The request's result will be an object containing + * The request's result will be an object containing * information about the specified lock's status, * e.g. {lockType: "pin", enabled: true}. */ @@ -95,7 +77,7 @@ interface nsIDOMMozMobileConnection : nsIDOMEventTarget * newPin: "..."}); * * @return a nsIDOMDOMRequest. - * The request's result will be an object containing + * The request's result will be an object containing * information about the unlock operation. * * Examples: @@ -142,7 +124,7 @@ interface nsIDOMMozMobileConnection : nsIDOMEventTarget * newPin: "..."}); * * @return a nsIDOMDOMRequest. - * The request's result will be an object containing + * The request's result will be an object containing * information about the operation. * * Examples: @@ -163,6 +145,45 @@ interface nsIDOMMozMobileConnection : nsIDOMEventTarget * } */ nsIDOMDOMRequest setCardLock(in jsval info); + + /** + * Send a USSD message. + * + * The network reply will be reported via onussdreceived event. + * + * The 'success' event for the request means the USSD message has been sent + * successfully. + */ + nsIDOMDOMRequest sendUSSD(in DOMString ussd); + + /** + * Cancel the current USSD session if one exists. + */ + nsIDOMDOMRequest cancelUSSD(); + + /** + * The 'cardstatechange' event is notified when the 'cardState' attribute + * changes value. + */ + attribute nsIDOMEventListener oncardstatechange; + + /** + * The 'voicechange' event is notified whenever the voice connection object + * changes. + */ + attribute nsIDOMEventListener onvoicechange; + + /** + * The 'datachange' event is notified whenever the data connection object + * changes values. + */ + attribute nsIDOMEventListener ondatachange; + + /** + * The 'ussdreceived' event is notified whenever a new USSD message is + * received. + */ + attribute nsIDOMEventListener onussdreceived; }; [scriptable, uuid(f3bb0611-5e4a-46f1-a8f5-cf592b37596e)] diff --git a/dom/network/interfaces/nsIDOMUSSDReceivedEvent.idl b/dom/network/interfaces/nsIDOMUSSDReceivedEvent.idl new file mode 100644 index 000000000000..0ef2129488c4 --- /dev/null +++ b/dom/network/interfaces/nsIDOMUSSDReceivedEvent.idl @@ -0,0 +1,11 @@ +/* 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 "nsIDOMEvent.idl" + +[scriptable, uuid(b9eb511b-511c-4fc7-b84b-6c947ecfca08)] +interface nsIDOMUSSDReceivedEvent : nsIDOMEvent +{ + readonly attribute DOMString message; +}; diff --git a/dom/network/interfaces/nsIMobileConnectionProvider.idl b/dom/network/interfaces/nsIMobileConnectionProvider.idl index cd9cc89b8db6..745805217290 100644 --- a/dom/network/interfaces/nsIMobileConnectionProvider.idl +++ b/dom/network/interfaces/nsIMobileConnectionProvider.idl @@ -12,7 +12,7 @@ interface nsIDOMWindow; * XPCOM component (in the content process) that provides the mobile * network information. */ -[scriptable, uuid(93202514-9ae9-482e-95bc-9c6ed62aea99)] +[scriptable, uuid(fb3fac34-c1c2-45a9-ad18-a7af0f7997c9)] interface nsIMobileConnectionProvider : nsISupports { readonly attribute DOMString cardState; @@ -23,4 +23,6 @@ interface nsIMobileConnectionProvider : nsISupports nsIDOMDOMRequest getCardLock(in nsIDOMWindow window, in DOMString lockType); nsIDOMDOMRequest unlockCardLock(in nsIDOMWindow window, in jsval info); nsIDOMDOMRequest setCardLock(in nsIDOMWindow window, in jsval info); + nsIDOMDOMRequest sendUSSD(in nsIDOMWindow window, in DOMString ussd); + nsIDOMDOMRequest cancelUSSD(in nsIDOMWindow window); };