File indexing completed on 2024-04-21 03:48:35
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2015 Gábor Péterffy <peterffy95@gmail.com> 0004 // 0005 0006 #include "TextToSpeechClient.h" 0007 0008 #ifdef Q_OS_ANDROID 0009 #include <QAndroidJniObject> 0010 #endif 0011 0012 TextToSpeechClient::TextToSpeechClient(QObject *parent) : 0013 QObject(parent) 0014 { 0015 //nothing to do 0016 } 0017 0018 TextToSpeechClient::~TextToSpeechClient() 0019 { 0020 //nothing to do 0021 } 0022 0023 void TextToSpeechClient::readText(const QString & text) 0024 { 0025 #ifdef Q_OS_ANDROID 0026 QAndroidJniObject jniText = QAndroidJniObject::fromString(text); 0027 QAndroidJniObject::callStaticMethod<void>("org/kde/marble/maps/TextToSpeechClient", "read", "(Ljava/lang/String;)V", jniText.object<jstring>()); 0028 #else 0029 Q_UNUSED(text) 0030 #endif 0031 } 0032 0033 void TextToSpeechClient::setLocale(const QString & locale) 0034 { 0035 #ifdef Q_OS_ANDROID 0036 QAndroidJniObject jniText = QAndroidJniObject::fromString(locale); 0037 QAndroidJniObject::callStaticMethod<void>("org/kde/marble/maps/TextToSpeechClient", "initSpeakerStatic", "(Ljava/lang/String;)V", jniText.object<jstring>()); 0038 #else 0039 Q_UNUSED(locale) 0040 #endif 0041 } 0042 0043 #include "moc_TextToSpeechClient.cpp"