KUserFeedback

surveyinfo.h
1/*
2 SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: MIT
5*/
6
7#ifndef KUSERFEEDBACK_SURVEYINFO_H
8#define KUSERFEEDBACK_SURVEYINFO_H
9
10#include "kuserfeedbackcore_export.h"
11
12#include <QMetaType>
13#include <QSharedDataPointer>
14#include <qobjectdefs.h>
15#include <QUrl>
16#include <QUuid>
17
18
19QT_BEGIN_NAMESPACE
20class QJsonObject;
21QT_END_NAMESPACE
22
23namespace KUserFeedback {
24
25class SurveyInfoData;
26
27/*! Information about a survey request.
28 * This class is implicitly shared.
29 */
30class KUSERFEEDBACKCORE_EXPORT SurveyInfo
31{
32 Q_GADGET
33 Q_PROPERTY(bool isValid READ isValid)
34 Q_PROPERTY(QUrl url READ url)
35 Q_PROPERTY(QString target READ target)
36 Q_PROPERTY(QUuid uuid READ uuid)
37public:
38 /*! Create an empty, invalid survey request. */
39 SurveyInfo();
40 /*! Copy constructor. */
41 SurveyInfo(const SurveyInfo&);
43 /*! Assignment operator. */
44 SurveyInfo& operator=(const SurveyInfo&);
45
46 /*! Returns @c true if this survey has all necessary information to actually execute it. */
47 bool isValid() const;
48
49 /*! Internal global unique id of the survey.
50 * Used to locally check if a user has completed the survey already.
51 */
52 QUuid uuid() const;
53
54 /*! The URL to the survey website. */
55 QUrl url() const;
56
57 /*! The survey targeting expression. */
58 QString target() const;
59
60 ///@cond internal
61 void setUuid(const QUuid &id);
62 void setUrl(const QUrl &url);
63 void setTarget(const QString &target);
64 static SurveyInfo fromJson(const QJsonObject &obj);
65 ///@endcond
66private:
68};
69
70}
71
72Q_DECLARE_METATYPE(KUserFeedback::SurveyInfo)
73
74#endif // KUSERFEEDBACK_SURVEYINFO_H
Information about a survey request.
Definition surveyinfo.h:31
void setTarget(const SkyPoint &targetCoord)
Classes for integrating telemetry collection, survey targeting, and contribution encouragenemt and co...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:20:56 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.