mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-05 05:36:17 +00:00
89 lines
4.3 KiB
C++
Generated
89 lines
4.3 KiB
C++
Generated
///
|
|
/// JHybridOmniViewSpec.cpp
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
#include "JHybridOmniViewSpec.hpp"
|
|
|
|
// Forward declaration of `HybridOmniPlayerSpec` to properly resolve imports.
|
|
namespace margelo::nitro::omni { class HybridOmniPlayerSpec; }
|
|
|
|
#include <memory>
|
|
#include "HybridOmniPlayerSpec.hpp"
|
|
#include "JHybridOmniPlayerSpec.hpp"
|
|
#include <optional>
|
|
|
|
namespace margelo::nitro::omni {
|
|
|
|
std::shared_ptr<JHybridOmniViewSpec> JHybridOmniViewSpec::JavaPart::getJHybridOmniViewSpec() {
|
|
auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
|
|
auto castHybridObject = std::dynamic_pointer_cast<JHybridOmniViewSpec>(hybridObject);
|
|
if (castHybridObject == nullptr) [[unlikely]] {
|
|
throw std::runtime_error("Failed to downcast JHybridObject to JHybridOmniViewSpec!");
|
|
}
|
|
return castHybridObject;
|
|
}
|
|
|
|
jni::local_ref<JHybridOmniViewSpec::CxxPart::jhybriddata> JHybridOmniViewSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
return makeCxxInstance(jThis);
|
|
}
|
|
|
|
std::shared_ptr<JHybridObject> JHybridOmniViewSpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
|
|
auto castJavaPart = jni::dynamic_ref_cast<JHybridOmniViewSpec::JavaPart>(javaPart);
|
|
if (castJavaPart == nullptr) [[unlikely]] {
|
|
throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridOmniViewSpec::JavaPart!");
|
|
}
|
|
return std::make_shared<JHybridOmniViewSpec>(castJavaPart);
|
|
}
|
|
|
|
void JHybridOmniViewSpec::CxxPart::registerNatives() {
|
|
registerHybrid({
|
|
makeNativeMethod("initHybrid", JHybridOmniViewSpec::CxxPart::initHybrid),
|
|
});
|
|
}
|
|
|
|
// Properties
|
|
std::shared_ptr<HybridOmniPlayerSpec> JHybridOmniViewSpec::getPlayer() {
|
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JHybridOmniPlayerSpec::JavaPart>()>("getPlayer");
|
|
auto __result = method(_javaPart);
|
|
return __result->getJHybridOmniPlayerSpec();
|
|
}
|
|
void JHybridOmniViewSpec::setPlayer(const std::shared_ptr<HybridOmniPlayerSpec>& player) {
|
|
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JHybridOmniPlayerSpec::JavaPart> /* player */)>("setPlayer");
|
|
method(_javaPart, std::dynamic_pointer_cast<JHybridOmniPlayerSpec>(player)->getJavaPart());
|
|
}
|
|
std::optional<bool> JHybridOmniViewSpec::getAutoplay() {
|
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getAutoplay");
|
|
auto __result = method(_javaPart);
|
|
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
}
|
|
void JHybridOmniViewSpec::setAutoplay(std::optional<bool> autoplay) {
|
|
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* autoplay */)>("setAutoplay");
|
|
method(_javaPart, autoplay.has_value() ? jni::JBoolean::valueOf(autoplay.value()) : nullptr);
|
|
}
|
|
std::optional<bool> JHybridOmniViewSpec::getShowNotification() {
|
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getShowNotification");
|
|
auto __result = method(_javaPart);
|
|
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
}
|
|
void JHybridOmniViewSpec::setShowNotification(std::optional<bool> showNotification) {
|
|
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* showNotification */)>("setShowNotification");
|
|
method(_javaPart, showNotification.has_value() ? jni::JBoolean::valueOf(showNotification.value()) : nullptr);
|
|
}
|
|
std::optional<bool> JHybridOmniViewSpec::getAutoPip() {
|
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getAutoPip");
|
|
auto __result = method(_javaPart);
|
|
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
}
|
|
void JHybridOmniViewSpec::setAutoPip(std::optional<bool> autoPip) {
|
|
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* autoPip */)>("setAutoPip");
|
|
method(_javaPart, autoPip.has_value() ? jni::JBoolean::valueOf(autoPip.value()) : nullptr);
|
|
}
|
|
|
|
// Methods
|
|
|
|
|
|
} // namespace margelo::nitro::omni
|