///
/// HybridVideoPlayerSourceSpecSwift.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 "HybridVideoPlayerSourceSpec.hpp"

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

// 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; }
// Forward declaration of `VideoInformation` to properly resolve imports.
namespace margelo::nitro::video { struct VideoInformation; }
// Forward declaration of `VideoOrientation` to properly resolve imports.
namespace margelo::nitro::video { enum class VideoOrientation; }

#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 "VideoInformation.hpp"
#include "VideoOrientation.hpp"

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

namespace margelo::nitro::video {

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

  public:
    // Get the Swift part
    inline ReactNativeVideo::HybridVideoPlayerSourceSpec_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::string getUri() noexcept override {
      auto __result = _swiftPart.getUri();
      return __result;
    }
    inline NativeVideoConfig getConfig() noexcept override {
      auto __result = _swiftPart.getConfig();
      return __result;
    }

  public:
    // Methods
    inline std::shared_ptr<Promise<VideoInformation>> getAssetInformationAsync() override {
      auto __result = _swiftPart.getAssetInformationAsync();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }

  private:
    ReactNativeVideo::HybridVideoPlayerSourceSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::video
