summaryrefslogtreecommitdiff
path: root/app/gdp-hmi-launcher2/gdp-hmi-launcher2.h
diff options
context:
space:
mode:
Diffstat (limited to 'app/gdp-hmi-launcher2/gdp-hmi-launcher2.h')
-rw-r--r--app/gdp-hmi-launcher2/gdp-hmi-launcher2.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/app/gdp-hmi-launcher2/gdp-hmi-launcher2.h b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.h
new file mode 100644
index 0000000..d13e91b
--- /dev/null
+++ b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.h
@@ -0,0 +1,65 @@
+/**
+ * SPDX license identifier: MPL-2.0
+ *
+ * Copyright (C) 2015, GENIVI Alliance
+ *
+ * This file is part of GENIVI Demo Platform HMI.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License (MPL), v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * For further information see http://www.genivi.org/.
+ *
+ * List of changes:
+ * 16.Mar.2015, Sebastien Baudouin, written
+ * 16.Mar.2015, Sebastien Baudouin, added supprot for dbus
+ */
+
+#ifndef GDP_HMI_LAUNCHER2_H
+#define GDP_HMI_LAUNCHER2_H
+
+#include <QDebug>
+#include <QObject>
+#include <QString>
+#include <QtDBus>
+
+#include <signal.h>
+#include <sys/types.h>
+#include <systemd/sd-journal.h>
+
+#include "gdp-hmi-introspect_interface.h"
+
+class GDPLauncherClass : public QObject
+{
+ Q_OBJECT
+
+public:
+ GDPLauncherClass();
+ ~GDPLauncherClass();
+
+public slots:
+ void hmiRequestOffSlot() {
+ QString unit = QStringLiteral("poweroff.target");
+ QString status = m_controller->Show(unit);
+ sd_journal_print(LOG_DEBUG,
+ "DEBUG: controller->Show(\"%s\") -> %s\n",
+ unit.toLatin1().data(), status.toLatin1().data());
+ }
+ void hmiAppLaunchSlot(const QString &unit) {
+ QString status = m_controller->Show(unit);
+ sd_journal_print(LOG_DEBUG,
+ "DEBUG: controller->Show(\"%s\") -> %s\n",
+ unit.toLatin1().data(), status.toLatin1().data());
+ }
+
+protected:
+ void timerEvent(QTimerEvent *event);
+
+private:
+ pid_t m_hmiControllerPid;
+ int m_timerId;
+ org::genivi::gdp::HMI_Controller *m_controller;
+};
+
+#endif // GDP_HMI_LAUNCHER2_H