Warning, file /libraries/ktextaddons/textedittexttospeech/texttospeechwidget.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002    SPDX-FileCopyrightText: 2014-2023 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 "texttospeech.h"
0011 #include <QWidget>
0012 namespace TextEditTextToSpeech
0013 {
0014 class TextToSpeechInterface;
0015 class TextToSpeechWidgetPrivate;
0016 /**
0017  * @brief The TextToSpeechWidget class
0018  * @author Laurent Montel <montel@kde.org>
0019  */
0020 class TEXTEDITTEXTTOSPEECH_EXPORT TextToSpeechWidget : public QWidget
0021 {
0022     Q_OBJECT
0023 public:
0024     explicit TextToSpeechWidget(QWidget *parent = nullptr);
0025     ~TextToSpeechWidget() override;
0026 
0027     enum State {
0028         Stop = 0,
0029         Play,
0030         Pause,
0031     };
0032     Q_ENUM(State)
0033 
0034     Q_REQUIRED_RESULT State state() const;
0035     void setState(TextEditTextToSpeech::TextToSpeechWidget::State state);
0036 
0037     void setTextToSpeechInterface(TextToSpeechInterface *interface);
0038 
0039     Q_REQUIRED_RESULT bool isReady() const;
0040 
0041     void showWidget();
0042 
0043 public Q_SLOTS:
0044     void say(const QString &text);
0045 
0046     void slotStateChanged(TextEditTextToSpeech::TextToSpeech::State state);
0047 
0048 Q_SIGNALS:
0049     void stateChanged(TextEditTextToSpeech::TextToSpeechWidget::State state);
0050     void changeVisibility(bool state);
0051 
0052 private:
0053     TEXTEDITTEXTTOSPEECH_NO_EXPORT void slotVolumeChanged(int value);
0054     TEXTEDITTEXTTOSPEECH_NO_EXPORT void slotCloseTextToSpeechWidget();
0055     TEXTEDITTEXTTOSPEECH_NO_EXPORT void slotConfigure();
0056     TEXTEDITTEXTTOSPEECH_NO_EXPORT void applyVolume();
0057     TEXTEDITTEXTTOSPEECH_NO_EXPORT void hideWidget();
0058     std::unique_ptr<TextToSpeechWidgetPrivate> const d;
0059 };
0060 }