summaryrefslogtreecommitdiff
path: root/SDL_Core/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'SDL_Core/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp')
-rw-r--r--SDL_Core/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/SDL_Core/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp b/SDL_Core/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp
new file mode 100644
index 000000000..a89d1efcb
--- /dev/null
+++ b/SDL_Core/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp
@@ -0,0 +1,31 @@
+#include "fordsdlcore_plugin.h"
+#include "smartdevicelink.h"
+#include <QDebug>
+#include <qqml.h>
+#include "sdlalert.h"
+#include <QQmlEngine>
+#include <QQmlContext>
+
+QObject* sdlSingleton(QQmlEngine * engine, QJSEngine * js) {
+ Q_UNUSED(engine)
+ Q_UNUSED(js)
+
+ engine->rootContext()->setContextProperty("MediaApps", SmartDeviceLink::getInstance().getMediaApps());
+
+ return (QObject *) &SmartDeviceLink::getInstance();
+}
+
+QObject* mediaAppsSingleton(QQmlEngine * engine, QJSEngine * js) {
+ Q_UNUSED(engine)
+ Q_UNUSED(js)
+
+ return (QObject *) SmartDeviceLink::getInstance().getMediaApps();
+}
+
+void FordSdlCorePlugin::registerTypes(const char *uri)
+{
+ qmlRegisterSingletonType<SdlAppsListModel>(uri, 1, 0, "MediaApps", mediaAppsSingleton);
+ qmlRegisterSingletonType<SmartDeviceLink>(uri, 1, 0, "AppLink", sdlSingleton);
+}
+
+