dom/webidl/MozStkCommandEvent.webidl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     4  * You can obtain one at http://mozilla.org/MPL/2.0/.
     5  */
     7 [Pref="dom.icc.enabled",
     8  Constructor(DOMString type, optional MozStkCommandEventInit eventInitDict)]
     9 interface MozStkCommandEvent : Event
    10 {
    11   readonly attribute any command;
    12 };
    14 dictionary MozStkCommandEventInit : EventInit
    15 {
    16   any command = null;
    17 };
    19 dictionary MozStkTextMessage
    20 {
    21   /**
    22    * Text String.
    23    *
    24    * @see TS 11.14, clause 12.15, Text String.
    25    */
    26   DOMString text;
    28   /**
    29    * The length of time for which the ME shall display the dialog.
    30    */
    31   MozStkDuration duration;
    33   /**
    34    * Indicate this text message is high priority or normal priority.
    35    *
    36    * @see TS 11.14, clause 12.6, Command Qualifier, Display Text, bit 1.
    37    *
    38    * High priority text shall be displayed on the screen immediately, except if
    39    * there is a conflict of priority level of alerting such as incoming calls
    40    * or a low battery warning. In that situation, the resolution is left to
    41    * the terminal. If the command is rejected in spite of the high priority,
    42    * the terminal shall inform the ICC with resultCode is
    43    * TERMINAL_CRNTLY_UNABLE_TO_PROCESS in MozStkResponse.
    44    *
    45    * true: high priority
    46    * false: normal priority
    47    */
    48   boolean isHighPriority;
    50   /**
    51    * Need to wait for user to clear message or not.
    52    *
    53    * @see TS 11.14, clause 12.6, Command Qualifier, Display Text, bit 8.
    54    *
    55    * If this attribute is true, but user doesn't give any input within a period
    56    * of time(said 30 secs), the terminal shall inform the ICC with resultCode
    57    * is NO_RESPONSE_FROM_USER in MozStkResponse.
    58    *
    59    * true: Wait for user to clear message.
    60    * false: clear message after a delay.
    61    */
    62   boolean userClear;
    64   /**
    65    * Need to response immediately or not.
    66    *
    67    * @see TS 11.14, clause 12.43, Immediate response.
    68    *
    69    * When this attribute is true, the terminal shall immediately send
    70    * MozStkResponse with resultCode is OK.
    71    *
    72    * true: The terminal shall send response immediately.
    73    * false: otherwise.
    74    */
    75   boolean responseNeeded;
    76 };
    78 dictionary MozStkItem
    79 {
    80   /**
    81    * Identifier of item.
    82    *
    83    * The identifier is a single byte between '01' and 'FF'. Each item shall
    84    * have a unique identifier within an Item list.
    85    */
    86   unsigned short identifier;
    88   /**
    89    * Text string of item.
    90    */
    91   DOMString text;
    92 };
    94 dictionary MozStkMenu
    95 {
    96   /**
    97    * Array of MozStkItem.
    98    *
    99    * @see TS 11.14, clause 12.9
   100    */
   101   sequence<MozStkItem> items;
   103   /**
   104    * Presentation type, one of TYPE_*.
   105    */
   106   unsigned short presentationType;
   108   /**
   109    * Title of the menu.
   110    */
   111   DOMString title;
   113   /**
   114    * Default item identifier of the menu.
   115    */
   116   unsigned short defaultItem;
   118   /**
   119    * Help information available or not.
   120    *
   121    * @see TS 11.14, clause 12.6, Command Qualifier, SET UP MENU, bit 8.
   122    *
   123    * true: help information available.
   124    * false: no help information available.
   125    */
   126   boolean isHelpAvailable;
   128   /**
   129    * List of Next Action Indicators.
   130    * Each element should be one of nsIDOMMozIccManager.STK_CMD_*
   131    *                            or nsIDOMMozIccManager.STK_NEXT_ACTION_*
   132    * If it's STK_NEXT_ACTION_NULL, the terminal should ignore this action
   133    * in corresponding item.
   134    *
   135    * @see TS 11.14, clause 12.24, Items Next Action Indicator.
   136    */
   137   sequence<unsigned short> nextActionList;
   138 };
   140 dictionary MozStkInput
   141 {
   142   /**
   143    * Text for the ME to display in conjunction with asking the user to respond.
   144    */
   145   DOMString text;
   147   /**
   148    * The length of time for which the ME shall display the dialog. This field
   149    * is used only for GET INKEY.
   150    *
   151    * @see TS 11.14, clause 11.8, duration, GET INKEY T.C 27.22.4.2.8.4.2
   152    */
   153   MozStkDuration duration;
   155   /**
   156    * Minimum length of response.
   157    */
   158   unsigned short minLength;
   160   /**
   161    * Maximum length of response.
   162    */
   163   unsigned short maxLength;
   165   /**
   166    * Text for the ME to display, corresponds to a default text string offered
   167    * by the ICC.
   168    */
   169   DOMString defaultText;
   171   /**
   172    * Input format.
   173    *
   174    * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT, bit 1.
   175    *
   176    * true: Alphabet set.
   177    * false: Digits only.
   178    */
   179   boolean isAlphabet;
   181   /**
   182    * Alphabet encoding.
   183    *
   184    * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT, bit 2.
   185    *
   186    * true: UCS2 alphabet.
   187    * false: default SMS alphabet.
   188    */
   189   boolean isUCS2;
   191   /**
   192    * Visibility of input.
   193    *
   194    * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT, bit 3.
   195    *
   196    * true: User input shall not be revealed in any way.
   197    * false: ME may echo user input on the display.
   198    */
   199   boolean hideInput;
   201   /**
   202    * Yes/No response is requested.
   203    *
   204    * @see TS 11.14, clause 12.6, Command Qualifier, GET INKEY, bit 3.
   205    *
   206    * true: Yes/No response is requested, and character sets
   207    *       (Alphabet set and UCS2) are disabled.
   208    * false: Character sets (Alphabet set and UCS2) are enabled.
   209    */
   210   boolean isYesNoRequested;
   212   /**
   213    * User input in packed or unpacked format.
   214    *
   215    * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT, bit 4.
   216    *
   217    * true: User input to be in SMS packed format.
   218    * false: User input to be in unpacked format.
   219    */
   220   boolean isPacked;
   222   /**
   223    * Help information available or not.
   224    *
   225    * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT/GET INKEY, bit 8.
   226    *
   227    * true: help information available.
   228    * false: no help information available.
   229    */
   230   boolean isHelpAvailable;
   231 };
   233 dictionary MozStkBrowserSetting
   234 {
   235   /**
   236    * Confirm message to launch browser.
   237    */
   238   MozStkTextMessage confirmMessage;
   240   /**
   241    * The URL to be opened by browser.
   242    */
   243   DOMString url;
   245   /**
   246    * One of STK_BROWSER_MODE_*.
   247    *
   248    * @see nsIDOMMozIccManager.STK_BROWSER_MODE_*
   249    */
   250   unsigned short mode;
   251 };
   253 dictionary MozStkSetUpCall
   254 {
   255   /**
   256    * The Dialling number.
   257    */
   258   DOMString address;
   260   /**
   261    * The text message used in user confirmation phase.
   262    */
   263   MozStkTextMessage confirmMessage;
   265   /**
   266    * The text message used in call set up phase.
   267    */
   268   MozStkTextMessage callMessage;
   270   /**
   271    * The Optional maximum duration for the redial mechanism.
   272    * The time elapsed since the first call set-up attempt has exceeded the duration
   273    * requested by the UICC, the redial mechanism is terminated.
   274    */
   275   MozStkDuration duration;
   276 };
   278 dictionary MozStkSetUpEventList
   279 {
   280   /**
   281    * The list of events that needs to provide details to ICC when they happen.
   282    * When this valus is null, means an indication to remove the existing list
   283    * of events in ME.
   284    *
   285    * @see nsIDOMMozIccManager.STK_EVENT_TYPE_*
   286    */
   287    sequence<unsigned short> eventList;
   288 };
   290 dictionary MozStkLocationInfo
   291 {
   292   /**
   293    * Mobile Country Code (MCC) of the current serving operator.
   294    */
   295   unsigned short mcc;
   297   /**
   298    * Mobile Network Code (MNC) of the current serving operator.
   299    */
   300   unsigned short mnc;
   302   /**
   303    * Mobile Location Area Code (LAC) for the current serving operator.
   304    */
   305   unsigned short gsmLocationAreaCode;
   307   /**
   308    * Mobile Cell ID for the current serving operator.
   309    */
   310   unsigned long gsmCellId;
   311 };
   313 dictionary MozStkDuration
   314 {
   315   /**
   316    * Time unit used, should be one of STK_TIME_UNIT_*.
   317    */
   318   unsigned short timeUnit;
   320   /**
   321    * The length of time required, expressed in timeUnit.
   322    */
   323   octet timeInterval;
   324 };
   326 dictionary MozStkPlayTone
   327 {
   328   /**
   329    * Text String.
   330    */
   331   DOMString text;
   333   /**
   334    * One of STK_TONE_TYPE_*.
   335    */
   336   unsigned short tone;
   338   /**
   339    * The length of time for which the ME shall generate the tone.
   340    */
   341   MozStkDuration duration;
   343   /**
   344    * Need to vibrate or not.
   345    * true: vibrate alert, if available, with the tone.
   346    * false: use of vibrate alert is up to the ME.
   347    */
   348   boolean isVibrate;
   349 };
   351 dictionary MozStkProvideLocalInfo
   352 {
   353   /**
   354    * Indicate which local information is required.
   355    * It shall be one of following:
   356    *  - nsIDOMMozIccManager.STK_LOCAL_INFO_LOCATION_INFO
   357    *  - nsIDOMMozIccManager.STK_LOCAL_INFO_IMEI
   358    *  - nsIDOMMozIccManager.STK_LOCAL_INFO_DATE_TIME_ZONE
   359    *  - nsIDOMMozIccManager.STK_LOCAL_INFO_LANGUAGE
   360    */
   361   unsigned short localInfoType;
   362 };
   364 dictionary MozStkLocationEvent
   365 {
   366   /**
   367    * The type of this event.
   368    * It shall be nsIDOMMozIccManager.STK_EVENT_TYPE_LOCATION_STATUS;
   369    */
   370   unsigned short eventType;
   372   /**
   373    * Indicate current service state of the MS with one of the values listed
   374    * below:
   375    *  - nsIDOMMozIccManager.STK_SERVICE_STATE_NORMAL
   376    *  - nsIDOMMozIccManager.STK_SERVICE_STATE_LIMITED
   377    *  - nsIDOMMozIccManager.STK_SERVICE_STATE_UNAVAILABLE
   378    */
   379   unsigned short locationStatus;
   381   /**
   382    * See MozStkLocationInfo.
   383    * This value shall only be provided if the locationStatus indicates
   384    * 'STK_SERVICE_STATE_NORMAL'.
   385    */
   386   MozStkLocationInfo locationInfo;
   387 };
   389 dictionary MozStkTimer
   390 {
   391   /**
   392    * Identifier of a timer.
   393    */
   394   octet timerId;
   396   /**
   397    * Length of time during which the timer has to run.
   398    * The resolution of a timer is 1 second.
   399    */
   400   unsigned long timerValue;
   402   /**
   403    * The action requested from UICC.
   404    * It shall be one of below:
   405    * - nsIDOMMozIccManager.STK_TIMER_START
   406    * - nsIDOMMozIccManager.STK_TIMER_DEACTIVATE
   407    * - nsIDOMMozIccManager.STK_TIMER_GET_CURRENT_VALUE
   408    */
   409   unsigned short timerAction;
   410 };
   412 dictionary MozStkBipMessage
   413 {
   414   /**
   415    * Text String
   416    */
   417   DOMString text;
   418 };
   420 dictionary MozStkCommand
   421 {
   422   /**
   423    * The number of command issued by ICC. And it is assigned
   424    * by ICC may take any hexadecimal value betweean '01' and 'FE'.
   425    *
   426    * @see TS 11.14, clause 6.5.1
   427    */
   428   unsigned short commandNumber;
   430   /**
   431    * One of STK_CMD_*
   432    */
   433   unsigned short typeOfCommand;
   435   /**
   436    * Qualifiers specific to the command.
   437    */
   438   unsigned short commandQualifier;
   440   /**
   441    * options varies accrording to the typeOfCommand in MozStkCommand.
   442    *
   443    * When typeOfCommand is
   444    * - STK_CMD_DISPLAY_TEXT
   445    * - STK_CMD_SET_UP_IDLE_MODE_TEXT
   446    * - STK_CMD_SEND_{SS|USSD|SMS|DTMF},
   447    * options is MozStkTextMessage.
   448    *
   449    * When typeOfCommand is
   450    * - STK_CMD_SELECT_ITEM
   451    * - STK_CMD_SET_UP_MENU
   452    * options is MozStkMenu.
   453    *
   454    * When typeOfCommand is
   455    * - STK_CMD_GET_INKEY
   456    * - STK_CMD_GET_INPUT,
   457    * options is MozStkInput.
   458    *
   459    * When typeOfCommand is
   460    * - STK_CMD_LAUNCH_BROWSER
   461    * options is MozStkBrowserSetting.
   462    *
   463    * When typeOfCommand is
   464    * - STK_CMD_SET_UP_CALL
   465    * options is MozStkSetUpCall.
   466    *
   467    * When typeOfCommand is
   468    * - STK_CMD_SET_UP_EVENT_LIST
   469    * options is MozStkSetUpEventList.
   470    *
   471    * When typeOfCommand is
   472    * - STK_CMD_PLAY_TONE
   473    * options is MozStkPlayTone.
   474    *
   475    * When typeOfCommand is
   476    * - STK_CMD_POLL_INTERVAL
   477    * options is MozStkDuration.
   478    *
   479    * When typeOfCommand is
   480    * - STK_CMD_PROVIDE_LOCAL_INFO
   481    * options is MozStkProvideLocalInfo.
   482    *
   483    * When typeOfCommand is
   484    * - STK_CMD_TIMER_MANAGEMENT
   485    * option is MozStkTimer
   486    *
   487    * When typeOfCommand is
   488    * - STK_CMD_OPEN_CHANNEL
   489    * - STK_CMD_CLOSE_CHANNEL
   490    * - STK_CMD_SEND_DATA
   491    * - STK_CMD_RECEIVE_DATA
   492    * options is MozStkBipMessage
   493    *
   494    * When typeOfCommand is
   495    * - STK_CMD_POLL_OFF
   496    * options is null.
   497    *
   498    * When typeOfCommand is
   499    * - STK_CMD_REFRESH
   500    * options is null.
   501    */
   502   any options;
   503 };
   505 dictionary MozStkResponse
   506 {
   507   /**
   508    * One of RESULT_*
   509    */
   510   unsigned short resultCode;
   512   /**
   513    * The identifier of the item selected by user.
   514    *
   515    * @see MozStkItem.identifier
   516    */
   517   unsigned short itemIdentifier;
   519   /**
   520    * User input.
   521    */
   522   DOMString input;
   524   /**
   525    * YES/NO response.
   526    *
   527    * @see MozStkInput.isYesNoRequested
   528    */
   529   boolean isYesNo;
   531   /**
   532    * User has confirmed or rejected the call during STK_CMD_CALL_SET_UP.
   533    *
   534    * @see RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
   535    *
   536    * true: Confirmed by User.
   537    * false: Rejected by User.
   538    */
   539   boolean hasConfirmed;
   541   /**
   542    * The response for STK_CMD_PROVIDE_LOCAL_INFO
   543    */
   544   MozStkLocalInfo localInfo;
   546   /**
   547    * The response for STK_CMD_TIMER_MANAGEMENT.
   548    * The 'timerValue' is needed if the action of STK_CMD_TIMER_MANAGEMENT is
   549    * 'STK_TIMER_DEACTIVATE' or 'STK_TIMER_GET_CURRENT_VALUE'. It shall state
   550    * the current value of a timer. And the resolution is 1 second.
   551    */
   552   MozStkTimer timer;
   553 };
   555 dictionary MozStkCallEvent
   556 {
   557   /**
   558    * The type of this event.
   559    * It shall be one of following:
   560    *     - nsIDOMMozIccManager.STK_EVENT_TYPE_MT_CALL,
   561    *     - nsIDOMMozIccManager.STK_EVENT_TYPE_CALL_CONNECTED,
   562    *     - nsIDOMMozIccManager.STK_EVENT_TYPE_CALL_DISCONNECTED.
   563    */
   564   unsigned short eventType;
   566   /**
   567    * Remote party number.
   568    */
   569   DOMString number;
   571   /**
   572    * This field is available in 'STK_EVENT_TYPE_CALL_CONNECTED' and
   573    * 'STK_EVENT_TYPE_CALL_DISCONNECTED' events.
   574    * For the STK_EVENT_TYPE_CALL_CONNECTED event, setting this to true means the
   575    * connection is answered by remote end, that is, this is an outgoing call.
   576    * For the STK_EVENT_TYPE_CALL_DISCONNECTED event, setting this to true
   577    * indicates the connection is hung up by remote.
   578    */
   579   boolean isIssuedByRemote;
   581   /**
   582    * This field is available in Call Disconnected event to indicate the cause
   583    * of disconnection. The cause string is passed to gaia through the error
   584    * listener of nsIDOMCallEvent. Null if there's no error.
   585    */
   586   DOMString error;
   587 };
   589 dictionary MozStkLocalInfo
   590 {
   591   /**
   592    * IMEI information
   593    */
   594   DOMString imei;
   596   /**
   597    * Location Information
   598    */
   599   MozStkLocationInfo locationInfo;
   601   /**
   602    * Date information
   603    */
   604   Date date;
   606   /**
   607    * Language Information
   608    *
   609    * @see ISO 639-1, Alpha-2 code
   610    */
   611   DOMString language;
   612 };
   614 dictionary MozStkLanguageSelectionEvent
   615 {
   616   /**
   617    * The type of this event.
   618    * It shall be nsIDOMMozIccManager.STK_EVENT_TYPE_LANGUAGE_SELECTION.
   619    */
   620   unsigned short eventType;
   622   /**
   623    * Language Information
   624    *
   625    * @see ISO 639-1, Alpha-2 code
   626    *      "de" for German, "en" for English, "zh" for Chinese, etc.
   627    */
   628   DOMString language;
   629 };
   631 dictionary MozStkBrowserTerminationEvent
   632 {
   633   /**
   634    * The type of this event.
   635    * It shall be nsIDOMMozIccManager.STK_EVENT_TYPE_BROWSER_TERMINATION
   636    */
   637   unsigned short eventType;
   639   /**
   640    * This object shall contain the browser termination cause.
   641    * See TZ 102 223 8.51. It shall be one of following:
   642    * - nsIDOMMozIccManager.STK_BROWSER_TERMINATION_CAUSE_USER
   643    * - nsIDOMMozIccManager.STK_BROWSER_TERMINATION_CAUSE_ERROR
   644    */
   645   unsigned short terminationCause;
   646 };
   648 dictionary MozStkGeneralEvent
   649 {
   650   /**
   651    * The type of this event, MozStkGeneralEvent can be used for all Stk Event
   652    * requires no more parameter than event type, including
   653    * nsIDOMMozIccManager.STK_EVENT_TYPE_USER_ACTIVITY.
   654    * nsIDOMMozIccManager.STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE.
   655    * HCI Connectivity Event(Not defined in interface yet).
   656    */
   657   unsigned short eventType;
   658 };

mercurial