Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
ParameterUser.h
1#ifndef CPARAMETERUSERPASSWORD_H
2#define CPARAMETERUSERPASSWORD_H
3
4#include "ParameterConnecter.h"
5
21class CLIENT_EXPORT CParameterUser : public CParameterConnecter
22{
23 Q_OBJECT
24
25public:
26 explicit CParameterUser(CParameterConnecter* parent,
27 const QString& szPrefix = QString());
28
29 enum class TYPE{
30 None,
31 OnlyPassword,
32 UserPassword,
33 PublicKey,
42 OnlyPasswordX509None,
43 OnlyPasswordX509,
44 UserPasswordX509None,
45 UserPasswordX509
46 };
47 Q_ENUM(TYPE)
48 QList<TYPE> GetType() const;
49 int SetType(QList<TYPE> type);
50 TYPE GetUsedType() const;
51 int SetUsedType(TYPE type);
52
53 const QString GetUser() const;
54 void SetUser(const QString& szUser);
55
56 const QString GetPassword() const;
57 void SetPassword(const QString& szPassword);
58
59 const bool GetSavePassword() const;
64 void SetSavePassword(bool save);
65
66 bool GetUseSystemFile() const;
67 int SetUseSystemFile(bool use);
68
69 QString GetPublicKeyFile() const;
70 int SetPublicKeyFile(const QString szFile);
71
72 QString GetPrivateKeyFile() const;
73 int SetPrivateKeyFile(const QString szFile);
74
75 QString GetPassphrase() const;
76 int SetPassphrase(const QString passphrase);
77
78 bool GetSavePassphrase() const;
79 int SetSavePassphrase(bool bSave);
80
81 QString GetCAFile() const;
82 int SetCAFile(const QString& ca);
83
84 QString GetCRLFile() const;
85 int SetCRLFile(const QString& crl);
86
87 int SetTypeName(TYPE t, const QString& szName);
88 QString ConvertTypeToName(TYPE t);
89
90protected:
91 virtual int OnLoad(QSettings &set) override;
92 virtual int OnSave(QSettings &set) override;
93
94protected Q_SLOTS:
95 // CParameterConnecter interface
96 virtual void slotSetParameterClient() override;
97
98private:
99 QList<TYPE> m_Type;
100 TYPE m_UsedType;
101
102 QString m_szUser;
103
104 // Password
105 QString m_szPassword;
106 bool m_bSavePassword;
107
108 // Public key
109 bool m_bUseSystemFile;
110 QString m_szPublicKeyFile;
111 QString m_szPrivateKeyFile;
112 QString m_szPassphrase;
113 bool m_bSavePassphrase;
114
115 QString m_szCAFile;
116 QString m_szCRLFile;
117
118 QMap<TYPE, QString> m_TypeName;
119};
120
121#endif // CPARAMETERUSERPASSWORD_H
the parameters of connecter interface.
virtual void slotSetParameterClient()
Call after set CParameterClient.
It contains user and password It only valid in plugin.