KTextAddons

voskspeechtotextclient.cpp
1/*
2 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6#include "voskspeechtotextclient.h"
7#include "voskenginedialog.h"
8#include "voskspeechtotextplugin.h"
9#include <KLocalizedString>
10#include <QPointer>
11
12VoskSpeechToTextClient::VoskSpeechToTextClient(QObject *parent)
13 : TextSpeechToText::SpeechToTextClient{parent}
14{
15}
16
17VoskSpeechToTextClient::~VoskSpeechToTextClient() = default;
18
19QString VoskSpeechToTextClient::name() const
20{
21 return QStringLiteral("vosk");
22}
23
24QString VoskSpeechToTextClient::translatedName() const
25{
26 return i18n("Vosk");
27}
28
29TextSpeechToText::SpeechToTextClient::EngineType VoskSpeechToTextClient::engineType() const
30{
31 return TextSpeechToText::SpeechToTextClient::Locale;
32}
33
34TextSpeechToText::SpeechToTextPlugin *VoskSpeechToTextClient::createTextToSpeech()
35{
36 return new VoskSpeechToTextPlugin;
37}
38
39bool VoskSpeechToTextClient::hasConfigurationDialog() const
40{
41 return true;
42}
43
44bool VoskSpeechToTextClient::showConfigureDialog(QWidget *parentWidget)
45{
46 bool settingsChanged = false;
47 QPointer<VoskEngineDialog> dlg = new VoskEngineDialog(parentWidget);
48 if (dlg->exec()) {
49 Q_EMIT configureChanged();
50 settingsChanged = true;
51 }
52 delete dlg;
53 return settingsChanged;
54}
55
56#include "moc_voskspeechtotextclient.cpp"
QString i18n(const char *text, const TYPE &arg...)
Q_EMITQ_EMIT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:02 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.