1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
5 #ifndef WGT_STEP_STEP_PARSE_H_
6 #define WGT_STEP_STEP_PARSE_H_
8 #include <boost/filesystem.hpp>
10 #include <common/app_installer.h>
11 #include <common/installer_context.h>
12 #include <common/step/step.h>
14 #include <manifest_parser/utils/logging.h>
15 #include <wgt_manifest_handlers/permissions_handler.h>
16 #include <wgt_manifest_handlers/widget_config_parser.h>
26 * \brief This step parse config.xml configuration file of widget
28 class StepParse : public common_installer::Step {
30 explicit StepParse(common_installer::InstallerContext* context,
31 bool check_start_file);
33 Status process() override;
34 Status clean() override { return Status::OK; }
35 Status undo() override { return Status::OK; }
36 Status precheck() override { return Status::OK; }
39 virtual bool LocateConfigFile();
40 bool Check(const boost::filesystem::path& widget_path);
42 boost::filesystem::path config_;
45 std::set<std::string> ExtractPrivileges(
46 std::shared_ptr<const PermissionsInfo> perm_info) const;
48 std::string GetPackageVersion(const std::string& manifest_version);
50 bool FillInstallationInfo(manifest_x* manifest);
51 bool FillIconPaths(manifest_x* manifest);
52 bool FillWidgetInfo(manifest_x* manifest);
53 bool FillUIApplicationInfo(manifest_x* manifest);
54 bool FillServiceApplicationInfo(manifest_x* manifest);
55 bool FillAppControl(manifest_x* manifest);
56 bool FillPrivileges(manifest_x* manifest);
57 bool FillCategories(manifest_x* manifest);
58 bool FillMetadata(manifest_x* manifest);
59 bool FillExtraManifestInfo(manifest_x* manifest);
60 bool FillAccounts(manifest_x* manifest);
61 bool FillBackgroundCategoryInfo(manifest_x* manifest);
62 bool FillManifestX(manifest_x* manifest);
64 std::unique_ptr<wgt::parse::WidgetConfigParser> parser_;
65 bool check_start_file_;
73 #endif // WGT_STEP_STEP_PARSE_H_