| 
									
										
										
										
											2018-06-12 10:29:40 +02:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							|  |  |  | #ifndef QMLPREFS_H
 | 
					
						
							|  |  |  | #define QMLPREFS_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QObject>
 | 
					
						
							| 
									
										
										
										
											2018-09-08 19:46:11 +02:00
										 |  |  | #include "core/settings/qPrefCloudStorage.h"
 | 
					
						
							|  |  |  | #include "core/settings/qPrefDisplay.h"
 | 
					
						
							| 
									
										
										
										
											2018-06-12 10:29:40 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class QMLPrefs : public QObject { | 
					
						
							|  |  |  | 	Q_OBJECT | 
					
						
							| 
									
										
										
										
											2018-06-13 18:06:11 +02:00
										 |  |  | 	Q_PROPERTY(QString cloudPassword | 
					
						
							|  |  |  | 				MEMBER m_cloudPassword | 
					
						
							|  |  |  | 				WRITE setCloudPassword | 
					
						
							|  |  |  | 				NOTIFY cloudPasswordChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(QString cloudPin | 
					
						
							|  |  |  | 				MEMBER m_cloudPin | 
					
						
							|  |  |  | 				WRITE setCloudPin | 
					
						
							|  |  |  | 				NOTIFY cloudPinChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(QString cloudUserName | 
					
						
							|  |  |  | 				MEMBER m_cloudUserName | 
					
						
							|  |  |  | 				WRITE setCloudUserName | 
					
						
							|  |  |  | 				NOTIFY cloudUserNameChanged) | 
					
						
							| 
									
										
										
										
											2018-09-02 16:22:16 +02:00
										 |  |  | 	Q_PROPERTY(qPrefCloudStorage::cloud_status credentialStatus | 
					
						
							| 
									
										
										
										
											2018-06-13 18:06:11 +02:00
										 |  |  | 				MEMBER m_credentialStatus | 
					
						
							|  |  |  | 				WRITE setCredentialStatus | 
					
						
							|  |  |  | 				NOTIFY credentialStatusChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(bool showPin | 
					
						
							|  |  |  | 				MEMBER m_showPin | 
					
						
							|  |  |  | 				WRITE setShowPin | 
					
						
							|  |  |  | 				NOTIFY showPinChanged) | 
					
						
							| 
									
										
										
										
											2018-09-02 16:22:16 +02:00
										 |  |  | 	Q_PROPERTY(qPrefCloudStorage::cloud_status oldStatus | 
					
						
							| 
									
										
										
										
											2018-06-13 18:06:11 +02:00
										 |  |  | 				MEMBER m_oldStatus | 
					
						
							|  |  |  | 				WRITE setOldStatus | 
					
						
							|  |  |  | 				NOTIFY oldStatusChanged) | 
					
						
							| 
									
										
										
										
											2018-06-12 10:29:40 +02:00
										 |  |  | public: | 
					
						
							|  |  |  | 	QMLPrefs(); | 
					
						
							|  |  |  | 	~QMLPrefs(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	static QMLPrefs *instance(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-13 18:06:11 +02:00
										 |  |  | 	const QString cloudPassword() const; | 
					
						
							|  |  |  | 	void setCloudPassword(const QString &cloudPassword); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	const QString cloudPin() const; | 
					
						
							|  |  |  | 	void setCloudPin(const QString &cloudPin); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	const QString cloudUserName() const; | 
					
						
							|  |  |  | 	void setCloudUserName(const QString &cloudUserName); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-02 16:22:16 +02:00
										 |  |  | 	qPrefCloudStorage::cloud_status credentialStatus() const; | 
					
						
							|  |  |  | 	void setCredentialStatus(const qPrefCloudStorage::cloud_status value); | 
					
						
							| 
									
										
										
										
											2018-06-13 18:06:11 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-02 16:22:16 +02:00
										 |  |  | 	qPrefCloudStorage::cloud_status oldStatus() const; | 
					
						
							|  |  |  | 	void setOldStatus(const qPrefCloudStorage::cloud_status value); | 
					
						
							| 
									
										
										
										
											2018-06-13 18:06:11 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	bool showPin() const; | 
					
						
							|  |  |  | 	void setShowPin(bool enable); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-12 10:29:40 +02:00
										 |  |  | public slots: | 
					
						
							| 
									
										
										
										
											2018-06-13 18:06:11 +02:00
										 |  |  | 	void cancelCredentialsPinSetup(); | 
					
						
							|  |  |  | 	void clearCredentials(); | 
					
						
							| 
									
										
										
										
											2018-06-12 10:29:40 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2018-06-13 18:06:11 +02:00
										 |  |  | 	QString m_cloudPassword; | 
					
						
							|  |  |  | 	QString m_cloudPin; | 
					
						
							|  |  |  | 	QString m_cloudUserName; | 
					
						
							| 
									
										
										
										
											2018-09-02 16:22:16 +02:00
										 |  |  | 	qPrefCloudStorage::cloud_status m_credentialStatus; | 
					
						
							| 
									
										
										
										
											2018-06-12 10:29:40 +02:00
										 |  |  | 	static QMLPrefs *m_instance; | 
					
						
							| 
									
										
										
										
											2018-09-02 16:22:16 +02:00
										 |  |  | 	qPrefCloudStorage::cloud_status m_oldStatus; | 
					
						
							| 
									
										
										
										
											2018-06-13 18:06:11 +02:00
										 |  |  | 	bool m_showPin; | 
					
						
							| 
									
										
										
										
											2018-06-12 10:29:40 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | signals: | 
					
						
							| 
									
										
										
										
											2018-06-13 18:06:11 +02:00
										 |  |  | 	void cloudPasswordChanged(); | 
					
						
							|  |  |  | 	void cloudPinChanged(); | 
					
						
							|  |  |  | 	void cloudUserNameChanged(); | 
					
						
							|  |  |  | 	void credentialStatusChanged(); | 
					
						
							|  |  |  | 	void oldStatusChanged(); | 
					
						
							|  |  |  | 	void showPinChanged(); | 
					
						
							| 
									
										
										
										
											2018-06-12 10:29:40 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 |