Bug 942104 - Add nsIDOMBluetoothDiscoveryStateChangedEvent, r=gyeh

This commit is contained in:
Eric Chou 2013-11-30 20:20:17 +08:00
parent d3a0fe86e9
commit e25ca0c35b
8 changed files with 47 additions and 0 deletions

View File

@ -48,6 +48,10 @@ const kEventConstructors = {
return new BluetoothDeviceEvent(aName, aProps);
},
},
BluetoothDiscoveryStateChangedEvent: { create: function (aName, aProps) {
return new BluetoothDiscoveryStateChangedEvent(aName, aProps);
},
},
BluetoothStatusChangedEvent: { create: function (aName, aProps) {
return new BluetoothStatusChangedEvent(aName, aProps);
},

View File

@ -9,6 +9,7 @@
#include "nsCxPusher.h"
#include "nsDOMClassInfo.h"
#include "nsIDOMBluetoothDeviceEvent.h"
#include "nsIDOMBluetoothDiscoveryStateChangedEvent.h"
#include "nsIDOMBluetoothStatusChangedEvent.h"
#include "nsTArrayHelpers.h"
#include "DOMRequest.h"

View File

@ -8,6 +8,7 @@ if CONFIG['MOZ_B2G_BT']:
XPIDL_SOURCES += [
'nsIDOMBluetoothDevice.idl',
'nsIDOMBluetoothDeviceEvent.idl',
'nsIDOMBluetoothDiscoveryStateChangedEvent.idl',
'nsIDOMBluetoothStatusChangedEvent.idl',
]
XPIDL_MODULE = 'dom_bluetooth'

View File

@ -0,0 +1,22 @@
/* 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 "nsIDOMEvent.idl"
[scriptable, builtinclass, uuid(9de639cb-71c4-4144-8462-09763ec87c20)]
interface nsIDOMBluetoothDiscoveryStateChangedEvent : nsIDOMEvent
{
readonly attribute boolean discovering;
[noscript]
void initBluetoothDiscoveryStateChangedEvent(in DOMString aType,
in boolean aCanBubble,
in boolean aCancelable,
in boolean aDiscovering);
};
dictionary BluetoothDiscoveryStateChangedEventInit : EventInit
{
bool discovering;
};

View File

@ -134,6 +134,7 @@ var interfaceNamesInGlobalScope =
{name: "BluetoothAdapter", b2g: true},
{name: "BluetoothDevice", b2g: true},
{name: "BluetoothDeviceEvent", b2g: true},
{name: "BluetoothDiscoveryStateChangedEvent", b2g: true},
{name: "BluetoothManager", b2g: true},
{name: "BluetoothStatusChangedEvent", b2g: true},
{name: "BoxObject", xbl: true},

View File

@ -0,0 +1,16 @@
/* -*- 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/.
*/
[Constructor(DOMString type, optional BluetoothDiscoveryStateChangedEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
interface BluetoothDiscoveryStateChangedEvent : Event
{
readonly attribute boolean discovering;
};
dictionary BluetoothDiscoveryStateChangedEventInit : EventInit
{
boolean discovering = false;
};

View File

@ -503,6 +503,7 @@ if CONFIG['MOZ_B2G_BT']:
'BluetoothAdapter.webidl',
'BluetoothDevice.webidl',
'BluetoothDeviceEvent.webidl',
'BluetoothDiscoveryStateChangedEvent.webidl',
'BluetoothManager.webidl',
'BluetoothStatusChangedEvent.webidl',
]

View File

@ -30,6 +30,7 @@ simple_events = [
#ifdef MOZ_B2G_BT
'BluetoothDeviceEvent',
'BluetoothStatusChangedEvent',
'BluetoothDiscoveryStateChangedEvent',
#endif
#ifdef MOZ_B2G_RIL
'CFStateChangeEvent',