File indexing completed on 2024-04-28 16:00:58

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 <QObject>
0011 #include <TextEditTextToSpeech/TextToSpeechWidget>
0012 class QAction;
0013 namespace TextEditTextToSpeech
0014 {
0015 class TextToSpeechActionsPrivate;
0016 /**
0017  * @brief The TextToSpeechActions class
0018  * @author Laurent Montel <montel@kde.org>
0019  */
0020 class TEXTEDITTEXTTOSPEECH_EXPORT TextToSpeechActions : public QObject
0021 {
0022     Q_OBJECT
0023 public:
0024     explicit TextToSpeechActions(QObject *parent = nullptr);
0025     ~TextToSpeechActions() override;
0026 
0027     Q_REQUIRED_RESULT QAction *stopAction() const;
0028 
0029     Q_REQUIRED_RESULT QAction *playPauseAction() const;
0030 
0031     Q_REQUIRED_RESULT TextToSpeechWidget::State state() const;
0032 
0033 public Q_SLOTS:
0034     void setState(TextToSpeechWidget::State);
0035     void slotStop();
0036 
0037 Q_SIGNALS:
0038     void stateChanged(TextEditTextToSpeech::TextToSpeechWidget::State state);
0039 
0040 private:
0041     TEXTEDITTEXTTOSPEECH_NO_EXPORT void slotPlayPause();
0042     std::unique_ptr<TextToSpeechActionsPrivate> const d;
0043 };
0044 }