File indexing completed on 2024-12-15 03:45:00
0001 /* 0002 SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: MIT 0005 */ 0006 0007 #ifndef KUSERFEEDBACK_CONSOLE_SURVEY_H 0008 #define KUSERFEEDBACK_CONSOLE_SURVEY_H 0009 0010 #include <QMetaType> 0011 #include <QSharedDataPointer> 0012 #include <QVector> 0013 0014 class QString; 0015 class QUrl; 0016 class QUuid; 0017 0018 namespace KUserFeedback { 0019 namespace Console { 0020 0021 class SurveyData; 0022 0023 /** Data for one survey. */ 0024 class Survey 0025 { 0026 public: 0027 Survey(); 0028 Survey(const Survey&); 0029 ~Survey(); 0030 Survey& operator=(const Survey&); 0031 0032 bool operator==(const Survey &other) const; 0033 bool operator!=(const Survey &other) const; 0034 0035 QUuid uuid() const; 0036 void setUuid(const QUuid &id); 0037 0038 QString name() const; 0039 void setName(const QString& name); 0040 0041 QUrl url() const; 0042 void setUrl(const QUrl& url); 0043 0044 bool isActive() const; 0045 void setActive(bool enabled); 0046 0047 QString target() const; 0048 void setTarget(const QString &target); 0049 0050 QByteArray toJson() const; 0051 static QVector<Survey> fromJson(const QByteArray &data); 0052 private: 0053 QSharedDataPointer<SurveyData> d; 0054 }; 0055 0056 } 0057 } 0058 0059 Q_DECLARE_TYPEINFO(KUserFeedback::Console::Survey, Q_MOVABLE_TYPE); 0060 Q_DECLARE_METATYPE(KUserFeedback::Console::Survey) 0061 0062 #endif // KUSERFEEDBACK_CONSOLE_SURVEY_H