summaryrefslogtreecommitdiffstats
path: root/src/scxml/qscxmlecmascriptplatformproperties.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@theqtcompany.com>2015-09-17 15:19:07 +0200
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>2015-09-17 16:21:31 +0300
commitd3c3cac3d3edab1b5bdc44aeb24ad0f1d35f17f4 (patch)
treea205edc4c2a03e952e18aa552cd01c7e239c9cea /src/scxml/qscxmlecmascriptplatformproperties.cpp
parentffc2fa7af23336924e1b094dee8c57f7e53f6041 (diff)
Renamed files to (hopefully) match Qt naming.
Change-Id: Iaaebe835a6bdcfe934af10090b51973c10f38a90 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src/scxml/qscxmlecmascriptplatformproperties.cpp')
-rw-r--r--src/scxml/qscxmlecmascriptplatformproperties.cpp77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/scxml/qscxmlecmascriptplatformproperties.cpp b/src/scxml/qscxmlecmascriptplatformproperties.cpp
new file mode 100644
index 0000000..c41ea8c
--- /dev/null
+++ b/src/scxml/qscxmlecmascriptplatformproperties.cpp
@@ -0,0 +1,77 @@
+/****************************************************************************
+ **
+ ** Copyright (c) 2015 Digia Plc
+ ** For any questions to Digia, please use contact form at http://qt.digia.com/
+ **
+ ** All Rights Reserved.
+ **
+ ** NOTICE: All information contained herein is, and remains
+ ** the property of Digia Plc and its suppliers,
+ ** if any. The intellectual and technical concepts contained
+ ** herein are proprietary to Digia Plc
+ ** and its suppliers and may be covered by Finnish and Foreign Patents,
+ ** patents in process, and are protected by trade secret or copyright law.
+ ** Dissemination of this information or reproduction of this material
+ ** is strictly forbidden unless prior written permission is obtained
+ ** from Digia Plc.
+ ****************************************************************************/
+
+#include "qscxmlecmascriptplatformproperties_p.h"
+#include "qscxmlstatemachine.h"
+
+QT_BEGIN_NAMESPACE
+class QScxmlPlatformProperties::Data
+{
+public:
+ Data()
+ : m_table(Q_NULLPTR)
+ {}
+
+ QScxmlStateMachine *m_table;
+ QJSValue m_jsValue;
+};
+QT_END_NAMESPACE
+
+QScxmlPlatformProperties::QScxmlPlatformProperties(QObject *parent)
+ : QObject(parent)
+ , data(new Data)
+{}
+
+QScxmlPlatformProperties *QScxmlPlatformProperties::create(QJSEngine *engine, QScxmlStateMachine *table)
+{
+ QScxmlPlatformProperties *pp = new QScxmlPlatformProperties(engine);
+ pp->data->m_table = table;
+ pp->data->m_jsValue = engine->newQObject(pp);
+ return pp;
+}
+
+QScxmlPlatformProperties::~QScxmlPlatformProperties()
+{
+ delete data;
+}
+
+QJSEngine *QScxmlPlatformProperties::engine() const
+{
+ return qobject_cast<QJSEngine *>(parent());
+}
+
+QScxmlStateMachine *QScxmlPlatformProperties::stateMachine() const
+{
+ return data->m_table;
+}
+
+QJSValue QScxmlPlatformProperties::jsValue() const
+{
+ return data->m_jsValue;
+}
+
+/// _x.marks() == "the spot"
+QString QScxmlPlatformProperties::marks() const
+{
+ return QStringLiteral("the spot");
+}
+
+bool QScxmlPlatformProperties::In(const QString &stateName)
+{
+ return stateMachine()->isActive(stateName);
+}