Add new steps for trust anchor
[platform/core/appfw/wgt-backend.git] / src / wgt / step / configuration / step_parse.h
index e7b9357..e875f77 100644 (file)
@@ -1,7 +1,6 @@
 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
 // Use of this source code is governed by a apache 2.0 license that can be
 // found in the LICENSE file.
-
 #ifndef WGT_STEP_CONFIGURATION_STEP_PARSE_H_
 #define WGT_STEP_CONFIGURATION_STEP_PARSE_H_
 
@@ -15,6 +14,8 @@
 #include <wgt_manifest_handlers/permissions_handler.h>
 #include <wgt_manifest_handlers/widget_config_parser.h>
 
+#include <type_traits>
+#include <cassert>
 #include <memory>
 #include <set>
 #include <string>
@@ -46,7 +47,7 @@ class StepParse : public common_installer::Step {
   virtual bool LocateConfigFile();
   bool Check(const boost::filesystem::path& widget_path);
 
-  boost::filesystem::path config_;
+  boost::filesystem::path widget_path_;
 
  private:
   std::set<std::string> ExtractPrivileges(
@@ -62,6 +63,8 @@ class StepParse : public common_installer::Step {
   bool FillWidgetApplicationInfo(manifest_x* manifest);
   bool FillAppControl(manifest_x* manifest);
   bool FillPrivileges(manifest_x* manifest);
+  bool FillAppDefinedPrivileges(manifest_x* manifest);
+  bool FillProvidesAppDefinedPrivileges(manifest_x* manifest);
   bool FillCategories(manifest_x* manifest);
   bool FillMetadata(manifest_x* manifest);
   bool FillExtraManifestInfo(manifest_x* manifest);
@@ -69,12 +72,22 @@ class StepParse : public common_installer::Step {
   bool FillImeInfo();
   bool FillAppWidget();
   bool FillBackgroundCategoryInfo(manifest_x* manifest);
+  bool FillAdditionalApplications(manifest_x* manifest);
   bool FillManifestX(manifest_x* manifest);
+  bool FillTrustAnchorInfo(manifest_x* manifest);
 
   std::unique_ptr<wgt::parse::WidgetConfigParser> parser_;
   ConfigLocation config_location_;
   bool check_start_file_;
 
+  template<typename T>
+  std::shared_ptr<const T> GetManifestDataForKey(const std::string& key) {
+      assert(!key.empty());
+      static_assert(std::is_base_of<parser::ManifestData, T>::value,
+              "Type is not base of parser::ManifestData");
+      return std::static_pointer_cast<const T>(parser_->GetManifestData(key));
+  }
+
   STEP_NAME(Parse)
 };