Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / utils / request.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_UTILS_REQUEST_H_
6 #define COMMON_UTILS_REQUEST_H_
7
8 #include <string>
9
10 namespace common_installer {
11
12 /** Request type received from pkgmgr_installer */
13 enum class RequestType : int {
14   Unknown = 0,
15   Install,
16   Update,
17   Uninstall,
18   Reinstall,
19   Delta,
20   Move,
21   Recovery,
22   RecoveryUpdate,
23   MountInstall,
24   MountUpdate,
25   ManifestDirectInstall,
26   ManifestDirectUpdate,
27   ManifestPartialInstall,
28   ManifestPartialUpdate,
29   PartialUninstall,
30   ReadonlyUpdateInstall,
31   ReadonlyUpdateUninstall,
32   DisablePkg,
33   EnablePkg,
34   MigrateExtImg,
35   RecoverDB
36 };
37
38 /** Request mode (USER vs GLOBAL) */
39 enum class RequestMode : int {
40   USER,
41   GLOBAL
42 };
43
44 /**
45  * Get string of given request type
46  *
47  * \return request mode
48  */
49 std::string GetRequestTypeString(RequestType request_type);
50
51 /**
52  * Get mode for current request (GLOBAL/USER)
53  *
54  * \return request mode
55  */
56 RequestMode GetRequestMode(uid_t uid);
57
58 /**
59  * Get apps root path for current request (GLOBAL/USER)
60  *
61  * \return root application path (eg. $HOME/apps_rw/)
62  */
63 const char* GetRootAppPath(bool is_readonly, uid_t uid);
64
65 /**
66  * Get appt root path at exteded storage for current request (GLOBAL/USER)
67  *
68  * \return root application path at extended path
69  *         (eg. $TZ_SYS_MEDIA/extended/globalapps)
70  */
71 const char* GetExtendedRootAppPath(uid_t uid);
72
73 }  // namespace common_installer
74
75 #endif  // COMMON_UTILS_REQUEST_H_