1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/Telephony.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,47 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + */ 1.9 + 1.10 +[Pref="dom.telephony.enabled"] 1.11 +interface Telephony : EventTarget { 1.12 + /** 1.13 + * There are multiple telephony services in multi-sim architecture. We use 1.14 + * |serviceId| to indicate the target telephony service. If not specified, 1.15 + * the implementation MUST use the default service. 1.16 + * 1.17 + * Possible values of |serviceId| are 0 ~ (number of services - 1), which is 1.18 + * simply the index of a service. Get number of services by acquiring 1.19 + * |navigator.mozMobileConnections.length|. 1.20 + */ 1.21 + 1.22 + // Promise<TelephonyCall> 1.23 + Promise dial(DOMString number, optional unsigned long serviceId); 1.24 + 1.25 + // Promise<TelephonyCall> 1.26 + Promise dialEmergency(DOMString number, optional unsigned long serviceId); 1.27 + 1.28 + [Throws] 1.29 + void startTone(DOMString tone, optional unsigned long serviceId); 1.30 + 1.31 + [Throws] 1.32 + void stopTone(optional unsigned long serviceId); 1.33 + 1.34 + [Throws] 1.35 + attribute boolean muted; 1.36 + 1.37 + [Throws] 1.38 + attribute boolean speakerEnabled; 1.39 + 1.40 + readonly attribute (TelephonyCall or TelephonyCallGroup)? active; 1.41 + 1.42 + // A call is contained either in Telephony or in TelephonyCallGroup. 1.43 + readonly attribute CallsList calls; 1.44 + readonly attribute TelephonyCallGroup conferenceGroup; 1.45 + 1.46 + attribute EventHandler onincoming; 1.47 + attribute EventHandler oncallschanged; 1.48 + attribute EventHandler onremoteheld; 1.49 + attribute EventHandler onremoteresumed; 1.50 +};