/// /// HybridOmniViewComponent.hpp /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © Marc Rousavy @ Margelo /// #pragma once #include #include #include #include #include #include #include #include #include #include "HybridOmniPlayerSpec.hpp" #include #include "SubtitleAssets.hpp" #include "HybridOmniViewSpec.hpp" #include namespace margelo::nitro::omni::views { using namespace facebook; /** * The name of the actual native View. */ extern const char HybridOmniViewComponentName[]; /** * Props for the "OmniView" View. */ class HybridOmniViewProps final: public react::ViewProps { public: HybridOmniViewProps() = default; HybridOmniViewProps(const react::PropsParserContext& context, const HybridOmniViewProps& sourceProps, const react::RawProps& rawProps); public: CachedProp> player; CachedProp> autoplay; CachedProp> autoPip; CachedProp> subtitleAssets; CachedProp& /* ref */)>>> hybridRef; private: static bool filterObjectKeys(const std::string& propName); }; /** * State for the "OmniView" View. */ class HybridOmniViewState final { public: HybridOmniViewState() = default; explicit HybridOmniViewState(const std::shared_ptr& props): _props(props) {} public: [[nodiscard]] const std::shared_ptr& getProps() const { return _props; } public: #ifdef ANDROID HybridOmniViewState(const HybridOmniViewState& /* previousState */, folly::dynamic /* data */) {} folly::dynamic getDynamic() const { throw std::runtime_error("HybridOmniViewState does not support folly!"); } react::MapBuffer getMapBuffer() const { throw std::runtime_error("HybridOmniViewState does not support MapBuffer!"); }; #endif private: std::shared_ptr _props; }; /** * The Shadow Node for the "OmniView" View. */ using HybridOmniViewShadowNode = react::ConcreteViewShadowNode; /** * The Component Descriptor for the "OmniView" View. */ class HybridOmniViewComponentDescriptor final: public react::ConcreteComponentDescriptor { public: explicit HybridOmniViewComponentDescriptor(const react::ComponentDescriptorParameters& parameters); public: /** * A faster path for cloning props - reuses the caching logic from `HybridOmniViewProps`. */ std::shared_ptr cloneProps(const react::PropsParserContext& context, const std::shared_ptr& props, react::RawProps rawProps) const override; #ifdef ANDROID void adopt(react::ShadowNode& shadowNode) const override; #endif }; /* The actual view for "OmniView" needs to be implemented in platform-specific code. */ } // namespace margelo::nitro::omni::views