TYPE3
[iec.git] / src / type3_AndroidCloud / anbox-master / src / anbox / dbus / skeleton / application_manager.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_DBUS_SKELETON_APPLICATION_MANAGER_H_
19 #define ANBOX_DBUS_SKELETON_APPLICATION_MANAGER_H_
20
21 #include "anbox/application/manager.h"
22 #include "anbox/dbus/bus.h"
23
24 #include <memory>
25
26 namespace anbox {
27 namespace dbus {
28 namespace skeleton {
29 class ApplicationManager : public anbox::application::Manager {
30  public:
31   ApplicationManager(const BusPtr& bus, const std::shared_ptr<anbox::application::Manager> &impl);
32   ~ApplicationManager();
33
34   void launch(const android::Intent &intent,
35               const graphics::Rect &launch_bounds = graphics::Rect::Invalid,
36               const wm::Stack::Id &stack = wm::Stack::Id::Default) override;
37
38   core::Property<bool>& ready() override;
39
40  private:
41   static const sd_bus_vtable vtable[];
42   static int method_launch(sd_bus_message *m, void *userdata, sd_bus_error *ret_error);
43   static int property_ready_get(sd_bus *bus, const char *path, const char *interface,
44                                 const char *property, sd_bus_message *reply, void *userdata,
45                                 sd_bus_error *ret_error);
46
47   BusPtr bus_;
48   std::shared_ptr<anbox::application::Manager> impl_;
49   sd_bus_slot *obj_slot_ = nullptr;
50 };
51 }  // namespace skeleton
52 }  // namespace dbus
53 }  // namespace anbox
54
55 #endif