Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / pkgmgr_registration.h
1 // Copyright (c) 2015 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 COMMON_PKGMGR_REGISTRATION_H_
6 #define COMMON_PKGMGR_REGISTRATION_H_
7
8 #include <pkgmgr-info.h>
9 #include <unistd.h>
10
11 #include <filesystem>
12 #include <string>
13
14 #include "common/installer_context.h"
15
16 namespace common_installer {
17
18 /**
19  * \brief Adapter interface for external PkgMgr module used for registering
20  *        package into pkgmgr
21  *
22  * \param manifest parsed manifest information
23  * \param pkgid package pkgid
24  * \param uid user id
25  * \param storage install storage
26  * \param request_mode current request mode
27  *
28  * \return true if success
29  */
30 bool RegisterAppInPkgmgr(manifest_x* manifest,
31                          const std::string& pkgid,
32                          const CertificateInfo& cert_info,
33                          uid_t uid,
34                          Storage storage,
35                          RequestMode request_mode,
36                          const std::filesystem::path& tep_path);
37
38 /**
39  * \brief Adapter interface for external PkgMgr module used for upgrading
40  *        package within pkgmgr
41  *
42  * \param manifest parsed manifest information
43  * \param pkgid package pkgid
44  * \param cert_info certifciate info
45  * \param uid user id
46  * \param storage install storage
47  * \param request_mode current request mode
48  *
49  * \return true if success
50  */
51 bool UpgradeAppInPkgmgr(manifest_x* manifest,
52                         const std::string& pkgid,
53                         const CertificateInfo& cert_info,
54                         uid_t uid,
55                         Storage storage,
56                         RequestMode request_mode);
57
58 /**
59  * \brief Adapter interface for external PkgMgr module used for deregistering
60  *        package into pkgmgr for pkgid
61  *
62  * \param pkgid unregistered package pkgid
63  * \param uid user id
64  * \param request_mode current request mode
65  *
66  * \return true if success
67  */
68 bool UnregisterAppInPkgmgrForPkgId(const std::string& pkgid, uid_t uid,
69                                    RequestMode request_mode);
70
71 /**
72  * \brief Adapter interface for external PkgMgr module used for deregistering
73  *        package into pkgmgr
74  *
75  * \param manifest parsed manifest information
76  * \param pkgid package pkgid
77  * \param uid user id
78  * \param request_mode current request mode
79  *
80  * \return true if success
81  */
82 bool UnregisterAppInPkgmgr(manifest_x* manifest,
83                            const std::string& pkgid,
84                            uid_t uid,
85                            RequestMode request_mode);
86
87 /**
88  * \brief Adapter interface for external PkgMgr module used for updating
89  *        tep info about package within pkgmgr
90  *
91  * \param tep_path path of tep file
92  * \param pkgid package pkgid
93  * \param uid user id
94  * \param request_mode current request mode
95  *
96  * \return true if success
97  */
98 bool UpdateTepInfoInPkgmgr(const std::filesystem::path& tep_path,
99                            const std::string& pkgid,
100                            uid_t uid,
101                            RequestMode request_mode);
102
103 /**
104  * \brief Adapter interface for external PkgMgr module used for updating
105  *        installed storage info about package within pkgmgr
106  *
107  * \param storage installed storage of package
108  * \param ext_path external/extended path of package
109  * \param pkgid package pkgid
110  * \param uid user id
111  *
112  * \return true if success
113  */
114 bool UpdateInstalledStorageInPkgmgr(Storage storage,
115                                     const std::filesystem::path& ext_path,
116                                     const std::string& pkgid,
117                                     uid_t uid);
118
119 /**
120  * \brief Adapter interface for external PkgMgr module used for updating
121  *        pkg disable info about package within pkgmgr
122  *
123  * \param pkgid package pkgid
124  * \param uid user id
125  * \param request_mode current request mode
126  *
127  * \return true if success
128  */
129 bool DisablePkgInPkgmgr(const std::string& pkgid, uid_t uid,
130                         RequestMode request_mode);
131
132 /**
133  * \brief Adapter interface for external PkgMgr module used for updating
134  *        pkg enable info about package within pkgmgr
135  *
136  * \param pkgid package pkgid
137  * \param uid user id
138  * \param request_mode current request mode
139  *
140  * \return true if success
141  */
142 bool EnablePkgInPkgmgr(const std::string& pkgid, uid_t uid,
143                         RequestMode request_mode);
144
145 /**
146  * \brief Adapter interface for inserting pkg plugin execution info
147  *
148  * \param manifest parsed manifest information
149  * \param uid user id
150  * \param request_mode current request mode
151  *
152  * \return true if success
153  */
154 bool RegisterPluginInfo(manifest_x* manifest,
155                         uid_t uid,
156                         RequestMode request_mode);
157
158 /**
159  * \brief Adapter interface for updating pkg plugin execution info
160  *
161  * \param manifest parsed manifest information
162  * \param uid user id
163  * \param request_mode current request mode
164  *
165  * \return true if success
166  */
167 bool UpdatePluginInfo(manifest_x* manifest,
168                       uid_t uid,
169                       RequestMode request_mode);
170
171 /**
172  * \brief Adapter interface for deleting pkg plugin execution info
173  *
174  * \param pkgid package ID
175  * \param uid user id
176  * \param request_mode current request mode
177  *
178  * \return true if success
179  */
180 bool UnregisterPluginInfo(const std::string& pkgid,
181                           uid_t uid,
182                           RequestMode request_mode);
183 }  // namespace common_installer
184
185 #endif  // COMMON_PKGMGR_REGISTRATION_H_