hs-clientmanager: Do not store always the client context
[apps/agl-service-homescreen.git] / src / homescreen.h
1 #ifndef HOMESCREEN_H
2 #define HOMESCREEN_H
3
4 #include <memory>
5 #include <algorithm>
6 #include <unordered_map>
7 #include <list>
8
9 #include "hs-helper.h"
10 #include "hs-clientmanager.h"
11 #include "hs-appinfo.h"
12
13 struct hs_instance {
14         HS_ClientManager *client_manager;   // the connection session manager
15         HS_AppInfo *app_info;               // application info
16
17         hs_instance() : client_manager(HS_ClientManager::instance()), app_info(HS_AppInfo::instance()) {}
18         int init(afb_api_t api);
19         void setEventHook(const char *event, const event_hook_func f);
20         void onEvent(afb_api_t api, const char *event, struct json_object *object);
21 private:
22         std::unordered_map<std::string, std::list<event_hook_func>> event_hook_list;
23 };
24
25 #endif