/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_MediaStreamTrackBinding_h__
#define mozilla_dom_MediaStreamTrackBinding_h__

#include "js/RootingAPI.h"
#include "jspubtd.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/UnionTypes.h"

namespace mozilla {
namespace dom {

class BooleanOrObject;
struct MediaStreamConstraintsAtoms;
struct MediaStreamConstraintsInternalAtoms;
class MediaStreamTrack;
struct MediaTrackConstraintSet;
struct MediaTrackConstraintSetAtoms;
struct MediaTrackConstraintsAtoms;
struct MediaTrackConstraintsInternal;
struct MediaTrackConstraintsInternalAtoms;
class NativePropertyHooks;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {


MOZ_BEGIN_ENUM_CLASS(VideoFacingModeEnum, uint32_t)
  User,
  Environment,
  Left,
  Right
MOZ_END_ENUM_CLASS(VideoFacingModeEnum)

namespace VideoFacingModeEnumValues {
extern const EnumEntry strings[5];
} // namespace VideoFacingModeEnumValues


struct MediaStreamConstraints : public MainThreadDictionaryBase
{
  BooleanOrObjectReturnValue mAudio;
  bool mFake;
  bool mPicture;
  BooleanOrObjectReturnValue mVideo;

  inline MediaStreamConstraints()
  {
  }

private:
  MediaStreamConstraints(const MediaStreamConstraints&) MOZ_DELETE;
  void operator=(const MediaStreamConstraints) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, MediaStreamConstraintsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value");

  bool
  Init(const nsAString& aJSON);

  bool
  ToObject(JSContext* cx, JS::Handle<JSObject*> parentObject, JS::MutableHandle<JS::Value> rval) const;

  void
  TraceDictionary(JSTracer* trc);
};
struct MediaStreamConstraintsInitializer : public MediaStreamConstraints
{
  MediaStreamConstraintsInitializer();
};


struct MediaTrackConstraintSet : public MainThreadDictionaryBase
{
  Optional<VideoFacingModeEnum > mFacingMode;

  inline MediaTrackConstraintSet()
  {
  }

  explicit inline MediaTrackConstraintSet(const MediaTrackConstraintSet& aOther)
  {
    *this = aOther;
  }

  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value");

  bool
  Init(const nsAString& aJSON);

  bool
  ToObject(JSContext* cx, JS::Handle<JSObject*> parentObject, JS::MutableHandle<JS::Value> rval) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const MediaTrackConstraintSet& aOther);

private:
  static bool
  InitIds(JSContext* cx, MediaTrackConstraintSetAtoms* atomsCache);
};
struct MediaTrackConstraintSetInitializer : public MediaTrackConstraintSet
{
  MediaTrackConstraintSetInitializer();
};


struct MediaTrackConstraints : public MainThreadDictionaryBase
{
  Optional<JSObject* > mMandatory;
  Optional<Sequence<MediaTrackConstraintSet > > mOptional;

  inline MediaTrackConstraints()
  {
  }

private:
  MediaTrackConstraints(const MediaTrackConstraints&) MOZ_DELETE;
  void operator=(const MediaTrackConstraints) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, MediaTrackConstraintsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value");

  bool
  Init(const nsAString& aJSON);

  bool
  ToObject(JSContext* cx, JS::Handle<JSObject*> parentObject, JS::MutableHandle<JS::Value> rval) const;

  void
  TraceDictionary(JSTracer* trc);
};
struct MediaTrackConstraintsInitializer : public MediaTrackConstraints
{
  MediaTrackConstraintsInitializer();
};


struct MediaTrackConstraintsInternal : public MainThreadDictionaryBase
{
  MediaTrackConstraintSet mMandatory;
  Optional<Sequence<MediaTrackConstraintSet > > mOptional;

  inline MediaTrackConstraintsInternal()
  {
  }

  explicit inline MediaTrackConstraintsInternal(const MediaTrackConstraintsInternal& aOther)
  {
    *this = aOther;
  }

  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value");

  bool
  Init(const nsAString& aJSON);

  bool
  ToObject(JSContext* cx, JS::Handle<JSObject*> parentObject, JS::MutableHandle<JS::Value> rval) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const MediaTrackConstraintsInternal& aOther);

private:
  static bool
  InitIds(JSContext* cx, MediaTrackConstraintsInternalAtoms* atomsCache);
};
struct MediaTrackConstraintsInternalInitializer : public MediaTrackConstraintsInternal
{
  MediaTrackConstraintsInternalInitializer();
};


struct MediaStreamConstraintsInternal : public MainThreadDictionaryBase
{
  bool mAudio;
  MediaTrackConstraintsInternal mAudiom;
  bool mFake;
  bool mPicture;
  bool mVideo;
  MediaTrackConstraintsInternal mVideom;

  inline MediaStreamConstraintsInternal()
  {
  }

  explicit inline MediaStreamConstraintsInternal(const MediaStreamConstraintsInternal& aOther)
  {
    *this = aOther;
  }

  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value");

  bool
  Init(const nsAString& aJSON);

  bool
  ToObject(JSContext* cx, JS::Handle<JSObject*> parentObject, JS::MutableHandle<JS::Value> rval) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const MediaStreamConstraintsInternal& aOther);

private:
  static bool
  InitIds(JSContext* cx, MediaStreamConstraintsInternalAtoms* atomsCache);
};
struct MediaStreamConstraintsInternalInitializer : public MediaStreamConstraintsInternal
{
  MediaStreamConstraintsInternalInitializer();
};


namespace MediaStreamTrackBinding {

  typedef mozilla::dom::MediaStreamTrack NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  // address arithmetic.  Declaring it as a pointer instead would require
  // doing a run-time load to fetch a pointer to this binding's property
  // hooks.  And then structures which embedded a pointer to this structure
  // would require a run-time load for proper initialization, which would
  // then induce static constructors.  Lots of static constructors.
  extern const NativePropertyHooks sNativePropertyHooks[];
  JSObject*
  DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);

  void
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Heap<JSObject*>* aProtoAndIfaceArray, bool aDefineOnGlobal);

  JS::Handle<JSObject*>
  GetProtoObject(JSContext* aCx, JS::Handle<JSObject*> aGlobal);

  JS::Handle<JSObject*>
  GetConstructorObject(JSContext* aCx, JS::Handle<JSObject*> aGlobal, bool aDefineOnGlobal = true);

} // namespace MediaStreamTrackBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_MediaStreamTrackBinding_h__
