File indexing completed on 2024-05-12 16:16:02
0001 /* 0002 SPDX-FileCopyrightText: 2019-2023 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 #include "textgrammarcheckprivate_export.h" 0009 0010 #include <QObject> 0011 namespace TextGrammarCheck 0012 { 0013 class TEXTGRAMMARCHECK_TESTS_EXPORT LanguageInfo 0014 { 0015 public: 0016 LanguageInfo(); 0017 ~LanguageInfo(); 0018 0019 Q_REQUIRED_RESULT QString name() const; 0020 void setName(const QString &name); 0021 0022 Q_REQUIRED_RESULT QString longCode() const; 0023 void setLongCode(const QString &longCode); 0024 0025 Q_REQUIRED_RESULT QString code() const; 0026 void setCode(const QString &code); 0027 0028 Q_REQUIRED_RESULT bool isValid() const; 0029 0030 void parse(const QJsonObject &obj); 0031 0032 Q_REQUIRED_RESULT bool operator==(const LanguageInfo &other) const; 0033 0034 private: 0035 QString mName; 0036 QString mLongCode; 0037 QString mCode; 0038 }; 0039 } 0040 Q_DECLARE_METATYPE(TextGrammarCheck::LanguageInfo) 0041 Q_DECLARE_TYPEINFO(TextGrammarCheck::LanguageInfo, Q_MOVABLE_TYPE);