registerShortcut
[apps/homescreen.git] / homescreen / src / homescreenhandler.h
index 1a9a2b5..4afbac4 100644 (file)
@@ -18,7 +18,9 @@
 #define HOMESCREENHANDLER_H
 
 #include <QObject>
-#include <libhomescreen.hpp>
+#include <QQuickWindow>
+#include <qlibhomescreen.h>
+#include <qlibwindowmanager.h>
 #include <string>
 
 using namespace std;
@@ -30,9 +32,14 @@ public:
     explicit HomescreenHandler(QObject *parent = 0);
     ~HomescreenHandler();
 
-    void init(int port, const char* token);
+    void init(int port, const char* token, QLibWindowmanager *qwm, QString myname);
 
-    Q_INVOKABLE void tapShortcut(QString application_id);
+    Q_INVOKABLE void tapShortcut(QString application_name, bool is_full);
+    Q_INVOKABLE QString getCurrentApplication();
+    Q_INVOKABLE void killRunningApplications();
+    Q_INVOKABLE void reboot();
+    void setCurrentApplication(QString application_name);
+    int getPidOfApplication(QString application_name);
 
     void onRep(struct json_object* reply_contents);
     void onEv(const string& event, struct json_object* event_contents);
@@ -40,8 +47,23 @@ public:
     static void* myThis;
     static void onRep_static(struct json_object* reply_contents);
     static void onEv_static(const string& event, struct json_object* event_contents);
+    void setQuickWindow(QQuickWindow *qw);
+
+signals:
+    void showNotification(QString application_id, QString icon_path, QString text);
+    void showInformation(QString info);
+    void shortcutChanged(QString shortcut_id, QString shortcut_name, QString position);
+    void showWindow();
+    void hideWindow();
+
+public slots:
+    void updateShortcut(QString id, struct json_object* object);
+
 private:
-    LibHomeScreen *mp_hs;
+    QLibHomeScreen *mp_qhs;
+    QLibWindowmanager *mp_qwm;
+    QString m_myname;
+    QString current_application;
 };
 
 #endif // HOMESCREENHANDLER_H