// AUTOGENERATED FILE - DO NOT MODIFY!
// This file was generated by Djinni from tts_backend.djinni

#pragma once

#include "java/AbstractTextToSpeechBackend.hpp"
#include "java/support/jni/djinni_support.hpp"

namespace prism::jni {

class AbstractTextToSpeechBackend final : ::djinni::JniInterface<::prism::java::AbstractTextToSpeechBackend, AbstractTextToSpeechBackend> {
public:
    using CppType = std::shared_ptr<::prism::java::AbstractTextToSpeechBackend>;
    using CppOptType = std::shared_ptr<::prism::java::AbstractTextToSpeechBackend>;
    using JniType = jobject;

    using Boxed = AbstractTextToSpeechBackend;

    ~AbstractTextToSpeechBackend();

    static CppType toCpp(JNIEnv* jniEnv, JniType j) { return ::djinni::JniClass<AbstractTextToSpeechBackend>::get()._fromJava(jniEnv, j); }
    static ::djinni::LocalRef<JniType> fromCppOpt(JNIEnv* jniEnv, const CppOptType& c) { return {jniEnv, ::djinni::JniClass<AbstractTextToSpeechBackend>::get()._toJava(jniEnv, c)}; }
    static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c) { return fromCppOpt(jniEnv, c); }

private:
    AbstractTextToSpeechBackend();
    friend ::djinni::JniClass<AbstractTextToSpeechBackend>;
    friend ::djinni::JniInterface<::prism::java::AbstractTextToSpeechBackend, AbstractTextToSpeechBackend>;

    class JavaProxy final : ::djinni::JavaProxyHandle<JavaProxy>, public ::prism::java::AbstractTextToSpeechBackend
    {
    public:
        JavaProxy(JniType j);
        ~JavaProxy();

        std::string get_name() override;
        djinni::expected<::prism::java::Unit, ::prism::java::BackendError> initialize() override;
        djinni::expected<::prism::java::Unit, ::prism::java::BackendError> speak(const ::djinni::DataView & text, bool interrupt) override;
        djinni::expected<::prism::java::Unit, ::prism::java::BackendError> speak_to_memory(const ::djinni::DataView & text, const /*not-null*/ std::shared_ptr<::prism::java::AudioCallback> & callback, int64_t userdata) override;
        djinni::expected<::prism::java::Unit, ::prism::java::BackendError> braille(const ::djinni::DataView & text) override;
        djinni::expected<::prism::java::Unit, ::prism::java::BackendError> output(const ::djinni::DataView & text, bool interrupt) override;
        djinni::expected<bool, ::prism::java::BackendError> is_speaking() override;
        djinni::expected<::prism::java::Unit, ::prism::java::BackendError> stop() override;
        djinni::expected<::prism::java::Unit, ::prism::java::BackendError> pause() override;
        djinni::expected<::prism::java::Unit, ::prism::java::BackendError> resume() override;
        djinni::expected<::prism::java::Unit, ::prism::java::BackendError> set_volume(float volume) override;
        djinni::expected<float, ::prism::java::BackendError> get_volume() override;
        djinni::expected<::prism::java::Unit, ::prism::java::BackendError> set_rate(float rate) override;
        djinni::expected<float, ::prism::java::BackendError> get_rate() override;
        djinni::expected<::prism::java::Unit, ::prism::java::BackendError> set_pitch(float pitch) override;
        djinni::expected<float, ::prism::java::BackendError> get_pitch() override;
        djinni::expected<::prism::java::Unit, ::prism::java::BackendError> refresh_voices() override;
        djinni::expected<int64_t, ::prism::java::BackendError> count_voices() override;
        djinni::expected<std::string, ::prism::java::BackendError> get_voice_name(int64_t id) override;
        djinni::expected<std::string, ::prism::java::BackendError> get_voice_language(int64_t id) override;
        djinni::expected<::prism::java::Unit, ::prism::java::BackendError> set_voice(int64_t id) override;
        djinni::expected<int64_t, ::prism::java::BackendError> get_voice() override;
        djinni::expected<int64_t, ::prism::java::BackendError> get_channels() override;
        djinni::expected<int64_t, ::prism::java::BackendError> get_sample_rate() override;
        djinni::expected<int64_t, ::prism::java::BackendError> get_bit_depth() override;

    private:
        friend ::djinni::JniInterface<::prism::java::AbstractTextToSpeechBackend, ::prism::jni::AbstractTextToSpeechBackend>;
    };

    const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/github/ethindp/prism/AbstractTextToSpeechBackend") };
    const jmethodID method_getName { ::djinni::jniGetMethodID(clazz.get(), "getName", "()Ljava/lang/String;") };
    const jmethodID method_initialize { ::djinni::jniGetMethodID(clazz.get(), "initialize", "()Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_speak { ::djinni::jniGetMethodID(clazz.get(), "speak", "(Ljava/nio/ByteBuffer;Z)Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_speakToMemory { ::djinni::jniGetMethodID(clazz.get(), "speakToMemory", "(Ljava/nio/ByteBuffer;Lcom/github/ethindp/prism/AudioCallback;J)Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_braille { ::djinni::jniGetMethodID(clazz.get(), "braille", "(Ljava/nio/ByteBuffer;)Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_output { ::djinni::jniGetMethodID(clazz.get(), "output", "(Ljava/nio/ByteBuffer;Z)Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_isSpeaking { ::djinni::jniGetMethodID(clazz.get(), "isSpeaking", "()Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_stop { ::djinni::jniGetMethodID(clazz.get(), "stop", "()Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_pause { ::djinni::jniGetMethodID(clazz.get(), "pause", "()Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_resume { ::djinni::jniGetMethodID(clazz.get(), "resume", "()Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_setVolume { ::djinni::jniGetMethodID(clazz.get(), "setVolume", "(F)Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_getVolume { ::djinni::jniGetMethodID(clazz.get(), "getVolume", "()Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_setRate { ::djinni::jniGetMethodID(clazz.get(), "setRate", "(F)Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_getRate { ::djinni::jniGetMethodID(clazz.get(), "getRate", "()Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_setPitch { ::djinni::jniGetMethodID(clazz.get(), "setPitch", "(F)Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_getPitch { ::djinni::jniGetMethodID(clazz.get(), "getPitch", "()Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_refreshVoices { ::djinni::jniGetMethodID(clazz.get(), "refreshVoices", "()Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_countVoices { ::djinni::jniGetMethodID(clazz.get(), "countVoices", "()Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_getVoiceName { ::djinni::jniGetMethodID(clazz.get(), "getVoiceName", "(J)Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_getVoiceLanguage { ::djinni::jniGetMethodID(clazz.get(), "getVoiceLanguage", "(J)Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_setVoice { ::djinni::jniGetMethodID(clazz.get(), "setVoice", "(J)Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_getVoice { ::djinni::jniGetMethodID(clazz.get(), "getVoice", "()Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_getChannels { ::djinni::jniGetMethodID(clazz.get(), "getChannels", "()Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_getSampleRate { ::djinni::jniGetMethodID(clazz.get(), "getSampleRate", "()Lcom/snapchat/djinni/Outcome;") };
    const jmethodID method_getBitDepth { ::djinni::jniGetMethodID(clazz.get(), "getBitDepth", "()Lcom/snapchat/djinni/Outcome;") };
};

} // namespace prism::jni
