Files
react-native-video/nitrogen/generated/ios/c++/HybridVideoViewViewManagerSpecSwift.hpp
2026-03-25 17:28:35 +01:00

218 lines
8.6 KiB
C++
Generated

///
/// HybridVideoViewViewManagerSpecSwift.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///
#pragma once
#include "HybridVideoViewViewManagerSpec.hpp"
// Forward declaration of `HybridVideoViewViewManagerSpec_cxx` to properly resolve imports.
namespace ReactNativeVideo { class HybridVideoViewViewManagerSpec_cxx; }
// 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; }
// Forward declaration of `ListenerSubscription` to properly resolve imports.
namespace margelo::nitro::video { struct ListenerSubscription; }
#include <memory>
#include "HybridVideoPlayerSpec.hpp"
#include <optional>
#include "ResizeMode.hpp"
#include "SurfaceType.hpp"
#include "ListenerSubscription.hpp"
#include <functional>
#include "ReactNativeVideo-Swift-Cxx-Umbrella.hpp"
namespace margelo::nitro::video {
/**
* The C++ part of HybridVideoViewViewManagerSpec_cxx.swift.
*
* HybridVideoViewViewManagerSpecSwift (C++) accesses HybridVideoViewViewManagerSpec_cxx (Swift), and might
* contain some additional bridging code for C++ <> Swift interop.
*
* Since this obviously introduces an overhead, I hope at some point in
* the future, HybridVideoViewViewManagerSpec_cxx can directly inherit from the C++ class HybridVideoViewViewManagerSpec
* to simplify the whole structure and memory management.
*/
class HybridVideoViewViewManagerSpecSwift: public virtual HybridVideoViewViewManagerSpec {
public:
// Constructor from a Swift instance
explicit HybridVideoViewViewManagerSpecSwift(const ReactNativeVideo::HybridVideoViewViewManagerSpec_cxx& swiftPart):
HybridObject(HybridVideoViewViewManagerSpec::TAG),
_swiftPart(swiftPart) { }
public:
// Get the Swift part
inline ReactNativeVideo::HybridVideoViewViewManagerSpec_cxx& getSwiftPart() noexcept {
return _swiftPart;
}
public:
inline size_t getExternalMemorySize() noexcept override {
return _swiftPart.getMemorySize();
}
bool equals(const std::shared_ptr<HybridObject>& other) override {
if (auto otherCast = std::dynamic_pointer_cast<HybridVideoViewViewManagerSpecSwift>(other)) {
return _swiftPart.equals(otherCast->_swiftPart);
}
return false;
}
void dispose() noexcept override {
_swiftPart.dispose();
}
std::string toString() override {
return _swiftPart.toString();
}
public:
// Properties
inline std::optional<std::shared_ptr<HybridVideoPlayerSpec>> getPlayer() noexcept override {
auto __result = _swiftPart.getPlayer();
return __result;
}
inline void setPlayer(const std::optional<std::shared_ptr<HybridVideoPlayerSpec>>& player) noexcept override {
_swiftPart.setPlayer(player);
}
inline bool getControls() noexcept override {
return _swiftPart.getControls();
}
inline void setControls(bool controls) noexcept override {
_swiftPart.setControls(std::forward<decltype(controls)>(controls));
}
inline bool getPictureInPicture() noexcept override {
return _swiftPart.getPictureInPicture();
}
inline void setPictureInPicture(bool pictureInPicture) noexcept override {
_swiftPart.setPictureInPicture(std::forward<decltype(pictureInPicture)>(pictureInPicture));
}
inline bool getAutoEnterPictureInPicture() noexcept override {
return _swiftPart.getAutoEnterPictureInPicture();
}
inline void setAutoEnterPictureInPicture(bool autoEnterPictureInPicture) noexcept override {
_swiftPart.setAutoEnterPictureInPicture(std::forward<decltype(autoEnterPictureInPicture)>(autoEnterPictureInPicture));
}
inline ResizeMode getResizeMode() noexcept override {
auto __result = _swiftPart.getResizeMode();
return static_cast<ResizeMode>(__result);
}
inline void setResizeMode(ResizeMode resizeMode) noexcept override {
_swiftPart.setResizeMode(static_cast<int>(resizeMode));
}
inline bool getKeepScreenAwake() noexcept override {
return _swiftPart.getKeepScreenAwake();
}
inline void setKeepScreenAwake(bool keepScreenAwake) noexcept override {
_swiftPart.setKeepScreenAwake(std::forward<decltype(keepScreenAwake)>(keepScreenAwake));
}
inline SurfaceType getSurfaceType() noexcept override {
auto __result = _swiftPart.getSurfaceType();
return static_cast<SurfaceType>(__result);
}
inline void setSurfaceType(SurfaceType surfaceType) noexcept override {
_swiftPart.setSurfaceType(static_cast<int>(surfaceType));
}
public:
// Methods
inline void enterFullscreen() override {
auto __result = _swiftPart.enterFullscreen();
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
}
inline void exitFullscreen() override {
auto __result = _swiftPart.exitFullscreen();
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
}
inline void enterPictureInPicture() override {
auto __result = _swiftPart.enterPictureInPicture();
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
}
inline void exitPictureInPicture() override {
auto __result = _swiftPart.exitPictureInPicture();
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
}
inline bool canEnterPictureInPicture() override {
auto __result = _swiftPart.canEnterPictureInPicture();
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnPictureInPictureChangeListener(const std::function<void(bool /* isInPictureInPicture */)>& listener) override {
auto __result = _swiftPart.addOnPictureInPictureChangeListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnFullscreenChangeListener(const std::function<void(bool /* fullscreen */)>& listener) override {
auto __result = _swiftPart.addOnFullscreenChangeListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addWillEnterFullscreenListener(const std::function<void()>& listener) override {
auto __result = _swiftPart.addWillEnterFullscreenListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addWillExitFullscreenListener(const std::function<void()>& listener) override {
auto __result = _swiftPart.addWillExitFullscreenListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addWillEnterPictureInPictureListener(const std::function<void()>& listener) override {
auto __result = _swiftPart.addWillEnterPictureInPictureListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addWillExitPictureInPictureListener(const std::function<void()>& listener) override {
auto __result = _swiftPart.addWillExitPictureInPictureListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline void clearAllListeners() override {
auto __result = _swiftPart.clearAllListeners();
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
}
private:
ReactNativeVideo::HybridVideoViewViewManagerSpec_cxx _swiftPart;
};
} // namespace margelo::nitro::video