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.
5 #ifndef COMMON_PLUGINS_PLUGIN_MANAGER_H_
6 #define COMMON_PLUGINS_PLUGIN_MANAGER_H_
8 #include <pkgmgrinfo_basic.h>
15 #include "common/utils/pkgmgr_query.h"
16 #include "common/plugins/plugin.h"
17 #include "common/plugins/plugin_list_parser.h"
18 #include "common/plugins/plugin_xml_parser.h"
20 namespace common_installer {
22 /** this class manages XML and plugin lists */
25 using PluginInfoList = std::vector<std::shared_ptr<PluginInfo>>;
27 PluginManager(const std::filesystem::path& xml_path,
28 const std::filesystem::path& list_path,
29 const std::string& pkgid,
32 : xml_parser_(xml_path),
33 list_parser_(list_path),
38 bool LoadPlugins(Plugin::ActionType action_type);
39 bool RunPlugins(Plugin::ActionType action_type);
42 bool IsDataRemoved(const char* data_type,
43 const std::string& data);
44 bool GenerateUnknownTagList(std::vector<std::string>* xml_tags);
45 bool GeneratePluginInfoList(PluginInfoList* plugin_info_list);
47 PluginsXmlParser xml_parser_;
48 PluginsListParser list_parser_;
50 manifest_x* manifest_;
52 std::vector<std::unique_ptr<Plugin>> loaded_plugins_;
55 } // namespace common_installer
57 #endif // COMMON_PLUGINS_PLUGIN_MANAGER_H_