Bug 744714 - Part 1 : IDL. r=philikon. sr=sicking
authorYoshi Huang <allstars.chh@mozilla.com>
Wed, 27 Jun 2012 19:05:04 +0200
changeset 105805 5e9e30093151ecb2a816adbee2972df75a3a919e
parent 105804 3a3c2a6507e3283a9a97ac9b7df4d9b1752f36f3
child 105806 86069e9122f9ef3db3af2cf7b695bc24326e9ca8
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersphilikon, sicking
bugs744714
milestone18.0a1
Bug 744714 - Part 1 : IDL. r=philikon. sr=sicking
dom/Makefile.in
dom/icc/Makefile.in
dom/icc/interfaces/Makefile.in
dom/icc/interfaces/SimToolKit.idl
dom/icc/interfaces/nsIDOMIccManager.idl
--- a/dom/Makefile.in
+++ b/dom/Makefile.in
@@ -70,16 +70,17 @@ PARALLEL_DIRS += \
   workers \
   camera \
   $(NULL)
 
 ifdef MOZ_B2G_RIL
 PARALLEL_DIRS += \
   telephony \
   wifi \
+  icc \
   $(NULL)
 endif
 
 ifdef MOZ_B2G_BT
 PARALLEL_DIRS += \
   bluetooth \
   $(NULL)
 endif
new file mode 100644
--- /dev/null
+++ b/dom/icc/Makefile.in
@@ -0,0 +1,14 @@
+# 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/.
+
+DEPTH            = @DEPTH@
+topsrcdir        = @top_srcdir@
+srcdir           = @srcdir@
+VPATH            = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+PARALLEL_DIRS = interfaces
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/icc/interfaces/Makefile.in
@@ -0,0 +1,21 @@
+# 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/.
+
+DEPTH            = ../../..
+topsrcdir        = @top_srcdir@
+srcdir           = @srcdir@
+VPATH            = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+XPIDL_MODULE = dom_icc
+
+include $(topsrcdir)/dom/dom-config.mk
+
+XPIDLSRCS = \
+  nsIDOMIccManager.idl \
+  SimToolKit.idl \
+  $(NULL)
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/icc/interfaces/SimToolKit.idl
@@ -0,0 +1,377 @@
+/* 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"
+
+interface nsIDOMEvent;
+
+dictionary MozStkTextMessage
+{
+  /**
+   * Text String.
+   *
+   * @see TS 11.14, clause 12.15, Text String.
+   */
+  DOMString text;
+
+  /**
+   * Indicate this text message is high priority or normal priority.
+   *
+   * @see TS 11.14, clause 12.6, Command Qualifier, Display Text, bit 1.
+   *
+   * High priority text shall be displayed on the screen immediately, except if
+   * there is a conflict of priority level of alerting such as incoming calls
+   * or a low battery warning. In that situation, the resolution is left to
+   * the terminal. If the command is rejected in spite of the high priority,
+   * the terminal shall inform the ICC with resultCode is
+   * TERMINAL_CRNTLY_UNABLE_TO_PROCESS in MozStkResponse.
+   *
+   * true: high priority
+   * false: normal priority
+   */
+  boolean isHighPriority;
+
+  /**
+   * Need to wait for user to clear message or not.
+   *
+   * @see TS 11.14, clause 12.6, Command Qualifier, Display Text, bit 8.
+   *
+   * If this attribute is true, but user doesn't give any input within a period
+   * of time(said 30 secs), the terminal shall inform the ICC with resultCode
+   * is NO_RESPONSE_FROM_USER in MozStkResponse.
+   *
+   * true: Wait for user to clear message.
+   * false: clear message after a delay.
+   */
+  boolean userClear;
+
+  /**
+   * Need to response immediately or not.
+   *
+   * @see TS 11.14, clause 12.43, Immediate response.
+   *
+   * When this attribute is true, the terminal shall immediately send
+   * MozStkResponse with resultCode is OK.
+   *
+   * true: The terminal shall send response immediately.
+   * false: otherwise.
+   */
+  boolean responseNeeded;
+};
+
+dictionary MozStkItem
+{
+  /**
+   * Identifier of item.
+   *
+   * The identifier is a single byte between '01' and 'FF'. Each item shall
+   * have a unique identifier within an Item list.
+   */
+  unsigned short identifier;
+
+  /**
+   * Text string of item.
+   */
+  DOMString text;
+};
+
+dictionary MozStkMenu
+{
+  /**
+   * Array of MozStkItem.
+   *
+   * @see TS 11.14, clause 12.9
+   */
+  jsval items; // MozStkItem[]
+
+  /**
+   * Presentation type, one of TYPE_*.
+   */
+  unsigned short presentationType;
+
+  /**
+   * Title of the menu.
+   */
+  DOMString title;
+
+  /**
+   * Default item identifier of the menu.
+   */
+  unsigned short defaultItem;
+
+  /**
+   * Help information available or not.
+   *
+   * @see TS 11.14, clause 12.6, Command Qualifier, SET UP MENU, bit 8.
+   *
+   * true: help information available.
+   * false: no help information available.
+   */
+  boolean isHelpAvailable;
+};
+
+dictionary MozStkInput
+{
+  /**
+   * Text for the ME to display in conjunction with asking the user to respond.
+   */
+  DOMString text;
+
+  /**
+   * Minimum length of response.
+   */
+  unsigned short minLength;
+
+  /**
+   * Maximum length of response.
+   */
+  unsigned short maxLength;
+
+  /**
+   * Text for the ME to display, corresponds to a default text string offered
+   * by the ICC.
+   */
+  DOMString defaultText;
+
+  /**
+   * Input format.
+   *
+   * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT, bit 1.
+   *
+   * true: Alphabet set.
+   * false: Digits only.
+   */
+  boolean isAlphabet;
+
+  /**
+   * Alphabet encoding.
+   *
+   * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT, bit 2.
+   *
+   * true: UCS2 alphabet.
+   * false: default SMS alphabet.
+   */
+  boolean isUCS2;
+
+  /**
+   * Visibility of input.
+   *
+   * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT, bit 3.
+   *
+   * true: User input shall not be revealed in any way.
+   * false: ME may echo user input on the display.
+   */
+  boolean hideInput;
+
+  /**
+   * Yes/No response is requested.
+   *
+   * @see TS 11.14, clause 12.6, Command Qualifier, GET INKEY, bit 3.
+   *
+   * true: Yes/No response is requested, and character sets
+   *       (Alphabet set and UCS2) are disabled.
+   * false: Character sets (Alphabet set and UCS2) are enabled.
+   */
+  boolean isYesNoRequested;
+
+  /**
+   * User input in packed or unpacked format.
+   *
+   * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT, bit 4.
+   *
+   * true: User input to be in SMS packed format.
+   * false: User input to be in unpacked format.
+   */
+  boolean isPacked;
+
+  /**
+   * Help information available or not.
+   *
+   * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT/GET INKEY, bit 8.
+   *
+   * true: help information available.
+   * false: no help information available.
+   */
+  boolean isHelpAvailable;
+};
+
+dictionary MozStkBrowserSetting
+{
+  /**
+   * Confirm message to launch browser.
+   *
+   * @see MozStkTextMessage for the detail specification of
+   *      confirmMessage.
+   */
+  jsval confirmMessage;
+
+  /**
+   * The URL to be opened by browser.
+   */
+  DOMString url;
+
+  /**
+   * One of STK_BROWSER_MODE_*.
+   *
+   * @see nsIDOMMozIccManager.STK_BROWSER_MODE_*
+   */
+  unsigned short mode;
+};
+
+dictionary MozStkSetUpCall
+{
+  /**
+   * The Dialling number.
+   */
+  DOMString address;
+
+  /**
+   * The text message used in user confirmation phase.
+   *
+   * @see MozStkTextMessage for the detail specification of
+   *      confirmMessage.
+   */
+  jsval confirmMessage;
+
+  /**
+   * The text message used in call set up phase.
+   *
+   * @see MozStkTextMessage for the detail specification of
+   *      callMessage.
+   */
+  jsval callMessage;
+};
+
+dictionary MozStkCommand
+{
+  /**
+   * The number of command issued by ICC. And it is assigned
+   * by ICC may take any hexadecimal value betweean '01' and 'FE'.
+   *
+   * @see TS 11.14, clause 6.5.1
+   */
+  unsigned short commandNumber;
+
+  /**
+   * One of STK_CMD_*
+   */
+  unsigned short typeOfCommand;
+
+  /**
+   * Qualifiers specific to the command.
+   */
+  unsigned short commandQualifier;
+
+  /**
+   * options varies accrording to the typeOfCommand in MozStkCommand.
+   *
+   * When typeOfCommand is
+   * - STK_DISPLAY_TEXT
+   * - STK_SET_UP_IDLE_MODE_TEXT
+   * - STK_REFRESH
+   * - STK_SEND_{SS|USSD|SMS|DTMF},
+   * options is MozStkTextMessage.
+   *
+   * When typeOfCommand is
+   * - STK_SELECT_ITEM
+   * - STK_SET_UP_MENU
+   * options is MozStkMenu.
+   *
+   * When typeOfCommand is
+   * - STK_GET_INKEY
+   * - STK_GET_INPUT,
+   * options is MozStkInput.
+   *
+   * When typeOfCommand is
+   * - STK_LAUNCH_BROWSER
+   * options is MozStkBrowserSetting.
+   *
+   * When typeOfCommand is
+   * - STK_SET_UP_CALL
+   * options is MozStkSetUpCall.
+   */
+  jsval options;
+};
+
+[scriptable, builtinclass, uuid(06bbc6fa-9b59-4db6-b66b-3b26f9c379df)]
+interface nsIDOMMozStkCommandEvent : nsIDOMEvent
+{
+  /**
+   * See nsIDOMMozStkCommand for the detail of command.
+   */
+  [implicit_jscontext]
+  readonly attribute jsval command;
+};
+
+dictionary MozStkResponse
+{
+  /**
+   * commandNumber from MozStkCommand.
+   *
+   * @see MozStkCommand.commandNumber
+   */
+  unsigned short commandNumber;
+
+  /**
+   * One of MozStkCommand.typeOfCommand
+   *
+   * @see MozStkCommand.typeOfCommand
+   */
+  unsigned short typeOfCommand;
+
+  /**
+   * Qualifiers specific to the command.
+   *
+   * @see MozStkCommand.commandQualifier
+   */
+  unsigned short commandQualifier;
+
+  /**
+   * One of RESULT_*
+   */
+  unsigned short resultCode;
+
+  /**
+   * The identifier of the item selected by user.
+   *
+   * @see MozStkItem.identifier
+   */
+  unsigned short itemIdentifier;
+
+  /**
+   * User input.
+   */
+  DOMString input;
+
+  /**
+   * Alphabet encoding.
+   *
+   * @see MozStkInput.isUCS2
+   */
+  boolean isUCS2;
+
+  /**
+   * YES/NO response.
+   *
+   * @see MozStkInput.isYesNoRequested
+   */
+  boolean isYesNo;
+
+  /**
+   * Packed or unpacked format.
+   *
+   * @see MozStkInput.isPacked
+   */
+  boolean isPacked;
+
+  /**
+   * User has confirmed or rejected the call during STK_CMD_CALL_SET_UP.
+   *
+   * @see RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
+   *
+   * true: Confirmed by User.
+   * false: Rejected by User.
+   */
+  boolean hasConfirmed;
+};
new file mode 100644
--- /dev/null
+++ b/dom/icc/interfaces/nsIDOMIccManager.idl
@@ -0,0 +1,175 @@
+/* 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"
+#include "SimToolKit.idl"
+
+interface nsIDOMEventListener;
+
+[scriptable, builtinclass, uuid(6ca8ac2b-0c7b-40bf-8eb3-dbd16f89d82f)]
+interface nsIDOMMozIccManager : nsIDOMEventTarget
+{
+  /**
+   * STK Menu Presentation types.
+   */
+  const unsigned short STK_MENU_TYPE_NOT_SPECIFIED      = 0x00;
+  const unsigned short STK_MENU_TYPE_DATA_VALUES        = 0x01;
+  const unsigned short STK_MENU_TYPE_NAVIGATION_OPTIONS = 0x03;
+
+  /**
+   * Browser launch mode.
+   */
+  const unsigned short STK_BROWSER_MODE_LAUNCH_IF_NOT_ALREADY_LAUNCHED = 0x00;
+  const unsigned short STK_BROWSER_MODE_USING_EXISTING_BROWSER         = 0x02;
+  const unsigned short STK_BROWSER_MODE_USING_NEW_BROWSER              = 0x03;
+
+  /**
+   * STK Proactive commands.
+   *
+   * @see TS 11.14, clause 13.4
+   */
+  const unsigned short STK_CMD_REFRESH               = 0x01;
+  const unsigned short STK_CMD_SET_UP_CALL           = 0x10;
+  const unsigned short STK_CMD_SEND_SS               = 0x11;
+  const unsigned short STK_CMD_SEND_USSD             = 0x12;
+  const unsigned short STK_CMD_SEND_SMS              = 0x13;
+  const unsigned short STK_CMD_SEND_DTMF             = 0x14;
+  const unsigned short STK_CMD_LAUNCH_BROWSER        = 0x15;
+  const unsigned short STK_CMD_DISPLAY_TEXT          = 0x21;
+  const unsigned short STK_CMD_GET_INKEY             = 0x22;
+  const unsigned short STK_CMD_GET_INPUT             = 0x23;
+  const unsigned short STK_CMD_SELECT_ITEM           = 0x24;
+  const unsigned short STK_CMD_SET_UP_MENU           = 0x25;
+  const unsigned short STK_CMD_SET_UP_IDLE_MODE_TEXT = 0x28;
+
+  /**
+   * STK Result code.
+   *
+   * @see TS 11.14, clause 12.12
+   *
+   * Results '0X' and '1X' indicate that the command has been performed.
+   */
+  /** Command performed successfully */
+  const unsigned short STK_RESULT_OK                                = 0x00;
+
+  /** Command performed with partial comprehension */
+  const unsigned short STK_RESULT_PRFRMD_WITH_PARTIAL_COMPREHENSION = 0x01;
+
+  /** Command performed, with missing information */
+  const unsigned short STK_RESULT_PRFRMD_WITH_MISSING_INFO          = 0x02;
+
+  /** REFRESH performed with additional EFs read */
+  const unsigned short STK_RESULT_PRFRMD_WITH_ADDITIONAL_EFS_READ   = 0x03;
+
+  /** Command performed successfully, limited service */
+  const unsigned short STK_RESULT_PRFRMD_LIMITED_SERVICE            = 0x06;
+
+  /** Proactive UICC session terminated by the user */
+  const unsigned short STK_RESULT_UICC_SESSION_TERM_BY_USER         = 0x10;
+
+  /** Backward move in the proactive UICC session requested by the user */
+  const unsigned short STK_RESULT_BACKWARD_MOVE_BY_USER             = 0x11;
+
+  /** No response from user */
+  const unsigned short STK_RESULT_NO_RESPONSE_FROM_USER             = 0x12;
+
+  /** Help information required by the user */
+  const unsigned short STK_RESULT_HELP_INFO_REQUIRED                = 0x13;
+
+  /** USSD or SS transaction terminated by the user */
+  const unsigned short STK_RESULT_USSD_SS_SESSION_TERM_BY_USER      = 0x14;
+
+  /**
+   * Results '2X' indicate to the UICC that it may be worth re-trying the
+   * command at a later opportunity.
+   */
+  /** Terminal currently unable to process command */
+  const unsigned short STK_RESULT_TERMINAL_CRNTLY_UNABLE_TO_PROCESS = 0x20;
+
+  /** Network currently unable to process command */
+  const unsigned short STK_RESULT_NETWORK_CRNTLY_UNABLE_TO_PROCESS  = 0x21;
+
+  /** User did not accept the proactive command */
+  const unsigned short STK_RESULT_USER_NOT_ACCEPT                   = 0x22;
+
+  /** User cleared down call before connection or network release */
+  const unsigned short STK_RESULT_USER_CLEAR_DOWN_CALL              = 0x23;
+
+  /** Launch browser generic error code */
+  const unsigned short STK_RESULT_LAUNCH_BROWSER_ERROR              = 0x26;
+
+  /**
+   * Results '3X' indicate that it is not worth the UICC re-trying with an
+   * identical command, as it will only get the same response. However, the
+   * decision to retry lies with the application.
+   */
+  /** Command beyond terminal's capabilities */
+  const unsigned short STK_RESULT_BEYOND_TERMINAL_CAPABILITY        = 0x30;
+
+  /** Command type not understood by terminal */
+  const unsigned short STK_RESULT_CMD_TYPE_NOT_UNDERSTOOD           = 0x31;
+
+  /** Command data not understood by terminal */
+  const unsigned short STK_RESULT_CMD_DATA_NOT_UNDERSTOOD           = 0x32;
+
+  /** Command number not known by terminal */
+  const unsigned short STK_RESULT_CMD_NUM_NOT_KNOWN                 = 0x33;
+
+  /** SS Return Error */
+  const unsigned short STK_RESULT_SS_RETURN_ERROR                   = 0x34;
+
+  /** SMS RP-ERROR */
+  const unsigned short STK_RESULT_SMS_RP_ERROR                      = 0x35;
+
+  /** Error, required values are missing */
+  const unsigned short STK_RESULT_REQUIRED_VALUES_MISSING           = 0x36;
+
+  /** USSD Return Error */
+  const unsigned short STK_RESULT_USSD_RETURN_ERROR                 = 0x37;
+
+  /** MultipleCard commands error */
+  const unsigned short STK_RESULT_MULTI_CARDS_CMD_ERROR             = 0x38;
+
+  /**
+   * Interaction with call control by USIM or MO short message control by
+   * USIM, permanent problem
+   */
+  const unsigned short STK_RESULT_USIM_CALL_CONTROL_PERMANENT       = 0x39;
+
+  /** Bearer Independent Protocol error */
+  const unsigned short STK_RESULT_BIP_ERROR                         = 0x3a;
+
+  /**
+   * Send the response back to ICC after an attempt to execute STK Proactive
+   * Command.
+   *
+   * @param response
+   *        The response that will be sent to ICC.
+   * @see MozStkResponse for the detail of response.
+   */
+  void sendStkResponse(in jsval response);
+
+  /**
+   * Send the "Menu Selection" Envelope command to ICC for menu selection.
+   *
+   * @param itemIdentifier
+   *        The identifier of the item selected by user.
+   * @param helpRequested
+   *        true if user requests to provide help information, false otherwise.
+   */
+  void sendStkMenuSelection(in unsigned short itemIdentifier,
+                            in boolean        helpRequested);
+
+  /**
+   * The 'stkcommand' event is notified whenever STK Proactive Command is
+   * issued from ICC.
+   */
+  attribute nsIDOMEventListener onstkcommand;
+
+  /**
+   * 'stksessionend' event is notified whenever STK Session is terminated by
+   * ICC.
+   */
+  attribute nsIDOMEventListener onstksessionend;
+};