mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-05 05:36:17 +00:00
87 lines
3.6 KiB
C++
Generated
87 lines
3.6 KiB
C++
Generated
///
|
|
/// HybridOmniEventMapSpec.hpp
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
#pragma once
|
|
|
|
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
#include <NitroModules/HybridObject.hpp>
|
|
#else
|
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
#endif
|
|
|
|
// Forward declaration of `Track` to properly resolve imports.
|
|
namespace margelo::nitro::omni { struct Track; }
|
|
// Forward declaration of `Rendition` to properly resolve imports.
|
|
namespace margelo::nitro::omni { struct Rendition; }
|
|
|
|
#include <functional>
|
|
#include <string>
|
|
#include "Track.hpp"
|
|
#include <optional>
|
|
#include "Rendition.hpp"
|
|
|
|
namespace margelo::nitro::omni {
|
|
|
|
using namespace margelo::nitro;
|
|
|
|
/**
|
|
* An abstract base class for `OmniEventMap`
|
|
* Inherit this class to create instances of `HybridOmniEventMapSpec` in C++.
|
|
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
* @example
|
|
* ```cpp
|
|
* class HybridOmniEventMap: public HybridOmniEventMapSpec {
|
|
* public:
|
|
* HybridOmniEventMap(...): HybridObject(TAG) { ... }
|
|
* // ...
|
|
* };
|
|
* ```
|
|
*/
|
|
class HybridOmniEventMapSpec: public virtual HybridObject {
|
|
public:
|
|
// Constructor
|
|
explicit HybridOmniEventMapSpec(): HybridObject(TAG) { }
|
|
|
|
// Destructor
|
|
~HybridOmniEventMapSpec() override = default;
|
|
|
|
public:
|
|
// Properties
|
|
|
|
|
|
public:
|
|
// Methods
|
|
virtual void addOnEndListener(const std::function<void()>& cb) = 0;
|
|
virtual void removeOnEndListener(const std::function<void()>& cb) = 0;
|
|
virtual void addOnPrevListener(const std::function<void()>& cb) = 0;
|
|
virtual void removeOnPrevListener(const std::function<void()>& cb) = 0;
|
|
virtual void addOnNextListener(const std::function<void()>& cb) = 0;
|
|
virtual void removeOnNextListener(const std::function<void()>& cb) = 0;
|
|
virtual void addOnErrorListener(const std::function<void(const std::string& /* type */, const std::string& /* message */)>& cb) = 0;
|
|
virtual void removeOnErrorListener(const std::function<void(const std::string& /* type */, const std::string& /* message */)>& cb) = 0;
|
|
virtual void addOnAudioFocusChangeListener(const std::function<void(const std::string& /* status */)>& cb) = 0;
|
|
virtual void removeOnAudioFocusChangeListener(const std::function<void(const std::string& /* status */)>& cb) = 0;
|
|
virtual void addOnVideoTrackChangeListener(const std::function<void(const Track& /* track */)>& cb) = 0;
|
|
virtual void removeOnVideoTrackChangeListener(const std::function<void(const Track& /* track */)>& cb) = 0;
|
|
virtual void addOnAudioTrackChangeListener(const std::function<void(const Track& /* track */)>& cb) = 0;
|
|
virtual void removeOnAudioTrackChangeListener(const std::function<void(const Track& /* track */)>& cb) = 0;
|
|
virtual void addOnSubtitleChangeListener(const std::function<void(const std::optional<Track>& /* track */)>& cb) = 0;
|
|
virtual void removeOnSubtitleChangeListener(const std::function<void(const std::optional<Track>& /* track */)>& cb) = 0;
|
|
virtual void addOnRenditionChangeListener(const std::function<void(const Rendition& /* rendition */)>& cb) = 0;
|
|
virtual void removeOnRenditionChangeListener(const std::function<void(const Rendition& /* rendition */)>& cb) = 0;
|
|
|
|
protected:
|
|
// Hybrid Setup
|
|
void loadHybridMethods() override;
|
|
|
|
protected:
|
|
// Tag for logging
|
|
static constexpr auto TAG = "OmniEventMap";
|
|
};
|
|
|
|
} // namespace margelo::nitro::omni
|