///
/// HybridOneSpeechSynthesisSpec.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 `SpeechSynthesisUtterance` to properly resolve imports.
namespace margelo::nitro::one { struct SpeechSynthesisUtterance; }
// Forward declaration of `SpeechSynthesisEvent` to properly resolve imports.
namespace margelo::nitro::one { struct SpeechSynthesisEvent; }
// Forward declaration of `SpeechSynthesisVoice` to properly resolve imports.
namespace margelo::nitro::one { struct SpeechSynthesisVoice; }

#include "SpeechSynthesisUtterance.hpp"
#include "SpeechSynthesisEvent.hpp"
#include <functional>
#include <NitroModules/Promise.hpp>
#include "SpeechSynthesisVoice.hpp"
#include <vector>

namespace margelo::nitro::one {

  using namespace margelo::nitro;

  /**
   * An abstract base class for `OneSpeechSynthesis`
   * Inherit this class to create instances of `HybridOneSpeechSynthesisSpec` in C++.
   * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
   * @example
   * ```cpp
   * class HybridOneSpeechSynthesis: public HybridOneSpeechSynthesisSpec {
   * public:
   *   HybridOneSpeechSynthesis(...): HybridObject(TAG) { ... }
   *   // ...
   * };
   * ```
   */
  class HybridOneSpeechSynthesisSpec: public virtual HybridObject {
    public:
      // Constructor
      explicit HybridOneSpeechSynthesisSpec(): HybridObject(TAG) { }

      // Destructor
      ~HybridOneSpeechSynthesisSpec() override = default;

    public:
      // Properties
      virtual double getMaxInputLength() = 0;

    public:
      // Methods
      virtual void speak(const SpeechSynthesisUtterance& utterance, const std::function<void(const SpeechSynthesisEvent& /* event */)>& onEvent) = 0;
      virtual std::shared_ptr<Promise<void>> stop() = 0;
      virtual std::shared_ptr<Promise<void>> pause() = 0;
      virtual std::shared_ptr<Promise<void>> resume() = 0;
      virtual std::shared_ptr<Promise<bool>> isSpeaking() = 0;
      virtual std::shared_ptr<Promise<std::vector<SpeechSynthesisVoice>>> getAvailableVoices() = 0;

    protected:
      // Hybrid Setup
      void loadHybridMethods() override;

    protected:
      // Tag for logging
      static constexpr auto TAG = "OneSpeechSynthesis";
  };

} // namespace margelo::nitro::one
