1// Copyright (C) 2016 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 QSCXMLEVENT_H
5#define QSCXMLEVENT_H
6
7#include <QtScxml/qscxmlglobals.h>
8
9#include <QtCore/qstringlist.h>
10#include <QtCore/qvariant.h>
11
12QT_BEGIN_NAMESPACE
13
14class QScxmlEventPrivate;
15
16class Q_SCXML_EXPORT QScxmlEvent
17{
18 Q_GADGET
19 Q_PROPERTY(QString name READ name WRITE setName)
20 Q_PROPERTY(EventType eventType READ eventType WRITE setEventType)
21 Q_PROPERTY(QString scxmlType READ scxmlType)
22 Q_PROPERTY(QString sendId READ sendId WRITE setSendId)
23 Q_PROPERTY(QString origin READ origin WRITE setOrigin)
24 Q_PROPERTY(QString originType READ originType WRITE setOriginType)
25 Q_PROPERTY(QString invokeId READ invokeId WRITE setInvokeId)
26 Q_PROPERTY(int delay READ delay WRITE setDelay)
27 Q_PROPERTY(QVariant data READ data WRITE setData)
28 Q_PROPERTY(bool errorEvent READ isErrorEvent)
29 Q_PROPERTY(QString errorMessage READ errorMessage WRITE setErrorMessage)
30
31public:
32 QScxmlEvent();
33 ~QScxmlEvent();
34
35 QScxmlEvent &operator=(const QScxmlEvent &other);
36 QScxmlEvent(const QScxmlEvent &other);
37
38 enum EventType {
39 PlatformEvent,
40 InternalEvent,
41 ExternalEvent
42 };
43 Q_ENUM(EventType)
44
45 QString name() const;
46 void setName(const QString &name);
47
48 EventType eventType() const;
49 void setEventType(const EventType &type);
50
51 QString scxmlType() const;
52
53 QString sendId() const;
54 void setSendId(const QString &sendId);
55
56 QString origin() const;
57 void setOrigin(const QString &origin);
58
59 QString originType() const;
60 void setOriginType(const QString &originType);
61
62 QString invokeId() const;
63 void setInvokeId(const QString &invokeId);
64
65 int delay() const;
66 void setDelay(int delayInMiliSecs);
67
68 Q_INVOKABLE void clear();
69
70 QVariant data() const;
71 void setData(const QVariant &data);
72
73 bool isErrorEvent() const;
74 QString errorMessage() const;
75 void setErrorMessage(const QString &message);
76
77private:
78 QScxmlEventPrivate *d;
79
80};
81
82QT_END_NAMESPACE
83
84Q_DECLARE_METATYPE(QScxmlEvent)
85
86#endif // QSCXMLEVENT_H
87

source code of qtscxml/src/scxml/qscxmlevent.h