
/*---------------------------------------------------------------------------*/
/* translation.h                                                             */
/* copyright (c) innovaphone 2021                                            */
/*                                                                           */
/*---------------------------------------------------------------------------*/

class TranslationObject : public istd::listElement<TranslationObject> {
private:
    char* source_language;
    char* target_language;
    char* text;
    char* translation;
public:
    void* context;
    const char* getSource_Language() { return source_language; };
    const char* getTarget_Language() { return target_language; };
    const char* getText() { return text; };
    const char* getTranslation() { return translation; };
    void setTranslation(char* translation) { this->translation = translation; };
    TranslationObject(const char* text, const char* source_language, const char* target_language);
    ~TranslationObject();
};

class ITranslation {
public:
    virtual ~ITranslation() {};
    virtual void Translate(class TranslationObject* translationObject) = 0;
    virtual void Shutdown() = 0;
};

class UTranslation {
public:
    virtual void TranslationConnected(const ITranslation* translator) = 0;
    virtual void TranslationCompleted(const ITranslation* translator, class TranslationObject* translationObject) = 0;
    virtual void TranslationShutdown(const ITranslation* translator) = 0;
    ~UTranslation() {}
};

extern "C" ITranslation * CreateIBMTranslation(class IIoMux* const iomux,
    class ISocketProvider* const tcpSocketProvider,
    class ISocketProvider* const tlsSocketProvider,
    class ISocketContext* socketContext,
    class UTranslation* const user,
    class IInstanceLog* const log,
    const char* endpoint_url,
    const char* resource_name,
    const char* api_key);