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#pragma once
5
6#include <QObject>
7#include <qopcuatype.h>
8
9#include <private/universalnode_p.h>
10
11#include <QtQml/qqml.h>
12
13//
14// W A R N I N G
15// -------------
16//
17// This file is not part of the Qt API. It exists purely as an
18// implementation detail. This header file may change from version to
19// version without notice, or even be removed.
20//
21// We mean it.
22//
23
24QT_BEGIN_NAMESPACE
25
26class QOpcUaClient;
27class QOpcUaRelativePathElement;
28
29class OpcUaRelativeNodePath : public QObject
30{
31 Q_OBJECT
32 Q_PROPERTY(QString ns READ nodeNamespace WRITE setNodeNamespace NOTIFY nodeNamespaceChanged)
33 Q_PROPERTY(QString browseName READ browseName WRITE setBrowseName NOTIFY browseNameChanged)
34 Q_PROPERTY(QVariant referenceType READ referenceType WRITE setReferenceType NOTIFY referenceTypeChanged)
35 Q_PROPERTY(bool includeSubtypes READ includeSubtypes WRITE setIncludeSubtypes NOTIFY includeSubtypesChanged)
36 Q_PROPERTY(bool isInverse READ isInverse WRITE setIsInverse NOTIFY isInverseChanged)
37
38 QML_NAMED_ELEMENT(RelativeNodePath)
39 QML_ADDED_IN_VERSION(5, 12)
40
41public:
42 explicit OpcUaRelativeNodePath(QObject *parent = nullptr);
43 const QString &nodeNamespace() const;
44 const QString &browseName() const;
45 QVariant referenceType() const;
46 bool includeSubtypes() const;
47 bool isInverse() const;
48 QOpcUaRelativePathElement toRelativePathElement(QOpcUaClient *client) const;
49
50signals:
51 void nodeNamespaceChanged(QString ns);
52 void browseNameChanged(QString browseName);
53 void referenceTypeChanged();
54 void includeSubtypesChanged(bool includeSubtypes);
55 void isInverseChanged(bool isInverse);
56
57public slots:
58 void setNodeNamespace(QString ns);
59 void setBrowseName(QString browseName);
60 void setReferenceType(const QVariant &referenceType);
61 void setIncludeSubtypes(bool includeSubtypes);
62 void setIsInverse(bool isInverse);
63
64private:
65 mutable UniversalNode m_browseNode;
66 QVariant m_referenceType = QVariant::fromValue(value: QOpcUa::ReferenceTypeId::References);
67 bool m_includeSubtypes = true;
68 bool m_isInverse = false;
69};
70
71QT_END_NAMESPACE
72

source code of qtopcua/src/declarative_opcua/opcuarelativenodepath_p.h