#include <string>
#include <QVariant>
#include <QPair>
-#include <QMap>
-
+//#include <QMap>
#include <libhomescreen.hpp>
#include <qlibwindowmanager.h>
#include "hmi-debug.h"
-#define ROLE_NAME "on_screen.app"
#define APP_ID "onscreenapp"
-class QQuickWindow;
+class QQmlApplicationEngine;
class EventHandler : public QObject
{
public:
explicit EventHandler(QObject *parent = 0);
~EventHandler();
+ EventHandler(const EventHandler&) = delete;
+ EventHandler& operator=(const EventHandler&) = delete;
void init(int port, const char* token);
- void setQuickWindow(QQuickWindow *qw);
-
void onRep(struct json_object* reply_contents);
static void* myThis;
static void onRep_static(struct json_object* reply_contents);
- void activateWindow(QString &role);
- Q_INVOKABLE void deactivateWindow(QString &role);
+ Q_INVOKABLE void deactivateWindow();
Q_INVOKABLE void onScreenReply(const QString &btn_name);
signals:
- void signalLoader(QVariant url);
- void signalOnScreenParameter(QVariant text);
+ void updateModel(QVariant data);
+ void showOnScreen();
+ void hideOnScreen();
private:
+ enum {
+ HIDING = 0,
+ SHOWING,
+ SWAPPING
+ };
+
+ int getDisplayStatus() {return m_dsp_sts;}
+ void setDisplayStatus(int sts) {m_dsp_sts = sts;}
+ void activateWindow(const char *role, const char *area = "normal.full");
LibHomeScreen *mp_hs;
QLibWindowmanager* mp_wm;
-
- QQuickWindow *mp_qw;
-
- QMap<QString, QPair<QString, QString>> m_req;
- QString m_dspreq;
- QString my_id;
- QString my_role;
+ QPair<QString, QString> m_req, m_dsp;
+ int m_dsp_sts = HIDING;
};
-
#endif // HOMESCREENHANDLER_H