File indexing completed on 2024-12-22 04:28:23
0001 /* 0002 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 #include "libvoskspeechtotext_export.h" 0009 #include <QJsonObject> 0010 #include <QString> 0011 0012 class LIBVOSKSPEECHTOTEXT_EXPORT VoskSpeechToTextInfo 0013 { 0014 public: 0015 VoskSpeechToTextInfo(); 0016 ~VoskSpeechToTextInfo(); 0017 0018 [[nodiscard]] bool isValid() const; 0019 0020 [[nodiscard]] QString identifier() const; 0021 void setIdentifier(const QString &newLang); 0022 0023 [[nodiscard]] QString langText() const; 0024 void setLangText(const QString &newLangText); 0025 0026 [[nodiscard]] QString md5() const; 0027 void setMd5(const QString &newMd5); 0028 0029 [[nodiscard]] QString version() const; 0030 void setVersion(const QString &newVersion); 0031 0032 [[nodiscard]] QString url() const; 0033 void setUrl(const QString &newUrl); 0034 0035 [[nodiscard]] quint64 size() const; 0036 void setSize(quint64 newSize); 0037 0038 [[nodiscard]] bool obsolete() const; 0039 void setObsolete(bool newObsolete); 0040 0041 [[nodiscard]] bool operator==(const VoskSpeechToTextInfo &other) const; 0042 0043 void parse(const QJsonObject &obj); 0044 0045 [[nodiscard]] QString type() const; 0046 void setType(const QString &newType); 0047 0048 QString name() const; 0049 void setName(const QString &newName); 0050 0051 private: 0052 QString mName; 0053 QString mType; 0054 QString mIdentifier; 0055 QString mLangText; 0056 QString mMd5; 0057 QString mVersion; 0058 QString mUrl; 0059 quint64 mSize = 0; 0060 bool mObsolete = false; 0061 }; 0062 LIBVOSKSPEECHTOTEXT_EXPORT QDebug operator<<(QDebug d, const VoskSpeechToTextInfo &t); 0063 Q_DECLARE_METATYPE(VoskSpeechToTextInfo) 0064 Q_DECLARE_TYPEINFO(VoskSpeechToTextInfo, Q_MOVABLE_TYPE);