Implement execution of removed plugin feature
[platform/core/appfw/app-installers.git] / src / common / step / pkgmgr / step_run_parser_plugins.h
1 // Copyright (c) 2016 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.
4
5 #ifndef COMMON_STEP_PKGMGR_STEP_RUN_PARSER_PLUGINS_H_
6 #define COMMON_STEP_PKGMGR_STEP_RUN_PARSER_PLUGINS_H_
7
8 #include <manifest_parser/utils/logging.h>
9
10 #include <pkgmgrinfo_basic.h>
11
12 #include <memory>
13 #include <string>
14 #include <vector>
15
16 #include "common/plugins/plugin.h"
17 #include "common/plugins/plugin_manager.h"
18 #include "common/step/step.h"
19
20 namespace common_installer {
21 namespace pkgmgr {
22
23 class StepRunParserPlugin : public Step {
24  public:
25   explicit StepRunParserPlugin(InstallerContext* context,
26                                Plugin::ActionType action_type);
27
28   Step::Status process() override;
29   Step::Status clean() override;
30   Step::Status undo() override;
31   Step::Status precheck() { return Status::OK; }
32
33  private:
34   Step::Status ProcessPlugins(const boost::filesystem::path& xml_path,
35                               manifest_x* manifest,
36                               Plugin::ActionType action_type);
37
38   bool InitPluginManager(const boost::filesystem::path& xml_path,
39                          manifest_x* manifest, uid_t uid);
40
41   Plugin::ActionType action_type_;
42   std::unique_ptr<PluginManager> plugin_manager_;
43
44   STEP_NAME(RunParserPlugin)
45 };
46
47 }  // namespace pkgmgr
48 }  // namespace common_installer
49
50 #endif  //  COMMON_STEP_PKGMGR_STEP_RUN_PARSER_PLUGINS_H_