| 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 QOPCUA_OPCUAPATHRESOLVER_P_H |
| 5 | #define QOPCUA_OPCUAPATHRESOLVER_P_H |
| 6 | |
| 7 | #include <private/universalnode_p.h> |
| 8 | |
| 9 | #include <QObject> |
| 10 | #include <QPointer> |
| 11 | |
| 12 | #include "qopcuatype.h" |
| 13 | #include "qopcuabrowsepathtarget.h" |
| 14 | #include "qopcuarelativepathelement.h" |
| 15 | |
| 16 | // |
| 17 | // W A R N I N G |
| 18 | // ------------- |
| 19 | // |
| 20 | // This file is not part of the Qt API. It exists purely as an |
| 21 | // implementation detail. This header file may change from version to |
| 22 | // version without notice, or even be removed. |
| 23 | // |
| 24 | // We mean it. |
| 25 | // |
| 26 | |
| 27 | QT_BEGIN_NAMESPACE |
| 28 | |
| 29 | class QOpcUaNode; |
| 30 | class QOpcUaClient; |
| 31 | class OpcUaRelativeNodeId; |
| 32 | class QOpcUaClient; |
| 33 | |
| 34 | class OpcUaPathResolver : public QObject |
| 35 | { |
| 36 | Q_OBJECT |
| 37 | public: |
| 38 | OpcUaPathResolver(OpcUaRelativeNodeId *relativeNode, QOpcUaClient *client, QObject *target); |
| 39 | ~OpcUaPathResolver(); |
| 40 | void startResolving(); |
| 41 | |
| 42 | signals: |
| 43 | void resolvedStartNode(const UniversalNode &nodeId, const QString &errorMessage); |
| 44 | void resolvedNode(UniversalNode node, QString errorMessage); |
| 45 | |
| 46 | private slots: |
| 47 | void startNodeResolved(UniversalNode startNode, const QString &errorMessage); |
| 48 | void browsePathFinished(QList<QOpcUaBrowsePathTarget> results, QList<QOpcUaRelativePathElement> path, QOpcUa::UaStatusCode status); |
| 49 | |
| 50 | private: |
| 51 | OpcUaPathResolver(int level, OpcUaRelativeNodeId *relativeNode, QOpcUaClient *client, QObject *target); |
| 52 | |
| 53 | int m_level; |
| 54 | QPointer<OpcUaRelativeNodeId> m_relativeNode; |
| 55 | QPointer<QObject> m_target; |
| 56 | QPointer<QOpcUaClient> m_client; |
| 57 | QOpcUaNode *m_node; |
| 58 | }; |
| 59 | |
| 60 | QT_END_NAMESPACE |
| 61 | |
| 62 | #endif // QOPCUA_OPCUAPATHRESOLVER_P_H |
| 63 | |