#ifndef BOBINKAUTH_H #define BOBINKAUTH_H #include #include #include class BobinkAuth : public QObject { Q_OBJECT QML_ELEMENT Q_PROPERTY(AuthMode mode READ mode WRITE setMode NOTIFY modeChanged) Q_PROPERTY( QString username READ username WRITE setUsername NOTIFY usernameChanged) Q_PROPERTY( QString password READ password WRITE setPassword NOTIFY passwordChanged) Q_PROPERTY( QString certPath READ certPath WRITE setCertPath NOTIFY certPathChanged) Q_PROPERTY( QString keyPath READ keyPath WRITE setKeyPath NOTIFY keyPathChanged) public: enum AuthMode { Anonymous, UserPass, Certificate }; Q_ENUM(AuthMode) explicit BobinkAuth(QObject *parent = nullptr); AuthMode mode() const; void setMode(AuthMode mode); QString username() const; void setUsername(const QString &username); QString password() const; void setPassword(const QString &password); QString certPath() const; void setCertPath(const QString &path); QString keyPath() const; void setKeyPath(const QString &path); QOpcUaAuthenticationInformation toAuthenticationInformation() const; signals: void modeChanged(); void usernameChanged(); void passwordChanged(); void certPathChanged(); void keyPathChanged(); private: AuthMode m_mode = Anonymous; QString m_username; QString m_password; QString m_certPath; QString m_keyPath; }; #endif // BOBINKAUTH_H