dom/bluetooth/BluetoothPropertyContainer.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/bluetooth/BluetoothPropertyContainer.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
     1.5 +/* vim: set ts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.8 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef mozilla_dom_bluetooth_bluetoothpropertyobject_h__
    1.11 +#define mozilla_dom_bluetooth_bluetoothpropertyobject_h__
    1.12 +
    1.13 +#include "BluetoothCommon.h"
    1.14 +#include "BluetoothReplyRunnable.h"
    1.15 +
    1.16 +class nsIDOMDOMRequest;
    1.17 +class nsPIDOMWindow;
    1.18 +
    1.19 +namespace mozilla {
    1.20 +class ErrorResult;
    1.21 +namespace dom {
    1.22 +class DOMRequest;
    1.23 +}
    1.24 +}
    1.25 +
    1.26 +BEGIN_BLUETOOTH_NAMESPACE
    1.27 +
    1.28 +class BluetoothNamedValue;
    1.29 +
    1.30 +class BluetoothPropertyContainer
    1.31 +{
    1.32 +public:
    1.33 +  already_AddRefed<mozilla::dom::DOMRequest>
    1.34 +    FirePropertyAlreadySet(nsPIDOMWindow* aOwner, ErrorResult& aRv);
    1.35 +  already_AddRefed<mozilla::dom::DOMRequest>
    1.36 +    SetProperty(nsPIDOMWindow* aOwner, const BluetoothNamedValue& aProperty,
    1.37 +                ErrorResult& aRv);
    1.38 +  virtual void SetPropertyByValue(const BluetoothNamedValue& aValue) = 0;
    1.39 +  nsString GetPath()
    1.40 +  {
    1.41 +    return mPath;
    1.42 +  }
    1.43 +
    1.44 +  // Compatibility with nsRefPtr to make sure we don't hold a weakptr to
    1.45 +  // ourselves
    1.46 +  virtual nsrefcnt AddRef() = 0;
    1.47 +  virtual nsrefcnt Release() = 0;
    1.48 +
    1.49 +protected:
    1.50 +  BluetoothPropertyContainer(BluetoothObjectType aType) :
    1.51 +    mObjectType(aType)
    1.52 +  {}
    1.53 +
    1.54 +  ~BluetoothPropertyContainer()
    1.55 +  {}
    1.56 +
    1.57 +  nsString mPath;
    1.58 +  BluetoothObjectType mObjectType;
    1.59 +};
    1.60 +
    1.61 +END_BLUETOOTH_NAMESPACE
    1.62 +
    1.63 +#endif

mercurial