///
/// HybridVideoViewViewManagerSpec.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///

#pragma once

#include <NitroModules/JHybridObject.hpp>
#include <fbjni/fbjni.h>
#include "HybridVideoViewViewManagerSpec.hpp"




namespace margelo::nitro::video {

  using namespace facebook;

  class JHybridVideoViewViewManagerSpec: public jni::HybridClass<JHybridVideoViewViewManagerSpec, JHybridObject>,
                                         public virtual HybridVideoViewViewManagerSpec {
  public:
    static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/video/HybridVideoViewViewManagerSpec;";
    static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
    static void registerNatives();

  protected:
    // C++ constructor (called from Java via `initHybrid()`)
    explicit JHybridVideoViewViewManagerSpec(jni::alias_ref<jhybridobject> jThis) :
      HybridObject(HybridVideoViewViewManagerSpec::TAG),
      HybridBase(jThis),
      _javaPart(jni::make_global(jThis)) {}

  public:
    ~JHybridVideoViewViewManagerSpec() override {
      // Hermes GC can destroy JS objects on a non-JNI Thread.
      jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
    }

  public:
    size_t getExternalMemorySize() noexcept override;
    void dispose() noexcept override;

  public:
    inline const jni::global_ref<JHybridVideoViewViewManagerSpec::javaobject>& getJavaPart() const noexcept {
      return _javaPart;
    }

  public:
    // Properties
    std::optional<std::shared_ptr<HybridVideoPlayerSpec>> getPlayer() override;
    void setPlayer(const std::optional<std::shared_ptr<HybridVideoPlayerSpec>>& player) override;
    bool getControls() override;
    void setControls(bool controls) override;
    bool getPictureInPicture() override;
    void setPictureInPicture(bool pictureInPicture) override;
    bool getAutoEnterPictureInPicture() override;
    void setAutoEnterPictureInPicture(bool autoEnterPictureInPicture) override;
    ResizeMode getResizeMode() override;
    void setResizeMode(ResizeMode resizeMode) override;
    bool getKeepScreenAwake() override;
    void setKeepScreenAwake(bool keepScreenAwake) override;
    std::optional<std::function<void(bool /* isInPictureInPicture */)>> getOnPictureInPictureChange() override;
    void setOnPictureInPictureChange(const std::optional<std::function<void(bool /* isInPictureInPicture */)>>& onPictureInPictureChange) override;
    std::optional<std::function<void(bool /* fullscreen */)>> getOnFullscreenChange() override;
    void setOnFullscreenChange(const std::optional<std::function<void(bool /* fullscreen */)>>& onFullscreenChange) override;
    std::optional<std::function<void()>> getWillEnterFullscreen() override;
    void setWillEnterFullscreen(const std::optional<std::function<void()>>& willEnterFullscreen) override;
    std::optional<std::function<void()>> getWillExitFullscreen() override;
    void setWillExitFullscreen(const std::optional<std::function<void()>>& willExitFullscreen) override;
    std::optional<std::function<void()>> getWillEnterPictureInPicture() override;
    void setWillEnterPictureInPicture(const std::optional<std::function<void()>>& willEnterPictureInPicture) override;
    std::optional<std::function<void()>> getWillExitPictureInPicture() override;
    void setWillExitPictureInPicture(const std::optional<std::function<void()>>& willExitPictureInPicture) override;

  public:
    // Methods
    void enterFullscreen() override;
    void exitFullscreen() override;
    void enterPictureInPicture() override;
    void exitPictureInPicture() override;
    bool canEnterPictureInPicture() override;

  private:
    friend HybridBase;
    using HybridBase::HybridBase;
    jni::global_ref<JHybridVideoViewViewManagerSpec::javaobject> _javaPart;
  };

} // namespace margelo::nitro::video
