Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
ParameterService.h
1// Author: Kang Lin <kl222@126.com>
2
3#ifndef CPARAMETERSERVICE_H
4#define CPARAMETERSERVICE_H
5
6#include <QObject>
7#include "service_export.h"
8
9class SERVICE_EXPORT CParameterService : public QObject
10{
11 Q_OBJECT
12 Q_PROPERTY(quint16 Port READ getPort WRITE setPort NOTIFY PortChanged)
13 Q_PROPERTY(bool Enable READ getEnable WRITE setEnable NOTIFY EnableChanged)
14 Q_PROPERTY(QString Password READ getPassword WRITE setPassword NOTIFY PasswordChanged)
15
16public:
17 explicit CParameterService(QObject *parent = nullptr);
18 virtual ~CParameterService();
19
20 virtual int Load(const QString& szFile = QString());
21 virtual int Save(const QString& szFile = QString());
22
23 quint16 getPort() const;
24 void setPort(quint16 newPort);
25
26 bool getEnable() const;
27 void setEnable(bool newEnable);
28
29 const QString &getPassword() const;
30 void setPassword(const QString &newPassword);
31
32signals:
33 void PortChanged();
34 void EnableChanged();
35 void PasswordChanged();
36
37private:
38 quint16 m_nPort;
39 bool m_bEnable;
40 QString m_szPassword;
41};
42
43#endif // CPARAMETERSERVICE_H