Skip to content

Commit

Permalink
Bug 898445 - Part 1-3: Move MozMobileConnectionInfo to webidl. r=hsin…
Browse files Browse the repository at this point in the history
…yi,smaug
  • Loading branch information
EdgarChen committed Apr 24, 2014
1 parent afbd861 commit cce2fb2
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 61 deletions.
1 change: 1 addition & 0 deletions dom/mobileconnection/interfaces/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
XPIDL_SOURCES += [
'nsIDOMMobileConnection.idl',
'nsIMobileCellInfo.idl',
'nsIMobileConnectionInfo.idl',
'nsIMobileConnectionProvider.idl',
'nsIMobileNetworkInfo.idl',
]
Expand Down
61 changes: 0 additions & 61 deletions dom/mobileconnection/interfaces/nsIDOMMobileConnection.idl
Original file line number Diff line number Diff line change
Expand Up @@ -479,67 +479,6 @@ interface nsIDOMMozMobileConnection : nsIDOMEventTarget
[implicit_jscontext] attribute jsval onclirmodechange;
};

[scriptable, uuid(49706beb-a160-40b7-b745-50f62e389a2c)]
interface nsIDOMMozMobileConnectionInfo : nsISupports
{
/**
* State of the connection.
*
* Possible values: 'notSearching', 'searching', 'denied', 'registered'.
* null if the state is unknown.
*/
readonly attribute DOMString state;

/**
* Indicates whether the connection is ready. This may be different
*/
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 nsIDOMMozMobileNetworkInfo network;

/**
* 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 jsval signalStrength;

/**
* Signal strength, represented linearly as a number between 0 (weakest
* signal) and 100 (full signal).
*/
readonly attribute jsval relSignalStrength;

/**
* Cell location.
*/
readonly attribute nsIDOMMozMobileCellInfo cell;

};

[scriptable, uuid(d1b35ad8-99aa-47cc-ab49-2e72b00e39df)]
interface nsIDOMMozMobileCFInfo : nsISupports
{
Expand Down
73 changes: 73 additions & 0 deletions dom/mobileconnection/interfaces/nsIMobileConnectionInfo.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/* 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 "nsISupports.idl"

interface nsIMobileCellInfo;
interface nsIMobileNetworkInfo;

[scriptable, uuid(d5208e13-42dc-4dce-9427-2572fa252751)]
interface nsIMobileConnectionInfo : nsISupports
{
/**
* State of the connection.
*
* Possible values: 'notSearching', 'searching', 'denied', 'registered' or
* null (unknown).
*/
readonly attribute DOMString state;

/**
* Indicates whether the connection is ready.
*
* Note: The meaning of "connection ready" for data and voice are different.
* - Data: the "default" data connection is established or not.
* - Voice: voice is registered to network or not.
*/
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 information.
*/
readonly attribute nsIMobileNetworkInfo network;

/**
* Type of connection.
*
* Possible values: 'gsm', 'gprs', 'edge', 'umts', 'hsdpa', 'hsupa', 'hspa',
* 'hspa+', 'is95a', 'is95b', '1xrtt', 'evdo0', 'evdoa',
* 'evdob', 'ehrpd', 'lte' or null (unknown).
*/
readonly attribute DOMString type;

/**
* Signal strength in dBm, or null if no service is available.
*/
readonly attribute jsval signalStrength;

/**
* Signal strength, represented linearly as a number between 0 (weakest
* signal) and 100 (full signal).
*/
readonly attribute jsval relSignalStrength;

/**
* Cell location information.
*/
readonly attribute nsIMobileCellInfo cell;
};
66 changes: 66 additions & 0 deletions dom/webidl/MozMobileConnectionInfo.webidl
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/* 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/. */

enum MobileConnectionState {"notSearching", "searching", "denied", "registered"};
enum MobileConnectionType {"gsm", "gprs", "edge", "umts", "hsdpa", "hsupa",
"hspa", "hspa+", "is95a", "is95b", "1xrtt", "evdo0",
"evdoa", "evdob", "ehrpd", "lte"};

[Pref="dom.mobileconnection.enabled"]
interface MozMobileConnectionInfo
{
/**
* State of the connection.
*/
readonly attribute MobileConnectionState? state;

/**
* Indicates whether the connection is ready.
*
* Note: The meaning of "connection ready" for data and voice are different.
* - Data: the "default" data connection is established or not.
* - Voice: voice is registered to network or not.
*/
readonly attribute boolean connected;

/**
* Indicates whether only emergency calls are possible.
*
* This flag is only relevant to voice connections and when 'connected' is
* false.
*/
readonly attribute boolean emergencyCallsOnly;

/**
* Indicates whether the connection is going through a foreign operator
* (roaming) or not.
*/
readonly attribute boolean roaming;

/**
* Network operator information.
*/
readonly attribute MozMobileNetworkInfo? network;

/**
* Type of connection.
*/
readonly attribute MobileConnectionType? type;

/**
* Signal strength in dBm, or null if no service is available.
*/
readonly attribute long? signalStrength;

/**
* Signal strength, represented linearly as a number between 0 (weakest
* signal) and 100 (full signal).
*/
readonly attribute unsigned short? relSignalStrength;

/**
* Cell location information.
*/
readonly attribute MozMobileCellInfo? cell;
};
1 change: 1 addition & 0 deletions dom/webidl/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ if CONFIG['MOZ_B2G_RIL']:
'MozIccManager.webidl',
'MozMobileCellInfo.webidl',
'MozMobileConnectionArray.webidl',
'MozMobileConnectionInfo.webidl',
'MozMobileNetworkInfo.webidl',
'MozVoicemail.webidl',
'MozVoicemailEvent.webidl',
Expand Down

0 comments on commit cce2fb2

Please sign in to comment.