dom/bluetooth/BluetoothPropertyContainer.h

branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
equal deleted inserted replaced
-1:000000000000 0:50de8c68e93a
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/. */
6
7 #ifndef mozilla_dom_bluetooth_bluetoothpropertyobject_h__
8 #define mozilla_dom_bluetooth_bluetoothpropertyobject_h__
9
10 #include "BluetoothCommon.h"
11 #include "BluetoothReplyRunnable.h"
12
13 class nsIDOMDOMRequest;
14 class nsPIDOMWindow;
15
16 namespace mozilla {
17 class ErrorResult;
18 namespace dom {
19 class DOMRequest;
20 }
21 }
22
23 BEGIN_BLUETOOTH_NAMESPACE
24
25 class BluetoothNamedValue;
26
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 }
40
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;
45
46 protected:
47 BluetoothPropertyContainer(BluetoothObjectType aType) :
48 mObjectType(aType)
49 {}
50
51 ~BluetoothPropertyContainer()
52 {}
53
54 nsString mPath;
55 BluetoothObjectType mObjectType;
56 };
57
58 END_BLUETOOTH_NAMESPACE
59
60 #endif

mercurial