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

#include "JHybridNitroOrientationSpec.hpp"



#include <string>
#include <functional>
#include "JFunc_void_std__string.hpp"

namespace margelo::nitro::orientation {

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

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

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

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

  // Properties
  

  // Methods
  std::string JHybridNitroOrientationSpec::getOrientation() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getOrientation");
    auto __result = method(_javaPart);
    return __result->toStdString();
  }
  std::string JHybridNitroOrientationSpec::getDeviceOrientation() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getDeviceOrientation");
    auto __result = method(_javaPart);
    return __result->toStdString();
  }
  void JHybridNitroOrientationSpec::lockToPortrait() {
    static const auto method = javaClassStatic()->getMethod<void()>("lockToPortrait");
    method(_javaPart);
  }
  void JHybridNitroOrientationSpec::lockToPortraitUpsideDown() {
    static const auto method = javaClassStatic()->getMethod<void()>("lockToPortraitUpsideDown");
    method(_javaPart);
  }
  void JHybridNitroOrientationSpec::lockToLandscape() {
    static const auto method = javaClassStatic()->getMethod<void()>("lockToLandscape");
    method(_javaPart);
  }
  void JHybridNitroOrientationSpec::lockToLandscapeLeft() {
    static const auto method = javaClassStatic()->getMethod<void()>("lockToLandscapeLeft");
    method(_javaPart);
  }
  void JHybridNitroOrientationSpec::lockToLandscapeRight() {
    static const auto method = javaClassStatic()->getMethod<void()>("lockToLandscapeRight");
    method(_javaPart);
  }
  void JHybridNitroOrientationSpec::unlockAllOrientations() {
    static const auto method = javaClassStatic()->getMethod<void()>("unlockAllOrientations");
    method(_javaPart);
  }
  bool JHybridNitroOrientationSpec::getAutoRotateState() {
    static const auto method = javaClassStatic()->getMethod<jboolean()>("getAutoRotateState");
    auto __result = method(_javaPart);
    return static_cast<bool>(__result);
  }
  void JHybridNitroOrientationSpec::setChangeListener(const std::function<void(const std::string& /* orientation */)>& listener) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__string::javaobject> /* listener */)>("setChangeListener_cxx");
    method(_javaPart, JFunc_void_std__string_cxx::fromCpp(listener));
  }

} // namespace margelo::nitro::orientation
