Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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_bluetoothpropertyobject_h__
8 #define mozilla_dom_bluetooth_bluetoothpropertyobject_h__
10 #include "BluetoothCommon.h"
11 #include "BluetoothReplyRunnable.h"
13 class nsIDOMDOMRequest;
14 class nsPIDOMWindow;
16 namespace mozilla {
17 class ErrorResult;
18 namespace dom {
19 class DOMRequest;
20 }
21 }
23 BEGIN_BLUETOOTH_NAMESPACE
25 class BluetoothNamedValue;
27 class BluetoothPropertyContainer
28 {
29 public:
30 already_AddRefed<mozilla::dom::DOMRequest>
31 FirePropertyAlreadySet(nsPIDOMWindow* aOwner, ErrorResult& aRv);
32 already_AddRefed<mozilla::dom::DOMRequest>
33 SetProperty(nsPIDOMWindow* aOwner, const BluetoothNamedValue& aProperty,
34 ErrorResult& aRv);
35 virtual void SetPropertyByValue(const BluetoothNamedValue& aValue) = 0;
36 nsString GetPath()
37 {
38 return mPath;
39 }
41 // Compatibility with nsRefPtr to make sure we don't hold a weakptr to
42 // ourselves
43 virtual nsrefcnt AddRef() = 0;
44 virtual nsrefcnt Release() = 0;
46 protected:
47 BluetoothPropertyContainer(BluetoothObjectType aType) :
48 mObjectType(aType)
49 {}
51 ~BluetoothPropertyContainer()
52 {}
54 nsString mPath;
55 BluetoothObjectType mObjectType;
56 };
58 END_BLUETOOTH_NAMESPACE
60 #endif