| 1 | // Copyright (C) 2023 basysKom GmbH, opensource@basyskom.com | 
|---|---|
| 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 QOPCUACONNECTIONSETTINGS_H | 
| 5 | #define QOPCUACONNECTIONSETTINGS_H | 
| 6 | |
| 7 | #include <QtOpcUa/qopcuaglobal.h> | 
| 8 | |
| 9 | #include <QtCore/qcontainerfwd.h> | 
| 10 | #include <QtCore/qshareddata.h> | 
| 11 | |
| 12 | #include <chrono> | 
| 13 | |
| 14 | QT_BEGIN_NAMESPACE | 
| 15 | |
| 16 | class QOpcUaConnectionSettingsData; | 
| 17 | QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QOpcUaConnectionSettingsData, Q_OPCUA_EXPORT) | 
| 18 | class QOpcUaConnectionSettings | 
| 19 | { | 
| 20 | public: | 
| 21 | Q_OPCUA_EXPORT QOpcUaConnectionSettings(); | 
| 22 | Q_OPCUA_EXPORT QOpcUaConnectionSettings(const QOpcUaConnectionSettings &other); | 
| 23 | Q_OPCUA_EXPORT QOpcUaConnectionSettings &operator=(const QOpcUaConnectionSettings &rhs); | 
| 24 | QOpcUaConnectionSettings(QOpcUaConnectionSettings &&other) noexcept = default; | 
| 25 | QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QOpcUaConnectionSettings) | 
| 26 | Q_OPCUA_EXPORT ~QOpcUaConnectionSettings(); | 
| 27 | |
| 28 | void swap(QOpcUaConnectionSettings &other) noexcept { data.swap(other&: other.data); } | 
| 29 | |
| 30 | Q_OPCUA_EXPORT QStringList sessionLocaleIds() const; | 
| 31 | Q_OPCUA_EXPORT void setSessionLocaleIds(const QStringList &localeIds); | 
| 32 | |
| 33 | Q_OPCUA_EXPORT std::chrono::milliseconds secureChannelLifeTime() const; | 
| 34 | Q_OPCUA_EXPORT void setSecureChannelLifeTime(std::chrono::milliseconds lifeTime); | 
| 35 | |
| 36 | Q_OPCUA_EXPORT std::chrono::milliseconds sessionTimeout() const; | 
| 37 | Q_OPCUA_EXPORT void setSessionTimeout(std::chrono::milliseconds timeout); | 
| 38 | |
| 39 | Q_OPCUA_EXPORT std::chrono::milliseconds requestTimeout() const; | 
| 40 | Q_OPCUA_EXPORT void setRequestTimeout(std::chrono::milliseconds timeout); | 
| 41 | |
| 42 | Q_OPCUA_EXPORT std::chrono::milliseconds connectTimeout() const; | 
| 43 | Q_OPCUA_EXPORT void setConnectTimeout(std::chrono::milliseconds timeout); | 
| 44 | |
| 45 | private: | 
| 46 | friend Q_OPCUA_EXPORT bool operator==(const QOpcUaConnectionSettings &lhs, | 
| 47 | const QOpcUaConnectionSettings &rhs) noexcept; | 
| 48 | friend bool operator!=(const QOpcUaConnectionSettings &lhs, | 
| 49 | const QOpcUaConnectionSettings &rhs) noexcept | 
| 50 | { return !(lhs == rhs); } | 
| 51 | |
| 52 | private: | 
| 53 | QExplicitlySharedDataPointer<QOpcUaConnectionSettingsData> data; | 
| 54 | }; | 
| 55 | Q_DECLARE_SHARED(QOpcUaConnectionSettings) | 
| 56 | |
| 57 | QT_END_NAMESPACE | 
| 58 | |
| 59 | #endif // QOPCUACONNECTIONSETTINGS_H | 
| 60 | 
