///
/// HybridPluginManagerSpec.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 "HybridPluginManagerSpec.hpp"




namespace margelo::nitro::videodrm {

  using namespace facebook;

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

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

  public:
    ~JHybridPluginManagerSpec() 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<JHybridPluginManagerSpec::javaobject>& getJavaPart() const noexcept {
      return _javaPart;
    }

  public:
    // Properties
    bool getIsEnabled() override;

  public:
    // Methods
    void enable() override;
    void disable() override;

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

} // namespace margelo::nitro::videodrm
