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

#ifndef mozilla_dom_IterableIteratorBinding_h
#define mozilla_dom_IterableIteratorBinding_h

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

namespace mozilla {
namespace dom {

struct IterableKeyAndValueResultAtoms;
struct IterableKeyOrValueResultAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

struct IterableKeyAndValueResult : public DictionaryBase
{
  MOZ_INIT_OUTSIDE_CTOR bool mDone;
  MOZ_INIT_OUTSIDE_CTOR Sequence<JS::Value> mValue;

  IterableKeyAndValueResult();

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

private:
  IterableKeyAndValueResult(const IterableKeyAndValueResult&) = delete;
  void operator=(const IterableKeyAndValueResult&) = delete;

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

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

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

  void
  TraceDictionary(JSTracer* trc);
};

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


struct IterableKeyOrValueResult : public DictionaryBase
{
  MOZ_INIT_OUTSIDE_CTOR bool mDone;
  MOZ_INIT_OUTSIDE_CTOR JS::Value mValue;

  IterableKeyOrValueResult();

  explicit inline IterableKeyOrValueResult(const FastDictionaryInitializer& )
    : mValue(JS::UndefinedValue())
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  IterableKeyOrValueResult(const IterableKeyOrValueResult&) = delete;
  void operator=(const IterableKeyOrValueResult&) = delete;

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

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

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

  void
  TraceDictionary(JSTracer* trc);
};

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


} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_IterableIteratorBinding_h
