Change the chromium header from ewk_chromium.h to EWebKit.h/Ewebkit_internal.h
[platform/framework/web/crosswalk-tizen.git] / wrt-upgrade / wrt-upgrade-info.h
1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5
6 #ifndef WRT_UPGRADE_INFO_H
7 #define WRT_UPGRADE_INFO_H
8
9 #include <iostream>
10 #include <string>
11 #include <vector>
12
13 namespace upgrade {
14 class PreferenceInfo{
15  public:
16   PreferenceInfo(std::string key, std::string value);
17   std::string getSection() {return m_section_;}
18   std::string getKey() {return m_key_;}
19   std::string getValue() {return m_value_;}
20  private:
21   std::string m_section_;
22   std::string m_key_;
23   std::string m_value_;
24 };
25
26 class SecurityOriginInfo{
27  public:
28     SecurityOriginInfo(
29          int feature,
30         std::string scheme,
31         std::string host,
32         int port,
33         int result);
34   std::string getSection() {return m_section_;}
35   std::string getKey() {return m_key_;}
36   std::string getValue() {return m_value_;}
37  private:
38   std::string translateKey(
39      int feature,
40       std::string scheme,
41       std::string host,
42       int port);
43   std::string translateValue(int result);
44   std::string m_section_;
45   std::string m_key_;
46   std::string m_value_;
47 };
48
49 class CertificateInfo{
50  public:
51     CertificateInfo(
52         std::string pem,
53         int result);
54   std::string getSection() {return m_section_;}
55   std::string getKey() {return m_key_;}
56   std::string getValue() {return m_value_;}
57  private:
58   std::string translateKey(std::string pem);
59   std::string translateValue(int result);
60   std::string m_section_;
61   std::string m_key_;
62   std::string m_value_;
63 };
64
65 class WrtUpgradeInfo{
66  public:
67   WrtUpgradeInfo() {}
68   explicit WrtUpgradeInfo(std::string appid);
69
70   std::string getAppid() { return app_id_; }
71   std::string getPkgid() { return pkg_id_; }
72   std::string getAppDir() { return app_dir_; }
73   std::string getSecurityOriginDB();
74   std::string getCertificateDB();
75
76   void addPreferenceInfo(PreferenceInfo preference);
77   void addSecurityOriginInfo(SecurityOriginInfo security_origin);
78   void addCertificateInfo(CertificateInfo certificate);
79
80   PreferenceInfo getPreferenceInfo(int idx)
81       {return preference_info_list_[idx];}
82   SecurityOriginInfo getSecurityOriginInfo(int idx)
83       {return security_origin_info_list_[idx];}
84   CertificateInfo getCertificateInfo(int idx)
85       {return certificate_info_list[idx];}
86
87   int getPreferenceInfoSize()
88       {return static_cast<int>(preference_info_list_.size());}
89   int getSecurityOriginInfoSize()
90       {return static_cast<int>(security_origin_info_list_.size());}
91   int getCertificateInfoSize()
92       {return static_cast<int>(certificate_info_list.size());}
93
94  private:
95   std::string pkg_id_;
96   std::string app_id_;
97   std::string app_dir_;
98   std::vector<PreferenceInfo> preference_info_list_;
99   std::vector<SecurityOriginInfo> security_origin_info_list_;
100   std::vector<CertificateInfo> certificate_info_list;
101 };
102 }  // namespace upgrade
103 #endif  // WRT_UPGRADE_INFO_H