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 XWALK_COMMON_APPLICATION_DATA_H_
18 #define XWALK_COMMON_APPLICATION_DATA_H_
20 #include <wgt_manifest_handlers/application_icons_handler.h>
21 #include <wgt_manifest_handlers/appwidget_handler.h>
22 #include <wgt_manifest_handlers/app_control_handler.h>
23 #include <wgt_manifest_handlers/category_handler.h>
24 #include <wgt_manifest_handlers/content_handler.h>
25 #include <wgt_manifest_handlers/csp_handler.h>
26 #include <wgt_manifest_handlers/ime_handler.h>
27 #include <wgt_manifest_handlers/launch_screen_handler.h>
28 #include <wgt_manifest_handlers/metadata_handler.h>
29 #include <wgt_manifest_handlers/navigation_handler.h>
30 #include <wgt_manifest_handlers/permissions_handler.h>
31 #include <wgt_manifest_handlers/profile_tag_handler.h>
32 #include <wgt_manifest_handlers/service_handler.h>
33 #include <wgt_manifest_handlers/setting_handler.h>
34 #include <wgt_manifest_handlers/tizen_application_handler.h>
35 #include <wgt_manifest_handlers/warp_handler.h>
36 #include <wgt_manifest_handlers/widget_handler.h>
43 class ApplicationData {
51 explicit ApplicationData(const std::string& appid);
54 bool LoadManifestData();
56 std::shared_ptr<const wgt::parse::AppControlInfoList>
57 app_control_info_list() const;
58 std::shared_ptr<const wgt::parse::CategoryInfoList>
59 category_info_list() const;
60 std::shared_ptr<const wgt::parse::MetaDataInfo>
61 meta_data_info() const;
62 std::shared_ptr<const wgt::parse::AllowedNavigationInfo>
63 allowed_navigation_info() const;
64 std::shared_ptr<const wgt::parse::PermissionsInfo>
65 permissions_info() const;
66 std::shared_ptr<const wgt::parse::SettingInfo>
68 std::shared_ptr<const wgt::parse::LaunchScreenInfo>
69 splash_screen_info() const;
70 std::shared_ptr<const wgt::parse::TizenApplicationInfo>
71 tizen_application_info() const;
72 std::shared_ptr<const wgt::parse::WidgetInfo>
74 std::shared_ptr<const wgt::parse::ContentInfo>
76 std::shared_ptr<const wgt::parse::WarpInfo>
78 std::shared_ptr<const wgt::parse::CSPInfo>
80 std::shared_ptr<const wgt::parse::CSPInfo>
81 csp_report_info() const;
82 std::shared_ptr<const wgt::parse::ProfileTagInfo>
83 profile_tag_info() const;
85 const std::string application_path() const { return application_path_; }
86 const std::string pkg_id() const;
87 const std::string app_id() const { return app_id_; }
88 ApplicationData::AppType app_type() { return app_type_; }
91 std::shared_ptr<const wgt::parse::AppControlInfoList>
92 app_control_info_list_;
93 std::shared_ptr<const wgt::parse::CategoryInfoList>
95 std::shared_ptr<const wgt::parse::MetaDataInfo>
97 std::shared_ptr<const wgt::parse::AllowedNavigationInfo>
98 allowed_navigation_info_;
99 std::shared_ptr<const wgt::parse::PermissionsInfo>
101 std::shared_ptr<const wgt::parse::SettingInfo>
103 std::shared_ptr<const wgt::parse::LaunchScreenInfo>
105 std::shared_ptr<const wgt::parse::TizenApplicationInfo>
106 tizen_application_info_;
107 std::shared_ptr<const wgt::parse::WidgetInfo>
109 std::shared_ptr<const wgt::parse::ContentInfo>
111 std::shared_ptr<const wgt::parse::WarpInfo>
113 std::shared_ptr<const wgt::parse::CSPInfo>
115 std::shared_ptr<const wgt::parse::CSPInfo>
118 std::shared_ptr<const wgt::parse::ProfileTagInfo>
121 ApplicationData::AppType GetAppType();
123 std::string application_path_;
124 mutable std::string pkg_id_;
126 ApplicationData::AppType app_type_;
131 class ApplicationDataManager {
133 static ApplicationDataManager* GetInstance();
135 ApplicationData* GetApplicationData(const std::string& appid);
138 ApplicationDataManager();
139 virtual ~ApplicationDataManager();
141 std::map<std::string, std::unique_ptr<ApplicationData>> cache_;
145 } // namespace common
147 #endif // XWALK_COMMON_APPLICATION_DATA_H_