Bug 981519 - Number and name presentation - part 1 - webidl. r=gene, r=smaug, a=lmandel
authorHsin-Yi Tsai <htsai@mozilla.com>
Wed, 09 Apr 2014 18:17:43 +0800
changeset 207975 b9ff3addea44359e6e5eed36cb14d27fb322503f
parent 207974 6d35586449b3a75dc701bcf7ef0f26214773309f
child 207976 4abdb4491e6c5291978622bba6a08796a9762a46
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgene, smaug, lmandel
bugs981519
milestone32.0a2
Bug 981519 - Number and name presentation - part 1 - webidl. r=gene, r=smaug, a=lmandel
dom/webidl/TelephonyCall.webidl
dom/webidl/TelephonyCallId.webidl
dom/webidl/moz.build
--- a/dom/webidl/TelephonyCall.webidl
+++ b/dom/webidl/TelephonyCall.webidl
@@ -4,21 +4,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 [Pref="dom.telephony.enabled"]
 interface TelephonyCall : EventTarget {
   // Indicate which service the call comes from.
   readonly attribute unsigned long serviceId;
 
-  readonly attribute DOMString number;
+  readonly attribute TelephonyCallId id;
 
   // In CDMA networks, the 2nd waiting call shares the connection with the 1st
-  // call. We need an additional attribute for the 2nd number.
-  readonly attribute DOMString? secondNumber;
+  // call. We need an additional attribute for the CDMA waiting call.
+  readonly attribute TelephonyCallId? secondId;
 
   readonly attribute DOMString state;
 
   // The property "emergency" indicates whether the call number is an emergency
   // number. Only the outgoing call could have a value with true and it is
   // available after dialing state.
   readonly attribute boolean emergency;
 
new file mode 100644
--- /dev/null
+++ b/dom/webidl/TelephonyCallId.webidl
@@ -0,0 +1,35 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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 CallIdPresentation {
+  "allowed",
+  // Call number/name has been withheld by the calling party.
+  "restricted",
+  // Call number is not available due to calling party being of type payphone.
+  "payphone",
+  // Call number/name is not available due to networking problems or other reason.
+  "unknown"
+};
+
+[Pref="dom.telephony.enabled"]
+interface TelephonyCallId {
+  // It is an empty string when "numberPresentation" is not "allowed."
+  readonly attribute DOMString number;
+
+  // This attribute is not relevant for outgoing calls. Default value is
+  // "allowed."
+  readonly attribute CallIdPresentation numberPresentation;
+
+  // This attribute is not relevant for outgoing calls. It is an empty string
+  // 1) when the call is outgoing, or 2) when the call is incoming and
+  // "namePresentation" is not "allowed." However, it could still be empty
+  // even the call is incoming and "namePresentation" is "allowed."
+  readonly attribute DOMString name;
+
+  // This attribute is not relevant for outgoing calls. Default value is
+  // "allowed."
+  readonly attribute CallIdPresentation namePresentation;
+};
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -432,16 +432,17 @@ WEBIDL_FILES = [
     'SVGURIReference.webidl',
     'SVGUseElement.webidl',
     'SVGViewElement.webidl',
     'SVGZoomAndPan.webidl',
     'SVGZoomEvent.webidl',
     'Telephony.webidl',
     'TelephonyCall.webidl',
     'TelephonyCallGroup.webidl',
+    'TelephonyCallId.webidl',
     'Text.webidl',
     'TextDecoder.webidl',
     'TextEncoder.webidl',
     'TextTrack.webidl',
     'TextTrackCueList.webidl',
     'TextTrackList.webidl',
     'TimeEvent.webidl',
     'TimeRanges.webidl',