add event tabble
[apps/agl-service-homescreen.git] / src / hs-clientmanager.h
index 5258090..49968f1 100644 (file)
@@ -48,16 +48,37 @@ public:
     void removeClientCtxt(void *data);
 
     int tap_shortcut(afb_req_t request);
+    int showWindow(afb_req_t request);
+    int hideWindow(afb_req_t request);
+    int replyShowWindow(afb_req_t request);
     int on_screen_message(afb_req_t request);
     int on_screen_reply(afb_req_t request);
     int subscribe(afb_req_t request);
     int unsubscribe(afb_req_t request);
+    int showNotification(afb_req_t request);
+    int showInformation(afb_req_t request);
+    int handleRequest(const char *verb, afb_req_t request);
+    int pushEvent(const char *event, struct json_object *param, std::string appid = "");
 
 private:
     HS_ClientCtxt* createClientCtxt(afb_req_t req, std::string appid);
     HS_Client* addClient(afb_req_t req, std::string appid);
     void removeClient(std::string appid);
 
+    typedef int (HS_ClientManager::*func_handler)(afb_req_t);
+    const std::unordered_map<std::string, func_handler> func_list {
+        {"tap_shortcut",        &HS_ClientManager::tap_shortcut},
+        {"showWindow",          &HS_ClientManager::showWindow},
+        {"hideWindow",          &HS_ClientManager::hideWindow},
+        {"replyShowWindow",     &HS_ClientManager::replyShowWindow},
+        {"on_screen_message",   &HS_ClientManager::on_screen_message},
+        {"on_screen_reply",     &HS_ClientManager::on_screen_reply},
+        {"subscribe",           &HS_ClientManager::subscribe},
+        {"unsubscribe",         &HS_ClientManager::unsubscribe},
+        {"showNotification",    &HS_ClientManager::showNotification},
+        {"showInformation",     &HS_ClientManager::showInformation}
+    };
+
 private:
     static HS_ClientManager* me;
     std::unordered_map<std::string, HS_Client*> client_list;