mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-16 02:44:51 +00:00
Create types for player & view
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
///
|
||||
/// 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"
|
||||
|
||||
|
||||
|
||||
#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::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
|
||||
Reference in New Issue
Block a user