/// /// 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 #include "HybridVideoPlayerSpec.hpp" #include #include "ResizeMode.hpp" #include "SurfaceType.hpp" #include "ListenerSubscription.hpp" #include #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& other) override { if (auto otherCast = std::dynamic_pointer_cast(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> getPlayer() noexcept override { auto __result = _swiftPart.getPlayer(); return __result; } inline void setPlayer(const std::optional>& 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(controls)); } inline bool getPictureInPicture() noexcept override { return _swiftPart.getPictureInPicture(); } inline void setPictureInPicture(bool pictureInPicture) noexcept override { _swiftPart.setPictureInPicture(std::forward(pictureInPicture)); } inline bool getAutoEnterPictureInPicture() noexcept override { return _swiftPart.getAutoEnterPictureInPicture(); } inline void setAutoEnterPictureInPicture(bool autoEnterPictureInPicture) noexcept override { _swiftPart.setAutoEnterPictureInPicture(std::forward(autoEnterPictureInPicture)); } inline ResizeMode getResizeMode() noexcept override { auto __result = _swiftPart.getResizeMode(); return static_cast(__result); } inline void setResizeMode(ResizeMode resizeMode) noexcept override { _swiftPart.setResizeMode(static_cast(resizeMode)); } inline bool getKeepScreenAwake() noexcept override { return _swiftPart.getKeepScreenAwake(); } inline void setKeepScreenAwake(bool keepScreenAwake) noexcept override { _swiftPart.setKeepScreenAwake(std::forward(keepScreenAwake)); } inline SurfaceType getSurfaceType() noexcept override { auto __result = _swiftPart.getSurfaceType(); return static_cast(__result); } inline void setSurfaceType(SurfaceType surfaceType) noexcept override { _swiftPart.setSurfaceType(static_cast(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& 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& 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& 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& 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& 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& 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