1// Copyright (C) 2019 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 OPCUAFILTERELEMENT_P_H
5#define OPCUAFILTERELEMENT_P_H
6
7#include <private/opcuaoperandbase_p.h>
8
9#include <QOpcUaContentFilterElement>
10
11#include <QObject>
12#include <QtQml/qqml.h>
13
14//
15// W A R N I N G
16// -------------
17//
18// This file is not part of the Qt API. It exists purely as an
19// implementation detail. This header file may change from version to
20// version without notice, or even be removed.
21//
22// We mean it.
23//
24
25QT_BEGIN_NAMESPACE
26
27class QOpcUaClient;
28
29class OpcUaFilterElement : public QObject {
30 Q_OBJECT
31 Q_PROPERTY(FilterOperator operator READ operatorType WRITE setOperatorType)
32 Q_PROPERTY(OpcUaOperandBase* firstOperand READ firstOperand WRITE setFirstOperand)
33 Q_PROPERTY(OpcUaOperandBase* secondOperand READ secondOperand WRITE setSecondOperand)
34
35 QML_NAMED_ELEMENT(FilterElement)
36 QML_ADDED_IN_VERSION(5, 13)
37
38public:
39 // Same as in qopcuacontentfilterelement.h
40 // Specified in OPC-UA part 4, Tables 115 and 116
41 enum class FilterOperator : quint32 {
42 Equals = 0,
43 IsNull = 1,
44 GreaterThan = 2,
45 LessThan = 3,
46 GreaterThanOrEqual = 4,
47 LessThanOrEqual = 5,
48 Like = 6,
49 Not = 7,
50 Between = 8,
51 InList = 9,
52 And = 10,
53 Or = 11,
54 Cast = 12,
55 InView = 13,
56 OfType = 14,
57 RelatedTo = 15,
58 BitwiseAnd = 16,
59 BitwiseOr = 17
60 };
61 Q_ENUM(FilterOperator);
62
63 explicit OpcUaFilterElement(QObject *parent = nullptr);
64 ~OpcUaFilterElement();
65 QOpcUaContentFilterElement toFilterElement(QOpcUaClient *);
66
67 FilterOperator operatorType() const;
68 void setOperatorType(FilterOperator filterOperator);
69
70 OpcUaOperandBase *firstOperand() const;
71 void setFirstOperand(OpcUaOperandBase *operand);
72
73 OpcUaOperandBase *secondOperand() const;
74 void setSecondOperand(OpcUaOperandBase *operand);
75
76signals:
77 void dataChanged();
78
79private:
80 FilterOperator m_filterOperator = FilterOperator::Equals;
81 OpcUaOperandBase *m_firstOperand = nullptr;
82 OpcUaOperandBase *m_secondOperand = nullptr;
83};
84
85QT_END_NAMESPACE
86
87#endif // OPCUAFILTERELEMENT_P_H
88

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