Files
react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerEventEmitterSpecSwift.hpp
2026-03-25 17:28:35 +01:00

280 lines
12 KiB
C++
Generated

///
/// HybridVideoPlayerEventEmitterSpecSwift.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///
#pragma once
#include "HybridVideoPlayerEventEmitterSpec.hpp"
// Forward declaration of `HybridVideoPlayerEventEmitterSpec_cxx` to properly resolve imports.
namespace ReactNativeVideo { class HybridVideoPlayerEventEmitterSpec_cxx; }
// Forward declaration of `ListenerSubscription` to properly resolve imports.
namespace margelo::nitro::video { struct ListenerSubscription; }
// Forward declaration of `BandwidthData` to properly resolve imports.
namespace margelo::nitro::video { struct BandwidthData; }
// Forward declaration of `onLoadData` to properly resolve imports.
namespace margelo::nitro::video { struct onLoadData; }
// Forward declaration of `VideoOrientation` to properly resolve imports.
namespace margelo::nitro::video { enum class VideoOrientation; }
// Forward declaration of `onLoadStartData` to properly resolve imports.
namespace margelo::nitro::video { struct onLoadStartData; }
// Forward declaration of `SourceType` to properly resolve imports.
namespace margelo::nitro::video { enum class SourceType; }
// Forward declaration of `HybridVideoPlayerSourceSpec` to properly resolve imports.
namespace margelo::nitro::video { class HybridVideoPlayerSourceSpec; }
// Forward declaration of `onPlaybackStateChangeData` to properly resolve imports.
namespace margelo::nitro::video { struct onPlaybackStateChangeData; }
// Forward declaration of `onProgressData` to properly resolve imports.
namespace margelo::nitro::video { struct onProgressData; }
// Forward declaration of `VideoPlayerStatus` to properly resolve imports.
namespace margelo::nitro::video { enum class VideoPlayerStatus; }
// Forward declaration of `TimedMetadata` to properly resolve imports.
namespace margelo::nitro::video { struct TimedMetadata; }
// Forward declaration of `TimedMetadataObject` to properly resolve imports.
namespace margelo::nitro::video { struct TimedMetadataObject; }
// Forward declaration of `TextTrack` to properly resolve imports.
namespace margelo::nitro::video { struct TextTrack; }
// Forward declaration of `onVolumeChangeData` to properly resolve imports.
namespace margelo::nitro::video { struct onVolumeChangeData; }
#include "ListenerSubscription.hpp"
#include <functional>
#include "BandwidthData.hpp"
#include <optional>
#include "onLoadData.hpp"
#include "VideoOrientation.hpp"
#include "onLoadStartData.hpp"
#include "SourceType.hpp"
#include <memory>
#include "HybridVideoPlayerSourceSpec.hpp"
#include "onPlaybackStateChangeData.hpp"
#include "onProgressData.hpp"
#include "VideoPlayerStatus.hpp"
#include "TimedMetadata.hpp"
#include "TimedMetadataObject.hpp"
#include <vector>
#include <string>
#include <NitroModules/Null.hpp>
#include "TextTrack.hpp"
#include <variant>
#include "onVolumeChangeData.hpp"
#include "ReactNativeVideo-Swift-Cxx-Umbrella.hpp"
namespace margelo::nitro::video {
/**
* The C++ part of HybridVideoPlayerEventEmitterSpec_cxx.swift.
*
* HybridVideoPlayerEventEmitterSpecSwift (C++) accesses HybridVideoPlayerEventEmitterSpec_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, HybridVideoPlayerEventEmitterSpec_cxx can directly inherit from the C++ class HybridVideoPlayerEventEmitterSpec
* to simplify the whole structure and memory management.
*/
class HybridVideoPlayerEventEmitterSpecSwift: public virtual HybridVideoPlayerEventEmitterSpec {
public:
// Constructor from a Swift instance
explicit HybridVideoPlayerEventEmitterSpecSwift(const ReactNativeVideo::HybridVideoPlayerEventEmitterSpec_cxx& swiftPart):
HybridObject(HybridVideoPlayerEventEmitterSpec::TAG),
_swiftPart(swiftPart) { }
public:
// Get the Swift part
inline ReactNativeVideo::HybridVideoPlayerEventEmitterSpec_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<HybridVideoPlayerEventEmitterSpecSwift>(other)) {
return _swiftPart.equals(otherCast->_swiftPart);
}
return false;
}
void dispose() noexcept override {
_swiftPart.dispose();
}
std::string toString() override {
return _swiftPart.toString();
}
public:
// Properties
public:
// Methods
inline ListenerSubscription addOnAudioBecomingNoisyListener(const std::function<void()>& listener) override {
auto __result = _swiftPart.addOnAudioBecomingNoisyListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnAudioFocusChangeListener(const std::function<void(bool /* hasAudioFocus */)>& listener) override {
auto __result = _swiftPart.addOnAudioFocusChangeListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnBandwidthUpdateListener(const std::function<void(const BandwidthData& /* data */)>& listener) override {
auto __result = _swiftPart.addOnBandwidthUpdateListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnBufferListener(const std::function<void(bool /* buffering */)>& listener) override {
auto __result = _swiftPart.addOnBufferListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnControlsVisibleChangeListener(const std::function<void(bool /* visible */)>& listener) override {
auto __result = _swiftPart.addOnControlsVisibleChangeListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnEndListener(const std::function<void()>& listener) override {
auto __result = _swiftPart.addOnEndListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnExternalPlaybackChangeListener(const std::function<void(bool /* externalPlaybackActive */)>& listener) override {
auto __result = _swiftPart.addOnExternalPlaybackChangeListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnLoadListener(const std::function<void(const onLoadData& /* data */)>& listener) override {
auto __result = _swiftPart.addOnLoadListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnLoadStartListener(const std::function<void(const onLoadStartData& /* data */)>& listener) override {
auto __result = _swiftPart.addOnLoadStartListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnPlaybackStateChangeListener(const std::function<void(const onPlaybackStateChangeData& /* data */)>& listener) override {
auto __result = _swiftPart.addOnPlaybackStateChangeListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnPlaybackRateChangeListener(const std::function<void(double /* rate */)>& listener) override {
auto __result = _swiftPart.addOnPlaybackRateChangeListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnProgressListener(const std::function<void(const onProgressData& /* data */)>& listener) override {
auto __result = _swiftPart.addOnProgressListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnReadyToDisplayListener(const std::function<void()>& listener) override {
auto __result = _swiftPart.addOnReadyToDisplayListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnSeekListener(const std::function<void(double /* position */)>& listener) override {
auto __result = _swiftPart.addOnSeekListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnStatusChangeListener(const std::function<void(VideoPlayerStatus /* status */)>& listener) override {
auto __result = _swiftPart.addOnStatusChangeListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnTimedMetadataListener(const std::function<void(const TimedMetadata& /* data */)>& listener) override {
auto __result = _swiftPart.addOnTimedMetadataListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnTextTrackDataChangedListener(const std::function<void(const std::vector<std::string>& /* data */)>& listener) override {
auto __result = _swiftPart.addOnTextTrackDataChangedListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnTrackChangeListener(const std::function<void(const std::optional<std::variant<nitro::NullType, TextTrack>>& /* track */)>& listener) override {
auto __result = _swiftPart.addOnTrackChangeListener(listener);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline ListenerSubscription addOnVolumeChangeListener(const std::function<void(const onVolumeChangeData& /* data */)>& listener) override {
auto __result = _swiftPart.addOnVolumeChangeListener(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::HybridVideoPlayerEventEmitterSpec_cxx _swiftPart;
};
} // namespace margelo::nitro::video