a0c8f3fd2bbace50ab6eada79ed51ae539d72354
[platform/framework/web/crosswalk.git] / src / xwalk / application / tools / linux / xwalk_launcher_tizen.h
1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5
6 #ifndef XWALK_APPLICATION_TOOLS_LINUX_XWALK_LAUNCHER_TIZEN_H_
7 #define XWALK_APPLICATION_TOOLS_LINUX_XWALK_LAUNCHER_TIZEN_H_
8
9 #include <appcore-common.h>
10 #include <glib.h>
11
12 #include <memory>
13 #include <string>
14
15 #include "base/message_loop/message_loop.h"
16
17 #include "xwalk/application/common/id_util.h"
18 #include "xwalk/application/tools/linux/xwalk_launcher.h"
19 #include "xwalk/application/tools/tizen/xwalk_tizen_user.h"
20
21 // Private enum from appcore-internal
22 extern "C" enum app_event {
23   AE_UNKNOWN,
24   AE_CREATE,
25   AE_TERMINATE,
26   AE_PAUSE,
27   AE_RESUME,
28   AE_RESET,
29   AE_LOWMEM_POST,
30   AE_MEM_FLUSH,
31   AE_MAX
32 };
33
34 class XWalkLauncherTizen : public XWalkLauncher {
35  public:
36   XWalkLauncherTizen(bool query_running, base::MessageLoop* main_loop);
37   int Launch(const std::string& appid_or_url, bool fullscreen,
38              bool remote_debugging, int argc, char* argv[]);
39   bool Suspend();
40   bool Resume();
41
42  private:
43   static void application_event_cb(app_event event, void* data, bundle* b);
44   int XwalkAppcoreInit(const std::string& name, int argc, char* argv[]);
45   int XwalkChangeCmdline(const std::string& app_id, int argc, char* argv[]);
46
47   base::MessageLoop* main_loop_;
48 };
49
50 #endif  // XWALK_APPLICATION_TOOLS_LINUX_XWALK_LAUNCHER_TIZEN_H_