TYPE3
[iec.git] / src / type3_AndroidCloud / anbox-master / src / anbox / bridge / platform_api_skeleton.h
1 /*
2  * Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3, as published
6  * by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranties of
10  * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11  * PURPOSE.  See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program.  If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17
18 #ifndef ANBOX_BRIDGE_PLATFORM_SERVER_H_
19 #define ANBOX_BRIDGE_PLATFORM_SERVER_H_
20
21 #include <functional>
22 #include <memory>
23
24 namespace google {
25 namespace protobuf {
26 class Closure;
27 }  // namespace protobuf
28 }  // namespace google
29
30 namespace anbox {
31 namespace protobuf {
32 namespace rpc {
33 class Void;
34 }  // namespace rpc
35 namespace bridge {
36 class ClipboardData;
37 class BootFinishedEvent;
38 class WindowStateUpdateEvent;
39 class ApplicationListUpdateEvent;
40 }  // namespace bridge
41 }  // namespace protobuf
42 namespace platform {
43 class BasePlatform;
44 } // namespace platform
45 namespace rpc {
46 class PendingCallCache;
47 }  // namespace rpc
48 namespace wm {
49 class Manager;
50 }  // namespace wm
51 namespace application {
52 class Database;
53 }  // namespace application
54 namespace bridge {
55 class PlatformApiSkeleton {
56  public:
57   PlatformApiSkeleton(
58       const std::shared_ptr<rpc::PendingCallCache> &pending_calls,
59       const std::shared_ptr<platform::BasePlatform> &platform,
60       const std::shared_ptr<wm::Manager> &window_manager,
61       const std::shared_ptr<application::Database> &app_db);
62   virtual ~PlatformApiSkeleton();
63
64   void set_clipboard_data(anbox::protobuf::bridge::ClipboardData const *request,
65                           anbox::protobuf::rpc::Void *response,
66                           google::protobuf::Closure *done);
67   void get_clipboard_data(anbox::protobuf::rpc::Void const *request,
68                           anbox::protobuf::bridge::ClipboardData *response,
69                           google::protobuf::Closure *done);
70
71   void handle_boot_finished_event(
72       const anbox::protobuf::bridge::BootFinishedEvent &event);
73   void handle_window_state_update_event(
74       const anbox::protobuf::bridge::WindowStateUpdateEvent &event);
75   void handle_application_list_update_event(
76       const anbox::protobuf::bridge::ApplicationListUpdateEvent &event);
77
78   void register_boot_finished_handler(const std::function<void()> &action);
79
80  private:
81   std::shared_ptr<rpc::PendingCallCache> pending_calls_;
82   std::shared_ptr<platform::BasePlatform> platform_;
83   std::shared_ptr<wm::Manager> window_manager_;
84   std::shared_ptr<application::Database> app_db_;
85   std::function<void()> boot_finished_handler_;
86 };
87 }  // namespace bridge
88 }  // namespace anbox
89
90 #endif