Fix that plugin is executed several times
[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
11 #include "common/plugins/plugin.h"
12
13 namespace common_installer {
14
15 class MetadataPlugin : public Plugin {
16  public:
17   static const char kType[];
18
19   static std::unique_ptr<MetadataPlugin> Create(const PluginInfo& plugin_info);
20   bool Run(xmlDocPtr doc_ptr, manifest_x* manifest,
21            ActionType action_type) override;
22
23  private:
24   bool AddPluginInfo(manifest_x* manifest, const char* appid);
25   std::string GetFunctionName(ActionType action) const;
26
27   using Plugin::Plugin;
28
29   SCOPE_LOG_TAG(MetadataPlugin)
30 };
31
32 }  // namespace common_installer
33
34 #endif  // COMMON_PLUGINS_METADATA_PLUGIN_H_