/* THIS FILE IS AUTOGENERATED FROM CameraControl.webidl BY Codegen.py - DO NOT EDIT */

#ifndef mozilla_dom_CameraControlBinding_h
#define mozilla_dom_CameraControlBinding_h

#include "CameraManagerBinding.h"
#include "DOMPointBinding.h"
#include "js/RootingAPI.h"
#include "jspubtd.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"

namespace mozilla {

class nsDOMCameraControl;
struct nsDOMCameraControlAtoms;

namespace dom {

struct CameraDetectedFaceInitAtoms;
struct CameraPictureOptionsAtoms;
struct CameraPosition;
struct CameraPositionAtoms;
struct CameraRegion;
struct CameraRegionAtoms;
struct CameraSize;
struct CameraStartRecordingOptionsAtoms;
class DOMCameraDetectedFace;
struct DOMCameraDetectedFaceAtoms;
struct DOMPointInit;
struct NativePropertyHooks;
class ProtoAndIfaceCache;

} // namespace dom

} // namespace mozilla

namespace mozilla {
namespace dom {

struct CameraPosition : public DictionaryBase
{
  double mAltitude;
  double mLatitude;
  double mLongitude;
  double mTimestamp;

  CameraPosition();

  explicit inline CameraPosition(const FastDictionaryInitializer& )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

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

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

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const CameraPosition& aOther);

private:
  static bool
  InitIds(JSContext* cx, CameraPositionAtoms* atomsCache);
};

namespace binding_detail {
struct FastCameraPosition : public CameraPosition
{
  inline FastCameraPosition()
    : CameraPosition(FastDictionaryInitializer())
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct CameraRegion : public DictionaryBase
{
  int32_t mBottom;
  int32_t mLeft;
  int32_t mRight;
  int32_t mTop;
  uint32_t mWeight;

  CameraRegion();

  explicit inline CameraRegion(const FastDictionaryInitializer& )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

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

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

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const CameraRegion& aOther);

private:
  static bool
  InitIds(JSContext* cx, CameraRegionAtoms* atomsCache);
};

namespace binding_detail {
struct FastCameraRegion : public CameraRegion
{
  inline FastCameraRegion()
    : CameraRegion(FastDictionaryInitializer())
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct CameraStartRecordingOptions : public DictionaryBase
{
  bool mAutoEnableLowLightTorch;
  bool mCreatePoster;
  uint64_t mMaxFileSizeBytes;
  uint64_t mMaxVideoLengthMs;
  int32_t mRotation;

  CameraStartRecordingOptions();

  explicit inline CameraStartRecordingOptions(const FastDictionaryInitializer& )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

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

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

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const CameraStartRecordingOptions& aOther);

private:
  static bool
  InitIds(JSContext* cx, CameraStartRecordingOptionsAtoms* atomsCache);
};

namespace binding_detail {
struct FastCameraStartRecordingOptions : public CameraStartRecordingOptions
{
  inline FastCameraStartRecordingOptions()
    : CameraStartRecordingOptions(FastDictionaryInitializer())
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct CameraDetectedFaceInit : public DictionaryBase
{
  CameraRegion mBounds;
  bool mHasLeftEye;
  bool mHasMouth;
  bool mHasRightEye;
  uint32_t mId;
  DOMPointInit mLeftEye;
  DOMPointInit mMouth;
  DOMPointInit mRightEye;
  uint32_t mScore;

  CameraDetectedFaceInit();

  explicit inline CameraDetectedFaceInit(const FastDictionaryInitializer& )
    : mBounds(FastDictionaryInitializer()),
      mLeftEye(FastDictionaryInitializer()),
      mMouth(FastDictionaryInitializer()),
      mRightEye(FastDictionaryInitializer())
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

  explicit inline CameraDetectedFaceInit(const CameraDetectedFaceInit& aOther)
    : mBounds(FastDictionaryInitializer()),
      mLeftEye(FastDictionaryInitializer()),
      mMouth(FastDictionaryInitializer()),
      mRightEye(FastDictionaryInitializer())
  {
    *this = aOther;
  }

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

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const CameraDetectedFaceInit& aOther);

private:
  static bool
  InitIds(JSContext* cx, CameraDetectedFaceInitAtoms* atomsCache);
};

namespace binding_detail {
struct FastCameraDetectedFaceInit : public CameraDetectedFaceInit
{
  inline FastCameraDetectedFaceInit()
    : CameraDetectedFaceInit(FastDictionaryInitializer())
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct CameraPictureOptions : public DictionaryBase
{
  int64_t mDateTime;
  nsString mFileFormat;
  CameraSize mPictureSize;
  CameraPosition mPosition;
  int32_t mRotation;

  CameraPictureOptions();

  explicit inline CameraPictureOptions(const FastDictionaryInitializer& )
    : mPictureSize(FastDictionaryInitializer()),
      mPosition(FastDictionaryInitializer())
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

  explicit inline CameraPictureOptions(const CameraPictureOptions& aOther)
    : mPictureSize(FastDictionaryInitializer()),
      mPosition(FastDictionaryInitializer())
  {
    *this = aOther;
  }

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

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const CameraPictureOptions& aOther);

private:
  static bool
  InitIds(JSContext* cx, CameraPictureOptionsAtoms* atomsCache);
};

namespace binding_detail {
struct FastCameraPictureOptions : public CameraPictureOptions
{
  inline FastCameraPictureOptions()
    : CameraPictureOptions(FastDictionaryInitializer())
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


namespace CameraControlBinding {

  typedef mozilla::nsDOMCameraControl 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);

  bool
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);

  const JSClass*
  GetJSClass();

  bool
  Wrap(JSContext* aCx, mozilla::nsDOMCameraControl* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
  {
    JS::Rooted<JSObject*> reflector(aCx);
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
  }

  void
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);

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

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

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

} // namespace CameraControlBinding



namespace CameraDetectedFaceBinding {

  typedef mozilla::dom::DOMCameraDetectedFace 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);

  bool
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);

  const JSClass*
  GetJSClass();

  bool
  Wrap(JSContext* aCx, mozilla::dom::DOMCameraDetectedFace* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
  {
    JS::Rooted<JSObject*> reflector(aCx);
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
  }

  void
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);

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

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

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

} // namespace CameraDetectedFaceBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_CameraControlBinding_h
