///
/// HybridVideoViewViewManagerSpecSwift.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 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; }

#include <memory>
#include "HybridVideoPlayerSpec.hpp"
#include <optional>
#include "ResizeMode.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();
    }
    void dispose() noexcept override {
      _swiftPart.dispose();
    }

  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 std::optional<std::function<void(bool /* isInPictureInPicture */)>> getOnPictureInPictureChange() noexcept override {
      auto __result = _swiftPart.getOnPictureInPictureChange();
      return __result;
    }
    inline void setOnPictureInPictureChange(const std::optional<std::function<void(bool /* isInPictureInPicture */)>>& onPictureInPictureChange) noexcept override {
      _swiftPart.setOnPictureInPictureChange(onPictureInPictureChange);
    }
    inline std::optional<std::function<void(bool /* fullscreen */)>> getOnFullscreenChange() noexcept override {
      auto __result = _swiftPart.getOnFullscreenChange();
      return __result;
    }
    inline void setOnFullscreenChange(const std::optional<std::function<void(bool /* fullscreen */)>>& onFullscreenChange) noexcept override {
      _swiftPart.setOnFullscreenChange(onFullscreenChange);
    }
    inline std::optional<std::function<void()>> getWillEnterFullscreen() noexcept override {
      auto __result = _swiftPart.getWillEnterFullscreen();
      return __result;
    }
    inline void setWillEnterFullscreen(const std::optional<std::function<void()>>& willEnterFullscreen) noexcept override {
      _swiftPart.setWillEnterFullscreen(willEnterFullscreen);
    }
    inline std::optional<std::function<void()>> getWillExitFullscreen() noexcept override {
      auto __result = _swiftPart.getWillExitFullscreen();
      return __result;
    }
    inline void setWillExitFullscreen(const std::optional<std::function<void()>>& willExitFullscreen) noexcept override {
      _swiftPart.setWillExitFullscreen(willExitFullscreen);
    }
    inline std::optional<std::function<void()>> getWillEnterPictureInPicture() noexcept override {
      auto __result = _swiftPart.getWillEnterPictureInPicture();
      return __result;
    }
    inline void setWillEnterPictureInPicture(const std::optional<std::function<void()>>& willEnterPictureInPicture) noexcept override {
      _swiftPart.setWillEnterPictureInPicture(willEnterPictureInPicture);
    }
    inline std::optional<std::function<void()>> getWillExitPictureInPicture() noexcept override {
      auto __result = _swiftPart.getWillExitPictureInPicture();
      return __result;
    }
    inline void setWillExitPictureInPicture(const std::optional<std::function<void()>>& willExitPictureInPicture) noexcept override {
      _swiftPart.setWillExitPictureInPicture(willExitPictureInPicture);
    }

  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;
    }

  private:
    ReactNativeVideo::HybridVideoViewViewManagerSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::video
