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

#ifndef mozilla_dom_KeyframeBinding_h
#define mozilla_dom_KeyframeBinding_h

#include "KeyframeBinding.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 ComputedKeyframeAtoms;
struct KeyframeAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

enum class CompositeOperation : uint32_t {
  Replace,
  Add,
  Accumulate,
  EndGuard_
};

namespace CompositeOperationValues {
extern const EnumEntry strings[4];
} // namespace CompositeOperationValues

bool
ToJSValue(JSContext* aCx, CompositeOperation aArgument, JS::MutableHandle<JS::Value> aValue);


struct Keyframe : public DictionaryBase
{
  Nullable<CompositeOperation> mComposite;
  nsString mEasing;
  Nullable<double> mOffset;

  Keyframe();

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

  explicit inline Keyframe(const Keyframe& 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 Keyframe& aOther);

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

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


struct ComputedKeyframe : public Keyframe
{
  Optional<double> mComputedOffset;

  ComputedKeyframe();

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

  explicit inline ComputedKeyframe(const ComputedKeyframe& 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 ComputedKeyframe& aOther);

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

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


} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_KeyframeBinding_h
