WebAPI/WebMobileConnection: Difference between revisions

Jump to navigation Jump to search
Line 21: Line 21:
     */
     */
     readonly attribute string cardState;
     readonly attribute string cardState;
   
   
     /**
     /**
     * Indicates whether the device is connected to a mobile network.
     * Information about the voice connection.
     */
     */
     readonly attribute bool connected;
     readonly attribute MobileConnectionInfo voice;
   
   
     /**
     /**
     * Indicates whether emergency calls are possible.
     * Information about the data connection.
    *
    * This flag is only relevant when 'connected' is false.
     */
     */
     readonly attribute bool emergencyCallsPossible;
     readonly attribute MobileConnectionInfo data;
      
      
     /**
     /**
     * Indicates whether the connection is going through a foreign operator
     * The 'cardstatechange' event is notified when the 'cardState' attribute
     * (roaming) or not.
     * changes value.
     */
     */
     readonly attribute bool roaming;
     attribute EventListener oncardstatechange;
      
      
     /**
     /**
     * Operator name.
     * The 'voicechange' event is notified whenever the voice connection object
    * changes.
     */
     */
     readonly attribute string operator?;
     attribute EventListener onvoicechange;
      
      
     /**
     /**
     * Type of connection.
     * The 'datachange' event is notified whenever the data connection object
    *
     * changes values.
     * Possible values: 'gprs', 'edge', 'umts', 'hsdpa', 'evdo0', 'evdoa', 'evdob', etc.
     */
     */
     readonly attribute string type?;
     attribute EventListener ondatachange;
   
    /**
    * Signal strength, represented linearly as a number between 0 (weakest signal) and 1.0
    * (full signal).
    */
    readonly attribute float signalStrength?;
   
    /**
    * Signal strength in dBm, or null if no service is available.
    */
    readonly attribute short signalStrengthDbm?;
      
      
     /**
     /**
Line 73: Line 60:
     */
     */
     DOMRequest getNetworks();
     DOMRequest getNetworks();
   
    /**
    * The 'cardstatechange' event is notified when the 'cardState' attribute
    * changes value.
    */
    attribute EventListener oncardstatechange;
   
    /**
    * The 'connectionchange' event is notified whenever one of the 'connected',
    * 'roaming', 'operator', 'type' attributes change, since typically many or
    * all of them change together.
    */
    attribute EventListener onconnectionchange;
   
    /**
    * The 'signalstrengthchange' event is notified whenever the signal strength
    * changes value. The 'bars' attribute is updated accordingly.
    */
    attribute EventListener onsignalstrengthchange;
      
      
     /**
     /**
Line 104: Line 72:
     *        e.g. {lockType: "pin", enabled: true}.
     *        e.g. {lockType: "pin", enabled: true}.
     */
     */
     DOMRequest getCardLock(in DOMString lockType);
     DOMRequest getCardLock(DOMString lockType);
 
   
     /**
     /**
     * Unlock a card lock.
     * Unlock a card lock.
Line 129: Line 97:
     *                  newPin: "..."});
     *                  newPin: "..."});
     *
     *
     * @return a nsIDOMDOMRequest.
     * @return a DOMRequest.
     *        The request's result will be an object containing  
     *        The request's result will be an object containing  
     *        information about the unlock operation.
     *        information about the unlock operation.
Line 150: Line 118:
     *    }
     *    }
     */
     */
     DOMRequest unlockCardLock(in jsval info);
     DOMRequest unlockCardLock(Object info);
 
   
     /**
     /**
     * Modify the state of a card lock.
     * Modify the state of a card lock.
Line 176: Line 144:
     *                newPin: "..."});
     *                newPin: "..."});
     *
     *
     * @return a nsIDOMDOMRequest.
     * @return a DOMRequest.
     *        The request's result will be an object containing  
     *        The request's result will be an object containing  
     *        information about the operation.
     *        information about the operation.
Line 197: Line 165:
     *    }
     *    }
     */
     */
     DOMRequest setCardLock(in jsval info);
     DOMRequest setCardLock(Object info);
   
  };


  interface MobileConnectionInfo
  {
    /**
    * Indicates whether the device is connected to a mobile network.
    */
    readonly attribute bool connected;
   
    /**
    * Indicates whether only emergency calls are possible.
    *
    * This flag is only relevant to voice connections and when 'connected' is
    * false.
    */
    readonly attribute bool emergencyCallsOnly;
   
    /**
    * Indicates whether the connection is going through a foreign operator
    * (roaming) or not.
    */
    readonly attribute bool roaming;
   
    /**
    * Network operator
    */
    readonly attribute DOMString operator;
   
    /**
    * Type of connection.
    *
    * Possible values: 'gsm', 'cdma', gprs', 'edge', 'umts', 'hsdpa', 'evdo0',
    * 'evdoa', 'evdob', etc.
    */
    readonly attribute DOMString type;
   
    /**
    * Signal strength in dBm, or null if no service is available.
    */
    readonly attribute int signalStrength;
   
    /**
    * Signal strength, represented linearly as a number between 0 (weakest
    * signal) and 100 (full signal).
    */
    readonly attribute int relSignalStrength;
   
  };
  interface MobileOperatorInfo
  {
    /**
    * Short name of the network operator
    */
    readonly attribute DOMString shortName;
   
    /**
    * Long name of the network operator
    */
    readonly attribute DOMString longName;
   
    /**
    * Mobile Country Code (MCC) of the network operator
    */
    readonly attribute unsigned short mcc;
   
    /**
    * Mobile Network Code (MNC) of the network operator
    */
    readonly attribute unsigned short mnc;
   
    /**
    * State of this network operator.
    *
    * Possible values: 'available', 'connected', 'forbidden', or null (unknown)
    */
    readonly attribute DOMString state;
   };
   };


23

edits

Navigation menu