michael@0: /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_bluetooth_bluetoothpropertyobject_h__ michael@0: #define mozilla_dom_bluetooth_bluetoothpropertyobject_h__ michael@0: michael@0: #include "BluetoothCommon.h" michael@0: #include "BluetoothReplyRunnable.h" michael@0: michael@0: class nsIDOMDOMRequest; michael@0: class nsPIDOMWindow; michael@0: michael@0: namespace mozilla { michael@0: class ErrorResult; michael@0: namespace dom { michael@0: class DOMRequest; michael@0: } michael@0: } michael@0: michael@0: BEGIN_BLUETOOTH_NAMESPACE michael@0: michael@0: class BluetoothNamedValue; michael@0: michael@0: class BluetoothPropertyContainer michael@0: { michael@0: public: michael@0: already_AddRefed michael@0: FirePropertyAlreadySet(nsPIDOMWindow* aOwner, ErrorResult& aRv); michael@0: already_AddRefed michael@0: SetProperty(nsPIDOMWindow* aOwner, const BluetoothNamedValue& aProperty, michael@0: ErrorResult& aRv); michael@0: virtual void SetPropertyByValue(const BluetoothNamedValue& aValue) = 0; michael@0: nsString GetPath() michael@0: { michael@0: return mPath; michael@0: } michael@0: michael@0: // Compatibility with nsRefPtr to make sure we don't hold a weakptr to michael@0: // ourselves michael@0: virtual nsrefcnt AddRef() = 0; michael@0: virtual nsrefcnt Release() = 0; michael@0: michael@0: protected: michael@0: BluetoothPropertyContainer(BluetoothObjectType aType) : michael@0: mObjectType(aType) michael@0: {} michael@0: michael@0: ~BluetoothPropertyContainer() michael@0: {} michael@0: michael@0: nsString mPath; michael@0: BluetoothObjectType mObjectType; michael@0: }; michael@0: michael@0: END_BLUETOOTH_NAMESPACE michael@0: michael@0: #endif