///
/// HybridVideoViewSpecSwift.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#include "HybridVideoViewSpec.hpp"

// Forward declaration of `HybridVideoViewSpec_cxx` to properly resolve imports.
namespace Aviation { class HybridVideoViewSpec_cxx; }

// Forward declaration of `ResizeMode` to properly resolve imports.
namespace margelo::nitro::aviation { enum class ResizeMode; }
// Forward declaration of `SurfaceType` to properly resolve imports.
namespace margelo::nitro::aviation { enum class SurfaceType; }
// Forward declaration of `VideoTrackSelection` to properly resolve imports.
namespace margelo::nitro::aviation { struct VideoTrackSelection; }
// Forward declaration of `VideoTrackSelectionType` to properly resolve imports.
namespace margelo::nitro::aviation { enum class VideoTrackSelectionType; }
// Forward declaration of `SubtitleTrackSelection` to properly resolve imports.
namespace margelo::nitro::aviation { struct SubtitleTrackSelection; }
// Forward declaration of `SubtitleTrackSelectionType` to properly resolve imports.
namespace margelo::nitro::aviation { enum class SubtitleTrackSelectionType; }
// Forward declaration of `AudioTrackSelection` to properly resolve imports.
namespace margelo::nitro::aviation { struct AudioTrackSelection; }
// Forward declaration of `AudioTrackSelectionType` to properly resolve imports.
namespace margelo::nitro::aviation { enum class AudioTrackSelectionType; }
// Forward declaration of `VideoSource` to properly resolve imports.
namespace margelo::nitro::aviation { struct VideoSource; }
// Forward declaration of `VideoMediaType` to properly resolve imports.
namespace margelo::nitro::aviation { enum class VideoMediaType; }
// Forward declaration of `DrmType` to properly resolve imports.
namespace margelo::nitro::aviation { enum class DrmType; }
// Forward declaration of `HybridPlaybackEngineSpec` to properly resolve imports.
namespace margelo::nitro::aviation { class HybridPlaybackEngineSpec; }
// Forward declaration of `FullscreenConfig` to properly resolve imports.
namespace margelo::nitro::aviation { struct FullscreenConfig; }

#include "ResizeMode.hpp"
#include <functional>
#include "SurfaceType.hpp"
#include "VideoTrackSelection.hpp"
#include "VideoTrackSelectionType.hpp"
#include <optional>
#include "SubtitleTrackSelection.hpp"
#include "SubtitleTrackSelectionType.hpp"
#include <string>
#include "AudioTrackSelection.hpp"
#include "AudioTrackSelectionType.hpp"
#include "VideoSource.hpp"
#include "VideoMediaType.hpp"
#include <unordered_map>
#include "DrmType.hpp"
#include <memory>
#include "HybridPlaybackEngineSpec.hpp"
#include "FullscreenConfig.hpp"

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

namespace margelo::nitro::aviation {

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

  public:
    // Get the Swift part
    inline Aviation::HybridVideoViewSpec_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<HybridVideoViewSpecSwift>(other)) {
        return _swiftPart.equals(otherCast->_swiftPart);
      }
      return false;
    }
    void dispose() noexcept override {
      _swiftPart.dispose();
    }
    std::string toString() override {
      return _swiftPart.toString();
    }

  public:
    // Properties
    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 getPipEnabled() noexcept override {
      return _swiftPart.getPipEnabled();
    }
    inline void setPipEnabled(bool pipEnabled) noexcept override {
      _swiftPart.setPipEnabled(std::forward<decltype(pipEnabled)>(pipEnabled));
    }
    inline bool getPlayInBackground() noexcept override {
      return _swiftPart.getPlayInBackground();
    }
    inline void setPlayInBackground(bool playInBackground) noexcept override {
      _swiftPart.setPlayInBackground(std::forward<decltype(playInBackground)>(playInBackground));
    }
    inline std::function<void()> getOnPipStart() noexcept override {
      auto __result = _swiftPart.getOnPipStart();
      return __result;
    }
    inline void setOnPipStart(const std::function<void()>& onPipStart) noexcept override {
      _swiftPart.setOnPipStart(onPipStart);
    }
    inline std::function<void()> getOnPipStop() noexcept override {
      auto __result = _swiftPart.getOnPipStop();
      return __result;
    }
    inline void setOnPipStop(const std::function<void()>& onPipStop) noexcept override {
      _swiftPart.setOnPipStop(onPipStop);
    }
    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));
    }
    inline std::function<void()> getOnFullscreenEnter() noexcept override {
      auto __result = _swiftPart.getOnFullscreenEnter();
      return __result;
    }
    inline void setOnFullscreenEnter(const std::function<void()>& onFullscreenEnter) noexcept override {
      _swiftPart.setOnFullscreenEnter(onFullscreenEnter);
    }
    inline std::function<void()> getOnFullscreenExit() noexcept override {
      auto __result = _swiftPart.getOnFullscreenExit();
      return __result;
    }
    inline void setOnFullscreenExit(const std::function<void()>& onFullscreenExit) noexcept override {
      _swiftPart.setOnFullscreenExit(onFullscreenExit);
    }
    inline VideoTrackSelection getSelectedVideoTrack() noexcept override {
      return _swiftPart.getSelectedVideoTrack();
    }
    inline void setSelectedVideoTrack(const VideoTrackSelection& selectedVideoTrack) noexcept override {
      _swiftPart.setSelectedVideoTrack(std::forward<decltype(selectedVideoTrack)>(selectedVideoTrack));
    }
    inline SubtitleTrackSelection getSelectedSubtitleTrack() noexcept override {
      return _swiftPart.getSelectedSubtitleTrack();
    }
    inline void setSelectedSubtitleTrack(const SubtitleTrackSelection& selectedSubtitleTrack) noexcept override {
      _swiftPart.setSelectedSubtitleTrack(std::forward<decltype(selectedSubtitleTrack)>(selectedSubtitleTrack));
    }
    inline AudioTrackSelection getSelectedAudioTrack() noexcept override {
      return _swiftPart.getSelectedAudioTrack();
    }
    inline void setSelectedAudioTrack(const AudioTrackSelection& selectedAudioTrack) noexcept override {
      _swiftPart.setSelectedAudioTrack(std::forward<decltype(selectedAudioTrack)>(selectedAudioTrack));
    }
    inline std::string getAdTagUrl() noexcept override {
      auto __result = _swiftPart.getAdTagUrl();
      return __result;
    }
    inline void setAdTagUrl(const std::string& adTagUrl) noexcept override {
      _swiftPart.setAdTagUrl(adTagUrl);
    }
    inline VideoSource getSource() noexcept override {
      return _swiftPart.getSource();
    }
    inline void setSource(const VideoSource& source) noexcept override {
      _swiftPart.setSource(std::forward<decltype(source)>(source));
    }
    inline bool getAutoPlay() noexcept override {
      return _swiftPart.getAutoPlay();
    }
    inline void setAutoPlay(bool autoPlay) noexcept override {
      _swiftPart.setAutoPlay(std::forward<decltype(autoPlay)>(autoPlay));
    }

  public:
    // Methods
    inline void attachEngine(const std::shared_ptr<HybridPlaybackEngineSpec>& engine) override {
      auto __result = _swiftPart.attachEngine(engine);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void detachEngine() override {
      auto __result = _swiftPart.detachEngine();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void startPictureInPicture() override {
      auto __result = _swiftPart.startPictureInPicture();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void stopPictureInPicture() override {
      auto __result = _swiftPart.stopPictureInPicture();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void enterFullscreen(const std::optional<FullscreenConfig>& config) override {
      auto __result = _swiftPart.enterFullscreen(config);
      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 bool isFullscreen() override {
      auto __result = _swiftPart.isFullscreen();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline void enterNativeFullscreen() override {
      auto __result = _swiftPart.enterNativeFullscreen();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void applyVideoTrack(const VideoTrackSelection& selection) override {
      auto __result = _swiftPart.applyVideoTrack(std::forward<decltype(selection)>(selection));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void applySubtitleTrack(const SubtitleTrackSelection& selection) override {
      auto __result = _swiftPart.applySubtitleTrack(std::forward<decltype(selection)>(selection));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void applyAudioTrack(const AudioTrackSelection& selection) override {
      auto __result = _swiftPart.applyAudioTrack(std::forward<decltype(selection)>(selection));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }

  private:
    Aviation::HybridVideoViewSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::aviation
