| 1 | // Copyright (C) 2018 The Qt Company Ltd. | 
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only | 
| 3 | |
| 4 | #ifndef QOPCUAAUTHENTICATIONINFORMATION_H | 
| 5 | #define QOPCUAAUTHENTICATIONINFORMATION_H | 
| 6 | |
| 7 | #include <QtOpcUa/qopcuaglobal.h> | 
| 8 | #include <QtCore/qshareddata.h> | 
| 9 | #include <QtCore/qvariant.h> | 
| 10 | |
| 11 | #include <QtOpcUa/QOpcUaUserTokenPolicy> | 
| 12 | |
| 13 | QT_BEGIN_NAMESPACE | 
| 14 | |
| 15 | class QOpcUaAuthenticationInformationData; | 
| 16 | class Q_OPCUA_EXPORT QOpcUaAuthenticationInformation | 
| 17 | { | 
| 18 | Q_GADGET | 
| 19 | |
| 20 | public: | 
| 21 | QOpcUaAuthenticationInformation(); | 
| 22 | QOpcUaAuthenticationInformation(const QOpcUaAuthenticationInformation &); | 
| 23 | QOpcUaAuthenticationInformation &operator=(const QOpcUaAuthenticationInformation &); | 
| 24 | bool operator==(const QOpcUaAuthenticationInformation &rhs) const; | 
| 25 | ~QOpcUaAuthenticationInformation(); | 
| 26 | |
| 27 | Q_INVOKABLE void setAnonymousAuthentication(); | 
| 28 | Q_INVOKABLE void setUsernameAuthentication(const QString &username, const QString &password); | 
| 29 | Q_INVOKABLE void setCertificateAuthentication(); | 
| 30 | |
| 31 | const QVariant &authenticationData() const; | 
| 32 | Q_INVOKABLE QOpcUaUserTokenPolicy::TokenType authenticationType() const; | 
| 33 | |
| 34 | private: | 
| 35 | QSharedDataPointer<QOpcUaAuthenticationInformationData> data; | 
| 36 | }; | 
| 37 | |
| 38 | QT_END_NAMESPACE | 
| 39 | |
| 40 | Q_DECLARE_METATYPE(QOpcUaAuthenticationInformation) | 
| 41 | |
| 42 | #endif // QOPCUAAUTHETICATIONINFORMATION_H | 
| 43 | 
