#pragma once

#include <string>
#include <memory>

namespace celuna {

/**
 * @brief Interface for Text-to-Speech engines
 *
 * Implementations:
 * - SAPITTSEngine: Windows SAPI
 * - EspeakTTSEngine: Linux espeak-ng
 */
class ITTSEngine {
public:
    virtual ~ITTSEngine() = default;

    /**
     * @brief Speak text
     * @param text Text to speak
     * @param async If true, return immediately (default)
     */
    virtual void speak(const std::string& text, bool async = true) = 0;

    /**
     * @brief Stop current speech
     */
    virtual void stop() = 0;

    /**
     * @brief Set speech rate
     * @param rate -10 to 10, 0 is normal
     */
    virtual void setRate(int rate) = 0;

    /**
     * @brief Set volume
     * @param volume 0 to 100
     */
    virtual void setVolume(int volume) = 0;

    /**
     * @brief Check if currently speaking
     */
    virtual bool isSpeaking() const = 0;

    /**
     * @brief Check if engine is available
     */
    virtual bool isAvailable() const = 0;

    /**
     * @brief Get engine name
     */
    virtual std::string getEngineName() const = 0;
};

/**
 * @brief Factory to create appropriate TTS engine
 */
class TTSEngineFactory {
public:
    static std::unique_ptr<ITTSEngine> create();
};

} // namespace celuna
