Add gitreview file for Lucky Lamprey branch
[src/libhomescreen.git] / include / libhomescreen.hpp
index 0fed49f..417ccdc 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
+ * Copyright (c) 2018,2019 TOYOTA MOTOR CORPORATION
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -40,6 +41,7 @@ public:
        using handler_func = std::function<void(json_object*)>;
 
        enum EventType {
+               Event_Min,
                Event_ShowWindow = 1,
                Event_TapShortcut = 1,
                Event_OnScreenMessage,
@@ -47,23 +49,16 @@ public:
                Event_HideWindow,
                Event_ReplyShowWindow,
                Event_ShowNotification,
-               Event_ShowInformation
+               Event_ShowInformation,
+               Event_AppListChanged,
+               Event_Max
        };
 
-       /* Key for json obejct */
-       const char *_keyParameter = "parameter";
-       const char *_keyArea = "area";
-
-       /* display area */
-       const char *_areaNormal = "normal";
-       const char *_areaFullScreen = "fullscreen";
-       const char *_areaSplitMain = "split.main";
-       const char *_areaSplitSub = "split.sub";
-
        static const std::vector<std::string> api_list;
        static const std::vector<std::string> event_list;
 
        /* Method */
+       int init(const char *hostname, const int port, const char *token);
        int init(const int port, const std::string& token);
 
        int tapShortcut(const char* application_id);
@@ -87,10 +82,12 @@ public:
        int replyShowWindow(const char* application_id, json_object* json);
        int showNotification(json_object* json);
        int showInformation(json_object* json);
+       int getRunnables(void);
 
 
 private:
        int initialize_websocket();
+       int initialize_websocket(const char *hostname, const int port, const char *token);
 
        void (*onEvent)(const std::string& event, struct json_object* event_contents);
        void (*onReply)(struct json_object* reply);
@@ -101,9 +98,6 @@ private:
        sd_event* mploop;
        std::string muri;
 
-       int mport = 2000;
-       std::string mtoken = "hs";
-
        std::map<EventType, handler_func> handlers;
 
 public: