KTextAddons

texttospeech.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 <QObject>
11#include <memory>
12
13namespace TextEditTextToSpeech
14{
15class TextToSpeechPrivate;
16/**
17 * @brief The TextToSpeech class
18 * @author Laurent Montel <montel@kde.org>
19 */
20class TEXTEDITTEXTTOSPEECH_EXPORT TextToSpeech : public QObject
21{
22 Q_OBJECT
23public:
24 static TextToSpeech *self();
25
26 ~TextToSpeech() override;
27
28 [[nodiscard]] bool isReady() const;
29
30 enum State {
31 Ready = 0,
32 Speaking,
33 Paused,
34 BackendError,
35 Synthesizing,
36 };
37
38 [[nodiscard]] double volume() const;
39 [[nodiscard]] QVector<QLocale> availableLocales() const;
40 [[nodiscard]] QStringList availableEngines() const;
41 [[nodiscard]] QStringList availableVoices() const;
42
43 [[nodiscard]] QLocale locale() const;
44
45 void reloadSettings();
46public Q_SLOTS:
47 void say(const QString &text);
48 void stop();
49 void pause();
50 void resume();
51
52 void setRate(double rate);
53 void setPitch(double pitch);
54 void setVolume(double volume);
55 void setLocale(const QLocale &locale) const;
56
57Q_SIGNALS:
58 void stateChanged(TextToSpeech::State);
59
60private:
61 TEXTEDITTEXTTOSPEECH_NO_EXPORT void slotStateChanged();
62 TEXTEDITTEXTTOSPEECH_NO_EXPORT explicit TextToSpeech(QObject *parent = nullptr);
63
64 std::unique_ptr<TextToSpeechPrivate> const d;
65};
66}
The TextToSpeech class.
void stop(Ekos::AlignState mode)
Q_SCRIPTABLE Q_NOREPLY void pause()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:48:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.