File indexing completed on 2024-12-22 04:28:24

0001 /*
0002   SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 #include "textspeechtotext_export.h"
0009 #include <QObject>
0010 namespace TextSpeechToText
0011 {
0012 class SpeechToTextPlugin;
0013 /**
0014  * @brief The SpeechToTextClient class
0015  * @author Laurent Montel <montel@kde.org>
0016  */
0017 class TEXTSPEECHTOTEXT_EXPORT SpeechToTextClient : public QObject
0018 {
0019     Q_OBJECT
0020 public:
0021     enum EngineType {
0022         Locale,
0023         Network,
0024     };
0025     explicit SpeechToTextClient(QObject *parent = nullptr);
0026     ~SpeechToTextClient() override;
0027 
0028     /**
0029      * @returns the name of the implementing class.
0030      */
0031     virtual QString name() const = 0;
0032 
0033     virtual QString translatedName() const = 0;
0034 
0035     virtual SpeechToTextPlugin *createTextToSpeech() = 0;
0036 
0037     [[nodiscard]] virtual bool hasConfigurationDialog() const;
0038 
0039     virtual bool showConfigureDialog(QWidget *parentWidget);
0040 
0041     [[nodiscard]] virtual TextSpeechToText::SpeechToTextClient::EngineType engineType() const = 0;
0042 
0043 Q_SIGNALS:
0044     void configureChanged();
0045 };
0046 }
0047 Q_DECLARE_INTERFACE(TextSpeechToText::SpeechToTextClient, "org.kde.texttospeech.Client")