KTextAddons

texttospeechwidget.h
1/*
2 SPDX-FileCopyrightText: 2014-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "textedittexttospeech_export.h"
10#include "texttospeech.h"
11#include <QWidget>
12namespace TextEditTextToSpeech
13{
14class TextToSpeechInterface;
15class TextToSpeechWidgetPrivate;
16/**
17 * @brief The TextToSpeechWidget class
18 * @author Laurent Montel <montel@kde.org>
19 */
20class TEXTEDITTEXTTOSPEECH_EXPORT TextToSpeechWidget : public QWidget
21{
22 Q_OBJECT
23public:
24 explicit TextToSpeechWidget(QWidget *parent = nullptr);
25 ~TextToSpeechWidget() override;
26
27 enum State {
28 Stop = 0,
29 Play,
30 Pause,
31 };
32 Q_ENUM(State)
33
34 [[nodiscard]] State state() const;
35 void setState(TextEditTextToSpeech::TextToSpeechWidget::State state);
36
37 void setTextToSpeechInterface(TextToSpeechInterface *interface);
38
39 [[nodiscard]] bool isReady() const;
40
41 void showWidget();
42
43public Q_SLOTS:
44 void say(const QString &text);
45
46 void slotStateChanged(TextEditTextToSpeech::TextToSpeech::State state);
47
48Q_SIGNALS:
49 void stateChanged(TextEditTextToSpeech::TextToSpeechWidget::State state);
50 void changeVisibility(bool state);
51
52private:
53 TEXTEDITTEXTTOSPEECH_NO_EXPORT void slotVolumeChanged(int value);
54 TEXTEDITTEXTTOSPEECH_NO_EXPORT void slotCloseTextToSpeechWidget();
55 TEXTEDITTEXTTOSPEECH_NO_EXPORT void slotConfigure();
56 TEXTEDITTEXTTOSPEECH_NO_EXPORT void applyVolume();
57 TEXTEDITTEXTTOSPEECH_NO_EXPORT void hideWidget();
58 std::unique_ptr<TextToSpeechWidgetPrivate> const d;
59};
60}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:51:28 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.