File indexing completed on 2024-05-12 12:43:09
0001 /* 0002 SPDX-FileCopyrightText: 2014-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "textedittexttospeech_export.h" 0010 #include <QObject> 0011 #include <TextEditTextToSpeech/TextToSpeechWidget> 0012 namespace TextEditTextToSpeech 0013 { 0014 class TextToSpeechInterfacePrivate; 0015 /** 0016 * @brief The TextToSpeechInterface class 0017 * @author Laurent Montel <montel@kde.org> 0018 */ 0019 class TEXTEDITTEXTTOSPEECH_EXPORT TextToSpeechInterface : public QObject 0020 { 0021 Q_OBJECT 0022 public: 0023 explicit TextToSpeechInterface(TextToSpeechWidget *textToSpeechWidget, QObject *parent = nullptr); 0024 ~TextToSpeechInterface() override; 0025 0026 [[nodiscard]] bool isReady() const; 0027 void say(const QString &text); 0028 [[nodiscard]] double volume() const; 0029 void setVolume(double value); 0030 void reloadSettings(); 0031 0032 private: 0033 TEXTEDITTEXTTOSPEECH_NO_EXPORT void stateChanged(TextEditTextToSpeech::TextToSpeechWidget::State state); 0034 std::unique_ptr<TextToSpeechInterfacePrivate> const d; 0035 }; 0036 }