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

#include "JHybridNativePlatformSpec.hpp"

// Forward declaration of `Insets` to properly resolve imports.
namespace margelo::nitro::unistyles { struct Insets; }
// Forward declaration of `ColorScheme` to properly resolve imports.
namespace margelo::nitro::unistyles { enum class ColorScheme; }
// Forward declaration of `Orientation` to properly resolve imports.
namespace margelo::nitro::unistyles { enum class Orientation; }
// Forward declaration of `Dimensions` to properly resolve imports.
namespace margelo::nitro::unistyles { struct Dimensions; }
// Forward declaration of `UnistylesNativeMiniRuntime` to properly resolve imports.
namespace margelo::nitro::unistyles { struct UnistylesNativeMiniRuntime; }
// Forward declaration of `UnistyleDependency` to properly resolve imports.
namespace margelo::nitro::unistyles { enum class UnistyleDependency; }

#include "Insets.hpp"
#include "JInsets.hpp"
#include "ColorScheme.hpp"
#include "JColorScheme.hpp"
#include "Orientation.hpp"
#include "JOrientation.hpp"
#include <string>
#include "Dimensions.hpp"
#include "JDimensions.hpp"
#include "UnistylesNativeMiniRuntime.hpp"
#include "JUnistylesNativeMiniRuntime.hpp"
#include "UnistyleDependency.hpp"
#include <vector>
#include <functional>
#include "JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp"
#include "JUnistyleDependency.hpp"
#include "JFunc_void_UnistylesNativeMiniRuntime.hpp"

namespace margelo::nitro::unistyles {

  jni::local_ref<JHybridNativePlatformSpec::jhybriddata> JHybridNativePlatformSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
    return makeCxxInstance(jThis);
  }

  void JHybridNativePlatformSpec::registerNatives() {
    registerHybrid({
      makeNativeMethod("initHybrid", JHybridNativePlatformSpec::initHybrid),
    });
  }

  size_t JHybridNativePlatformSpec::getExternalMemorySize() noexcept {
    static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
    return method(_javaPart);
  }

  void JHybridNativePlatformSpec::dispose() noexcept {
    static const auto method = javaClassStatic()->getMethod<void()>("dispose");
    method(_javaPart);
  }

  // Properties
  

  // Methods
  Insets JHybridNativePlatformSpec::getInsets() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JInsets>()>("getInsets");
    auto __result = method(_javaPart);
    return __result->toCpp();
  }
  ColorScheme JHybridNativePlatformSpec::getColorScheme() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JColorScheme>()>("getColorScheme");
    auto __result = method(_javaPart);
    return __result->toCpp();
  }
  double JHybridNativePlatformSpec::getFontScale() {
    static const auto method = javaClassStatic()->getMethod<double()>("getFontScale");
    auto __result = method(_javaPart);
    return __result;
  }
  double JHybridNativePlatformSpec::getPixelRatio() {
    static const auto method = javaClassStatic()->getMethod<double()>("getPixelRatio");
    auto __result = method(_javaPart);
    return __result;
  }
  Orientation JHybridNativePlatformSpec::getOrientation() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JOrientation>()>("getOrientation");
    auto __result = method(_javaPart);
    return __result->toCpp();
  }
  std::string JHybridNativePlatformSpec::getContentSizeCategory() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getContentSizeCategory");
    auto __result = method(_javaPart);
    return __result->toStdString();
  }
  Dimensions JHybridNativePlatformSpec::getScreenDimensions() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JDimensions>()>("getScreenDimensions");
    auto __result = method(_javaPart);
    return __result->toCpp();
  }
  Dimensions JHybridNativePlatformSpec::getStatusBarDimensions() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JDimensions>()>("getStatusBarDimensions");
    auto __result = method(_javaPart);
    return __result->toCpp();
  }
  Dimensions JHybridNativePlatformSpec::getNavigationBarDimensions() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JDimensions>()>("getNavigationBarDimensions");
    auto __result = method(_javaPart);
    return __result->toCpp();
  }
  bool JHybridNativePlatformSpec::getPrefersRtlDirection() {
    static const auto method = javaClassStatic()->getMethod<jboolean()>("getPrefersRtlDirection");
    auto __result = method(_javaPart);
    return static_cast<bool>(__result);
  }
  void JHybridNativePlatformSpec::setRootViewBackgroundColor(double color) {
    static const auto method = javaClassStatic()->getMethod<void(double /* color */)>("setRootViewBackgroundColor");
    method(_javaPart, color);
  }
  void JHybridNativePlatformSpec::setNavigationBarHidden(bool isHidden) {
    static const auto method = javaClassStatic()->getMethod<void(jboolean /* isHidden */)>("setNavigationBarHidden");
    method(_javaPart, isHidden);
  }
  void JHybridNativePlatformSpec::setStatusBarHidden(bool isHidden) {
    static const auto method = javaClassStatic()->getMethod<void(jboolean /* isHidden */)>("setStatusBarHidden");
    method(_javaPart, isHidden);
  }
  void JHybridNativePlatformSpec::setImmersiveMode(bool isEnabled) {
    static const auto method = javaClassStatic()->getMethod<void(jboolean /* isEnabled */)>("setImmersiveMode");
    method(_javaPart, isEnabled);
  }
  UnistylesNativeMiniRuntime JHybridNativePlatformSpec::getMiniRuntime() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JUnistylesNativeMiniRuntime>()>("getMiniRuntime");
    auto __result = method(_javaPart);
    return __result->toCpp();
  }
  void JHybridNativePlatformSpec::registerPlatformListener(const std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>& callback) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime::javaobject> /* callback */)>("registerPlatformListener_cxx");
    method(_javaPart, JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_cxx::fromCpp(callback));
  }
  void JHybridNativePlatformSpec::registerImeListener(const std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>& callback) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_UnistylesNativeMiniRuntime::javaobject> /* callback */)>("registerImeListener_cxx");
    method(_javaPart, JFunc_void_UnistylesNativeMiniRuntime_cxx::fromCpp(callback));
  }
  void JHybridNativePlatformSpec::unregisterPlatformListeners() {
    static const auto method = javaClassStatic()->getMethod<void()>("unregisterPlatformListeners");
    method(_javaPart);
  }

} // namespace margelo::nitro::unistyles
