2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef SRC_APPLICATION_APPLICATION_MANAGER_H__
18 #define SRC_APPLICATION_APPLICATION_MANAGER_H__
23 #include <package-manager.h>
25 #include "common/picojson.h"
26 #include "common/platform_result.h"
29 namespace application {
31 class ApplicationInstance;
33 class ApplicationManager {
35 explicit ApplicationManager(ApplicationInstance& instance);
36 ~ApplicationManager();
38 void GetCurrentApplication(const std::string& app_id, picojson::object* out);
39 void Kill(const picojson::value& args);
40 void Launch(const picojson::value& args);
41 void LaunchAppControl(const picojson::value& args);
42 void FindAppControl(const picojson::value& args);
43 void GetAppsContext(const picojson::value& args);
44 void GetAppContext(const picojson::value& args, picojson::object* out);
45 void GetAppsInfo(const picojson::value& args);
46 void GetAppInfo(const std::string& app_id, picojson::object* out);
47 void GetAppCerts(const std::string& app_id, picojson::object* out);
48 void GetAppSharedUri(const std::string& app_id, picojson::object* out);
49 void GetAppMetaData(const std::string& app_id, picojson::object* out);
50 void StartAppInfoEventListener(picojson::object* out);
51 void StopAppInfoEventListener();
52 void GetApplicationInformationSize(const picojson::value& args, picojson::object* out);
53 void AsyncResponse(common::PlatformResult& result, std::shared_ptr<picojson::value>* response);
54 void BroadcastEventHelper(const picojson::value& args, picojson::object& out, bool trusted);
55 void StartEventListener(picojson::object* out);
56 void StopEventListener();
59 char* GetPackageId(const std::string& app_id);
61 pkgmgr_client* pkgmgr_client_handle_;
62 ApplicationInstance& instance_;
65 } // namespace application
66 } // namespace extension
68 #endif // SRC_APPLICATION_APPLICATION_MANAGER_H__