aboutsummaryrefslogtreecommitdiffstats
path: root/src/hs-clientmanager.h
diff options
context:
space:
mode:
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-01-08 09:40:05 +0800
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-01-08 09:40:05 +0800
commit64b268e9c1151c1ccff3b9a20cbe3901f347e9ee (patch)
tree86448680504c91d0f988ba944cc8e9708c9e0637 /src/hs-clientmanager.h
parent0a47c007af262ac91bfa219a7b848aa0046005b3 (diff)
add event tabble
Change-Id: Ic6897f79ecc63ee869b51915b88679d382b95ea6
Diffstat (limited to 'src/hs-clientmanager.h')
-rw-r--r--src/hs-clientmanager.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/hs-clientmanager.h b/src/hs-clientmanager.h
index a568298..49968f1 100644
--- a/src/hs-clientmanager.h
+++ b/src/hs-clientmanager.h
@@ -57,6 +57,7 @@ public:
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:
@@ -64,6 +65,20 @@ private:
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;