1// Copyright (C) 2015 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 QOPCUAEXTENSIONOBJECT_H
5#define QOPCUAEXTENSIONOBJECT_H
6
7#include <QtOpcUa/qopcuaglobal.h>
8
9#include <QtCore/qshareddata.h>
10#include <QtCore/qvariant.h>
11
12QT_BEGIN_NAMESPACE
13
14class QOpcUaExtensionObjectData;
15class Q_OPCUA_EXPORT QOpcUaExtensionObject
16{
17public:
18 enum Encoding {
19 NoBody = 0,
20 ByteString = 1,
21 Xml = 2
22 };
23
24 QOpcUaExtensionObject();
25 QOpcUaExtensionObject(const QOpcUaExtensionObject &);
26 ~QOpcUaExtensionObject();
27 QOpcUaExtensionObject &operator=(const QOpcUaExtensionObject &);
28 bool operator==(const QOpcUaExtensionObject &rhs) const;
29 operator QVariant() const;
30
31 QString encodingTypeId() const;
32 void setEncodingTypeId(const QString &encodingTypeId);
33
34 QByteArray encodedBody() const;
35 QByteArray &encodedBodyRef();
36 void setEncodedBody(const QByteArray &encodedBody);
37
38 void setBinaryEncodedBody(const QByteArray &encodedBody, const QString &typeId);
39 void setXmlEncodedBody(const QByteArray &encodedBody, const QString &typeId);
40
41 QOpcUaExtensionObject::Encoding encoding() const;
42 void setEncoding(QOpcUaExtensionObject::Encoding encoding);
43
44private:
45 QSharedDataPointer<QOpcUaExtensionObjectData> data;
46};
47
48QT_END_NAMESPACE
49
50Q_DECLARE_METATYPE(QOpcUaExtensionObject)
51
52#endif // QOPCUAEXTENSIONOBJECT_H
53

source code of qtopcua/src/opcua/client/qopcuaextensionobject.h