/// /// JHybridVideoViewViewManagerSpec.cpp /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © 2025 Marc Rousavy @ Margelo /// #include "JHybridVideoViewViewManagerSpec.hpp" // Forward declaration of `HybridVideoPlayerSpec` to properly resolve imports. namespace margelo::nitro::video { class HybridVideoPlayerSpec; } // Forward declaration of `ResizeMode` to properly resolve imports. namespace margelo::nitro::video { enum class ResizeMode; } // Forward declaration of `SurfaceType` to properly resolve imports. namespace margelo::nitro::video { enum class SurfaceType; } #include #include "HybridVideoPlayerSpec.hpp" #include #include "JHybridVideoPlayerSpec.hpp" #include "ResizeMode.hpp" #include "JResizeMode.hpp" #include "SurfaceType.hpp" #include "JSurfaceType.hpp" #include #include "JFunc_void_bool.hpp" #include "JFunc_void.hpp" namespace margelo::nitro::video { jni::local_ref JHybridVideoViewViewManagerSpec::initHybrid(jni::alias_ref jThis) { return makeCxxInstance(jThis); } void JHybridVideoViewViewManagerSpec::registerNatives() { registerHybrid({ makeNativeMethod("initHybrid", JHybridVideoViewViewManagerSpec::initHybrid), }); } size_t JHybridVideoViewViewManagerSpec::getExternalMemorySize() noexcept { static const auto method = javaClassStatic()->getMethod("getMemorySize"); return method(_javaPart); } void JHybridVideoViewViewManagerSpec::dispose() noexcept { static const auto method = javaClassStatic()->getMethod("dispose"); method(_javaPart); } // Properties std::optional> JHybridVideoViewViewManagerSpec::getPlayer() { static const auto method = javaClassStatic()->getMethod()>("getPlayer"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional(__result->cthis()->shared_cast()) : std::nullopt; } void JHybridVideoViewViewManagerSpec::setPlayer(const std::optional>& player) { static const auto method = javaClassStatic()->getMethod /* player */)>("setPlayer"); method(_javaPart, player.has_value() ? std::dynamic_pointer_cast(player.value())->getJavaPart() : nullptr); } bool JHybridVideoViewViewManagerSpec::getControls() { static const auto method = javaClassStatic()->getMethod("getControls"); auto __result = method(_javaPart); return static_cast(__result); } void JHybridVideoViewViewManagerSpec::setControls(bool controls) { static const auto method = javaClassStatic()->getMethod("setControls"); method(_javaPart, controls); } bool JHybridVideoViewViewManagerSpec::getPictureInPicture() { static const auto method = javaClassStatic()->getMethod("getPictureInPicture"); auto __result = method(_javaPart); return static_cast(__result); } void JHybridVideoViewViewManagerSpec::setPictureInPicture(bool pictureInPicture) { static const auto method = javaClassStatic()->getMethod("setPictureInPicture"); method(_javaPart, pictureInPicture); } bool JHybridVideoViewViewManagerSpec::getAutoEnterPictureInPicture() { static const auto method = javaClassStatic()->getMethod("getAutoEnterPictureInPicture"); auto __result = method(_javaPart); return static_cast(__result); } void JHybridVideoViewViewManagerSpec::setAutoEnterPictureInPicture(bool autoEnterPictureInPicture) { static const auto method = javaClassStatic()->getMethod("setAutoEnterPictureInPicture"); method(_javaPart, autoEnterPictureInPicture); } ResizeMode JHybridVideoViewViewManagerSpec::getResizeMode() { static const auto method = javaClassStatic()->getMethod()>("getResizeMode"); auto __result = method(_javaPart); return __result->toCpp(); } void JHybridVideoViewViewManagerSpec::setResizeMode(ResizeMode resizeMode) { static const auto method = javaClassStatic()->getMethod /* resizeMode */)>("setResizeMode"); method(_javaPart, JResizeMode::fromCpp(resizeMode)); } bool JHybridVideoViewViewManagerSpec::getKeepScreenAwake() { static const auto method = javaClassStatic()->getMethod("getKeepScreenAwake"); auto __result = method(_javaPart); return static_cast(__result); } void JHybridVideoViewViewManagerSpec::setKeepScreenAwake(bool keepScreenAwake) { static const auto method = javaClassStatic()->getMethod("setKeepScreenAwake"); method(_javaPart, keepScreenAwake); } SurfaceType JHybridVideoViewViewManagerSpec::getSurfaceType() { static const auto method = javaClassStatic()->getMethod()>("getSurfaceType"); auto __result = method(_javaPart); return __result->toCpp(); } void JHybridVideoViewViewManagerSpec::setSurfaceType(SurfaceType surfaceType) { static const auto method = javaClassStatic()->getMethod /* surfaceType */)>("setSurfaceType"); method(_javaPart, JSurfaceType::fromCpp(surfaceType)); } std::optional> JHybridVideoViewViewManagerSpec::getOnPictureInPictureChange() { static const auto method = javaClassStatic()->getMethod()>("getOnPictureInPictureChange_cxx"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional([&]() -> std::function { if (__result->isInstanceOf(JFunc_void_bool_cxx::javaClassStatic())) [[likely]] { auto downcast = jni::static_ref_cast(__result); return downcast->cthis()->getFunction(); } else { auto __resultRef = jni::make_global(__result); return [__resultRef](bool isInPictureInPicture) -> void { return __resultRef->invoke(isInPictureInPicture); }; } }()) : std::nullopt; } void JHybridVideoViewViewManagerSpec::setOnPictureInPictureChange(const std::optional>& onPictureInPictureChange) { static const auto method = javaClassStatic()->getMethod /* onPictureInPictureChange */)>("setOnPictureInPictureChange_cxx"); method(_javaPart, onPictureInPictureChange.has_value() ? JFunc_void_bool_cxx::fromCpp(onPictureInPictureChange.value()) : nullptr); } std::optional> JHybridVideoViewViewManagerSpec::getOnFullscreenChange() { static const auto method = javaClassStatic()->getMethod()>("getOnFullscreenChange_cxx"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional([&]() -> std::function { if (__result->isInstanceOf(JFunc_void_bool_cxx::javaClassStatic())) [[likely]] { auto downcast = jni::static_ref_cast(__result); return downcast->cthis()->getFunction(); } else { auto __resultRef = jni::make_global(__result); return [__resultRef](bool fullscreen) -> void { return __resultRef->invoke(fullscreen); }; } }()) : std::nullopt; } void JHybridVideoViewViewManagerSpec::setOnFullscreenChange(const std::optional>& onFullscreenChange) { static const auto method = javaClassStatic()->getMethod /* onFullscreenChange */)>("setOnFullscreenChange_cxx"); method(_javaPart, onFullscreenChange.has_value() ? JFunc_void_bool_cxx::fromCpp(onFullscreenChange.value()) : nullptr); } std::optional> JHybridVideoViewViewManagerSpec::getWillEnterFullscreen() { static const auto method = javaClassStatic()->getMethod()>("getWillEnterFullscreen_cxx"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional([&]() -> std::function { if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] { auto downcast = jni::static_ref_cast(__result); return downcast->cthis()->getFunction(); } else { auto __resultRef = jni::make_global(__result); return [__resultRef]() -> void { return __resultRef->invoke(); }; } }()) : std::nullopt; } void JHybridVideoViewViewManagerSpec::setWillEnterFullscreen(const std::optional>& willEnterFullscreen) { static const auto method = javaClassStatic()->getMethod /* willEnterFullscreen */)>("setWillEnterFullscreen_cxx"); method(_javaPart, willEnterFullscreen.has_value() ? JFunc_void_cxx::fromCpp(willEnterFullscreen.value()) : nullptr); } std::optional> JHybridVideoViewViewManagerSpec::getWillExitFullscreen() { static const auto method = javaClassStatic()->getMethod()>("getWillExitFullscreen_cxx"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional([&]() -> std::function { if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] { auto downcast = jni::static_ref_cast(__result); return downcast->cthis()->getFunction(); } else { auto __resultRef = jni::make_global(__result); return [__resultRef]() -> void { return __resultRef->invoke(); }; } }()) : std::nullopt; } void JHybridVideoViewViewManagerSpec::setWillExitFullscreen(const std::optional>& willExitFullscreen) { static const auto method = javaClassStatic()->getMethod /* willExitFullscreen */)>("setWillExitFullscreen_cxx"); method(_javaPart, willExitFullscreen.has_value() ? JFunc_void_cxx::fromCpp(willExitFullscreen.value()) : nullptr); } std::optional> JHybridVideoViewViewManagerSpec::getWillEnterPictureInPicture() { static const auto method = javaClassStatic()->getMethod()>("getWillEnterPictureInPicture_cxx"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional([&]() -> std::function { if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] { auto downcast = jni::static_ref_cast(__result); return downcast->cthis()->getFunction(); } else { auto __resultRef = jni::make_global(__result); return [__resultRef]() -> void { return __resultRef->invoke(); }; } }()) : std::nullopt; } void JHybridVideoViewViewManagerSpec::setWillEnterPictureInPicture(const std::optional>& willEnterPictureInPicture) { static const auto method = javaClassStatic()->getMethod /* willEnterPictureInPicture */)>("setWillEnterPictureInPicture_cxx"); method(_javaPart, willEnterPictureInPicture.has_value() ? JFunc_void_cxx::fromCpp(willEnterPictureInPicture.value()) : nullptr); } std::optional> JHybridVideoViewViewManagerSpec::getWillExitPictureInPicture() { static const auto method = javaClassStatic()->getMethod()>("getWillExitPictureInPicture_cxx"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional([&]() -> std::function { if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] { auto downcast = jni::static_ref_cast(__result); return downcast->cthis()->getFunction(); } else { auto __resultRef = jni::make_global(__result); return [__resultRef]() -> void { return __resultRef->invoke(); }; } }()) : std::nullopt; } void JHybridVideoViewViewManagerSpec::setWillExitPictureInPicture(const std::optional>& willExitPictureInPicture) { static const auto method = javaClassStatic()->getMethod /* willExitPictureInPicture */)>("setWillExitPictureInPicture_cxx"); method(_javaPart, willExitPictureInPicture.has_value() ? JFunc_void_cxx::fromCpp(willExitPictureInPicture.value()) : nullptr); } // Methods void JHybridVideoViewViewManagerSpec::enterFullscreen() { static const auto method = javaClassStatic()->getMethod("enterFullscreen"); method(_javaPart); } void JHybridVideoViewViewManagerSpec::exitFullscreen() { static const auto method = javaClassStatic()->getMethod("exitFullscreen"); method(_javaPart); } void JHybridVideoViewViewManagerSpec::enterPictureInPicture() { static const auto method = javaClassStatic()->getMethod("enterPictureInPicture"); method(_javaPart); } void JHybridVideoViewViewManagerSpec::exitPictureInPicture() { static const auto method = javaClassStatic()->getMethod("exitPictureInPicture"); method(_javaPart); } bool JHybridVideoViewViewManagerSpec::canEnterPictureInPicture() { static const auto method = javaClassStatic()->getMethod("canEnterPictureInPicture"); auto __result = method(_javaPart); return static_cast(__result); } } // namespace margelo::nitro::video