Fix WgtArchiveInfo
[platform/core/appfw/wgt-backend.git] / src / lib / wgt_archive_info.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 LIB_WGT_ARCHIVE_INFO_H_
6 #define LIB_WGT_ARCHIVE_INFO_H_
7
8 #include <boost/filesystem/path.hpp>
9
10 #include <common/archive_info.h>
11 #include <manifest_parser/utils/logging.h>
12 #include <wgt_manifest_handlers/widget_config_parser.h>
13
14 #include <string>
15
16 namespace bf = boost::filesystem;
17
18 class WgtArchiveInfo : public common_installer::ArchiveInfo {
19  public:
20   explicit WgtArchiveInfo(std::string path)
21       : common_installer::ArchiveInfo(path) { }
22   bool LoadArchiveInfo() override;
23
24  private:
25   bool GetPackageInfo(const wgt::parse::WidgetConfigParser& parser);
26   bool GetApplicationInfo(const wgt::parse::WidgetConfigParser& parser);
27   bool GetAddonInfo(const wgt::parse::WidgetConfigParser& parser);
28   bool GetPrivilegesInfo(const wgt::parse::WidgetConfigParser& parser);
29   bool GetIconInfo(const wgt::parse::WidgetConfigParser& parser);
30   bool ReadIcon(const bf::path& icon, const bf::path& tmp_dir);
31   bool GetLabelInfo(const wgt::parse::WidgetConfigParser& parser,
32       const char* locale);
33   bool GetDescriptionInfo(const wgt::parse::WidgetConfigParser& parser,
34       const char* locale);
35
36   SCOPE_LOG_TAG(WgtArchiveInfo)
37 };
38
39 #endif  // LIB_WGT_ARCHIVE_INFO_H_