Bumping manifests a=b2g-bump
[gecko.git] / dom / bluetooth / BluetoothManager.h
blobcbac429cc683ef34d83314402f66042e07a3173e
1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_bluetooth_bluetoothmanager_h__
8 #define mozilla_dom_bluetooth_bluetoothmanager_h__
10 #include "mozilla/Attributes.h"
11 #include "mozilla/DOMEventTargetHelper.h"
12 #include "mozilla/Observer.h"
13 #include "BluetoothCommon.h"
14 #include "BluetoothPropertyContainer.h"
15 #include "nsISupportsImpl.h"
17 namespace mozilla {
18 namespace dom {
19 class DOMRequest;
23 BEGIN_BLUETOOTH_NAMESPACE
25 class BluetoothNamedValue;
27 class BluetoothManager : public DOMEventTargetHelper
28 , public BluetoothSignalObserver
29 , public BluetoothPropertyContainer
31 public:
32 NS_DECL_ISUPPORTS_INHERITED
34 // Never returns null
35 static already_AddRefed<BluetoothManager>
36 Create(nsPIDOMWindow* aWindow);
37 static bool CheckPermission(nsPIDOMWindow* aWindow);
38 void Notify(const BluetoothSignal& aData);
39 virtual void SetPropertyByValue(const BluetoothNamedValue& aValue) MOZ_OVERRIDE;
41 bool GetEnabled(ErrorResult& aRv);
43 already_AddRefed<DOMRequest> GetDefaultAdapter(ErrorResult& aRv);
45 IMPL_EVENT_HANDLER(enabled);
46 IMPL_EVENT_HANDLER(disabled);
47 IMPL_EVENT_HANDLER(adapteradded);
49 nsPIDOMWindow* GetParentObject() const
51 return GetOwner();
54 virtual JSObject*
55 WrapObject(JSContext* aCx) MOZ_OVERRIDE;
57 virtual void DisconnectFromOwner() MOZ_OVERRIDE;
59 private:
60 BluetoothManager(nsPIDOMWindow* aWindow);
61 ~BluetoothManager();
64 END_BLUETOOTH_NAMESPACE
66 #endif