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

#ifndef mozilla_dom_KeyAlgorithmBinding_h
#define mozilla_dom_KeyAlgorithmBinding_h

#include "KeyAlgorithmBinding.h"
#include "js/RootingAPI.h"
#include "jspubtd.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/TypedArray.h"

namespace mozilla {
namespace dom {

struct AesKeyAlgorithmAtoms;
struct EcKeyAlgorithmAtoms;
struct HmacKeyAlgorithmAtoms;
struct KeyAlgorithm;
struct KeyAlgorithmAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
struct RsaHashedKeyAlgorithmAtoms;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

struct KeyAlgorithm : public DictionaryBase
{
  nsString mName;

  KeyAlgorithm();

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

protected:
  explicit inline KeyAlgorithm(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

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

public:
  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 KeyAlgorithm& aOther);
};

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


struct AesKeyAlgorithm : public KeyAlgorithm
{
  uint16_t mLength;

  AesKeyAlgorithm();

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

protected:
  explicit inline AesKeyAlgorithm(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

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

public:
  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 AesKeyAlgorithm& aOther);
};

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


struct EcKeyAlgorithm : public KeyAlgorithm
{
  nsString mNamedCurve;

  EcKeyAlgorithm();

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

protected:
  explicit inline EcKeyAlgorithm(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

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

public:
  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 EcKeyAlgorithm& aOther);
};

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


struct HmacKeyAlgorithm : public KeyAlgorithm
{
  KeyAlgorithm mHash;
  uint32_t mLength;

  HmacKeyAlgorithm();

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

protected:
  explicit inline HmacKeyAlgorithm(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

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

public:
  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 HmacKeyAlgorithm& aOther);
};

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


struct RsaHashedKeyAlgorithm : public KeyAlgorithm
{
  KeyAlgorithm mHash;
  uint16_t mModulusLength;
  Uint8Array mPublicExponent;

  RsaHashedKeyAlgorithm();

protected:
  explicit inline RsaHashedKeyAlgorithm(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

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

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

public:
  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);
};

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


} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_KeyAlgorithmBinding_h
