File indexing completed on 2024-12-15 03:45:05
0001 /* 0002 SPDX-FileCopyrightText: 2017 Aleix Pol Gonzalez <aleixpol@kde.org> 0003 0004 SPDX-License-Identifier: MIT 0005 */ 0006 0007 #ifndef KUSERFEEDBACK_QMLPROPERTYSOURCE_H 0008 #define KUSERFEEDBACK_QMLPROPERTYSOURCE_H 0009 0010 #include "qmlabstractdatasource.h" 0011 #include <QVariant> 0012 0013 class CustomPropertySource; 0014 0015 namespace KUserFeedback { 0016 0017 /*! Data source reporting information provided by a QML application 0018 */ 0019 class QmlPropertySource : public QmlAbstractDataSource 0020 { 0021 Q_OBJECT 0022 Q_PROPERTY(QString sourceId READ sourceId WRITE setSourceId NOTIFY idChanged) 0023 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) 0024 Q_PROPERTY(QString description READ description WRITE setDescription NOTIFY descriptionChanged) 0025 Q_PROPERTY(QVariant data READ data WRITE setData NOTIFY dataChanged) 0026 public: 0027 QmlPropertySource(QObject* parent = nullptr); 0028 0029 QString sourceId() const; 0030 QString name() const; 0031 QString description() const; 0032 QVariant data() const; 0033 0034 void setSourceId(const QString &id); 0035 void setName(const QString &name); 0036 void setDescription(const QString &description); 0037 void setData(const QVariant &data); 0038 0039 Q_SIGNALS: 0040 void idChanged(const QString &id); 0041 void nameChanged(const QString &name); 0042 void descriptionChanged(const QString &description); 0043 void dataChanged(const QVariant &data); 0044 0045 private: 0046 CustomPropertySource* customSource(); 0047 }; 0048 } 0049 0050 #endif // KUSERFEEDBACK_QTVERSIONSOURCE_H