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 QSCXMLECMASCRIPTDATAMODEL_P_H
5#define QSCXMLECMASCRIPTDATAMODEL_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QObject>
19#include <QtScxml/qscxmlglobals.h>
20#include <QtScxml/qscxmldatamodel.h>
21
22QT_BEGIN_NAMESPACE
23
24
25class QScxmlEcmaScriptDataModelPrivate;
26class QScxmlEcmaScriptDataModel: public QScxmlDataModel
27{
28 Q_OBJECT
29 Q_DECLARE_PRIVATE(QScxmlEcmaScriptDataModel)
30public:
31 explicit QScxmlEcmaScriptDataModel(QObject *parent = nullptr);
32
33 Q_INVOKABLE bool setup(const QVariantMap &initialDataValues) override;
34
35 QString evaluateToString(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final;
36 bool evaluateToBool(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final;
37 QVariant evaluateToVariant(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final;
38 void evaluateToVoid(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final;
39 void evaluateAssignment(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final;
40 void evaluateInitialization(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final;
41 void evaluateForeach(QScxmlExecutableContent::EvaluatorId id, bool *ok, ForeachLoopBody *body) override final;
42
43 void setScxmlEvent(const QScxmlEvent &event) override;
44
45 QVariant scxmlProperty(const QString &name) const override;
46 bool hasScxmlProperty(const QString &name) const override;
47 bool setScxmlProperty(const QString &name, const QVariant &value, const QString &context) override;
48};
49
50QT_END_NAMESPACE
51
52#endif // QSCXMLECMASCRIPTDATAMODEL_P_H
53

source code of qtscxml/src/plugins/ecmascriptdatamodel/qscxmlecmascriptdatamodel_p.h