///
/// HybridVideoPlayerSourceFactorySpecSwift.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 "HybridVideoPlayerSourceFactorySpec.hpp"

// Forward declaration of `HybridVideoPlayerSourceFactorySpec_cxx` to properly resolve imports.
namespace ReactNativeVideo { class HybridVideoPlayerSourceFactorySpec_cxx; }

// Forward declaration of `HybridVideoPlayerSourceSpec` to properly resolve imports.
namespace margelo::nitro::video { class HybridVideoPlayerSourceSpec; }
// Forward declaration of `NativeVideoConfig` to properly resolve imports.
namespace margelo::nitro::video { struct NativeVideoConfig; }
// Forward declaration of `NativeExternalSubtitle` to properly resolve imports.
namespace margelo::nitro::video { struct NativeExternalSubtitle; }
// Forward declaration of `SubtitleType` to properly resolve imports.
namespace margelo::nitro::video { enum class SubtitleType; }
// Forward declaration of `NativeDrmParams` to properly resolve imports.
namespace margelo::nitro::video { struct NativeDrmParams; }
// Forward declaration of `OnGetLicensePayload` to properly resolve imports.
namespace margelo::nitro::video { struct OnGetLicensePayload; }
// Forward declaration of `BufferConfig` to properly resolve imports.
namespace margelo::nitro::video { struct BufferConfig; }
// Forward declaration of `LivePlaybackParams` to properly resolve imports.
namespace margelo::nitro::video { struct LivePlaybackParams; }
// Forward declaration of `Resolution` to properly resolve imports.
namespace margelo::nitro::video { struct Resolution; }

#include <memory>
#include "HybridVideoPlayerSourceSpec.hpp"
#include <string>
#include "NativeVideoConfig.hpp"
#include "NativeExternalSubtitle.hpp"
#include <vector>
#include <optional>
#include "SubtitleType.hpp"
#include "NativeDrmParams.hpp"
#include <unordered_map>
#include <NitroModules/Promise.hpp>
#include "OnGetLicensePayload.hpp"
#include <functional>
#include "BufferConfig.hpp"
#include "LivePlaybackParams.hpp"
#include "Resolution.hpp"

#include "ReactNativeVideo-Swift-Cxx-Umbrella.hpp"

namespace margelo::nitro::video {

  /**
   * The C++ part of HybridVideoPlayerSourceFactorySpec_cxx.swift.
   *
   * HybridVideoPlayerSourceFactorySpecSwift (C++) accesses HybridVideoPlayerSourceFactorySpec_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, HybridVideoPlayerSourceFactorySpec_cxx can directly inherit from the C++ class HybridVideoPlayerSourceFactorySpec
   * to simplify the whole structure and memory management.
   */
  class HybridVideoPlayerSourceFactorySpecSwift: public virtual HybridVideoPlayerSourceFactorySpec {
  public:
    // Constructor from a Swift instance
    explicit HybridVideoPlayerSourceFactorySpecSwift(const ReactNativeVideo::HybridVideoPlayerSourceFactorySpec_cxx& swiftPart):
      HybridObject(HybridVideoPlayerSourceFactorySpec::TAG),
      _swiftPart(swiftPart) { }

  public:
    // Get the Swift part
    inline ReactNativeVideo::HybridVideoPlayerSourceFactorySpec_cxx& getSwiftPart() noexcept {
      return _swiftPart;
    }

  public:
    inline size_t getExternalMemorySize() noexcept override {
      return _swiftPart.getMemorySize();
    }
    void dispose() noexcept override {
      _swiftPart.dispose();
    }

  public:
    // Properties
    

  public:
    // Methods
    inline std::shared_ptr<HybridVideoPlayerSourceSpec> fromUri(const std::string& uri) override {
      auto __result = _swiftPart.fromUri(uri);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<HybridVideoPlayerSourceSpec> fromVideoConfig(const NativeVideoConfig& config) override {
      auto __result = _swiftPart.fromVideoConfig(config);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }

  private:
    ReactNativeVideo::HybridVideoPlayerSourceFactorySpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::video
