492a3e49da848b4e0b16fd35bb87d8f73f562205
[platform/core/appfw/app-installers.git] / src / common / plugins / metadata_plugin.h
1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMMON_PLUGINS_METADATA_PLUGIN_H_
6 #define COMMON_PLUGINS_METADATA_PLUGIN_H_
7
8 #include <memory>
9 #include <string>
10 #include <vector>
11
12 #include "common/plugins/plugin.h"
13
14 namespace common_installer {
15
16 class MetadataPlugin : public Plugin {
17  public:
18   static const char kType[];
19
20   static std::unique_ptr<MetadataPlugin> Create(const PluginInfo& plugin_info);
21   bool Run(xmlDocPtr doc_ptr, manifest_x* manifest,
22            ActionType action_type) override;
23
24  private:
25   bool AddPluginInfo(manifest_x* manifest, const char* appid);
26   std::string GetFunctionName(ActionType action) const;
27
28   using Plugin::Plugin;
29
30   std::vector<std::string> appid_list_;
31   SCOPE_LOG_TAG(MetadataPlugin)
32 };
33
34 }  // namespace common_installer
35
36 #endif  // COMMON_PLUGINS_METADATA_PLUGIN_H_