X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fhs-clientmanager.h;h=7ca6411d9b6cad04ef43b6c6f57a7db73fcc6a57;hb=89edd734c0a347dafceba1cef1ac835e0fe61e1a;hp=52580905a35179b6a64e0c650acc7024f8646722;hpb=d58138e0ceb19b3f201ec5e6e7126015db2cfead;p=apps%2Fagl-service-homescreen.git diff --git a/src/hs-clientmanager.h b/src/hs-clientmanager.h index 5258090..7ca6411 100644 --- a/src/hs-clientmanager.h +++ b/src/hs-clientmanager.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018 TOYOTA MOTOR CORPORATION + * Copyright (C) 2020 Konsulko Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,14 +25,13 @@ #include "hs-helper.h" #include "hs-client.h" -typedef struct HS_ClientCtxt -{ +struct HS_ClientCtxt { std::string id; - HS_ClientCtxt(const char *appid) + HS_ClientCtxt(const std::string &appid) { id = appid; } -} HS_ClientCtxt; +}; class HS_ClientManager { @@ -45,13 +45,9 @@ public: static HS_ClientManager* instance(void); int init(void); - void removeClientCtxt(void *data); - - int tap_shortcut(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 handleRequest(afb_req_t request, const char *verb, const char *appid = nullptr); + int pushEvent(const char *event, struct json_object *param, std::string appid = ""); + void removeClientCtxt(void *data); // don't use, internal only private: HS_ClientCtxt* createClientCtxt(afb_req_t req, std::string appid); @@ -65,4 +61,4 @@ private: std::mutex mtx; }; -#endif // HOMESCREEN_CLIENTMANAGER_H \ No newline at end of file +#endif // HOMESCREEN_CLIENTMANAGER_H