Add api for listen status for resource copy
[platform/core/appfw/slp-pkgmgr.git] / installer / pkgmgr_installer_type.h
1 /*
2  * slp-pkgmgr
3  *
4  * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20
21 #ifndef __PKGMGR_INSTALLER_TYPE_H__
22 #define __PKGMGR_INSTALLER_TYPE_H__
23
24 /**
25  * @file        pkgmgr_installer_type.h
26  * @brief       This file declares some types for pkgmgr_installer
27  */
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /**
34  * @brief listening event type in pkgmgr.
35  */
36 #define PKGMGR_INSTALLER_START_KEY_STR           "start"
37 #define PKGMGR_INSTALLER_END_KEY_STR             "end"
38 #define PKGMGR_INSTALLER_ERROR_KEY_STR           "error"
39 #define PKGMGR_INSTALLER_APPID_KEY_STR           "appid"
40 #define PKGMGR_INSTALLER_INSTALL_PERCENT_KEY_STR "install_percent"
41 #define PKGMGR_INSTALLER_GET_SIZE_KEY_STR        "get_size"
42 #define PKGMGR_INSTALLER_CLEAR_CACHE_KEY_STR     "clear_cache"
43
44 #define PKGMGR_INSTALLER_INSTALL_EVENT_STR       "install"
45 #define PKGMGR_INSTALLER_UNINSTALL_EVENT_STR     "uninstall"
46 #define PKGMGR_INSTALLER_CLEAR_EVENT_STR         "clear"
47 #define PKGMGR_INSTALLER_MOVE_EVENT_STR          "move"
48 #define PKGMGR_INSTALLER_UPGRADE_EVENT_STR       "update"
49 #define PKGMGR_INSTALLER_OK_EVENT_STR            "ok"
50 #define PKGMGR_INSTALLER_FAIL_EVENT_STR          "fail"
51 #define PKGMGR_INSTALLER_RES_COPY_EVENT_STR      "res_copy"
52 #define PKGMGR_INSTALLER_RES_REMOVE_EVENT_STR    "res_remove"
53 #define PKGMGR_INSTALLER_RES_UNINSTALL_EVENT_STR "res_uninstall"
54 #define PKGMGR_INSTALLER_UNKNOWN_EVENT_STR       ""
55
56 #define PKGMGR_INSTALLER_APP_DISABLE_EVENT_STR         "disable_app"
57 #define PKGMGR_INSTALLER_APP_ENABLE_EVENT_STR          "enable_app"
58
59 #define PKGMGR_INSTALLER_APP_DISABLE_SPLASH_SCREEN_EVENT_STR         "disable_app_splash_screen"
60 #define PKGMGR_INSTALLER_APP_ENABLE_SPLASH_SCREEN_EVENT_STR          "enable_app_splash_screen"
61
62 /**
63  * Request type.
64  */
65 enum {
66         PKGMGR_REQ_PERM = -1,
67         PKGMGR_REQ_INVALID = 0,
68         PKGMGR_REQ_INSTALL = 1,
69         PKGMGR_REQ_UNINSTALL = 2,
70         PKGMGR_REQ_CLEAR = 3,
71         PKGMGR_REQ_MOVE = 4,
72         PKGMGR_REQ_RECOVER = 5,
73         PKGMGR_REQ_REINSTALL = 6,
74         PKGMGR_REQ_GETSIZE = 7,
75         PKGMGR_REQ_UPGRADE = 8,
76         PKGMGR_REQ_SMACK = 9,
77         PKGMGR_REQ_MANIFEST_DIRECT_INSTALL = 10,
78         PKGMGR_REQ_ENABLE_APP = 11,
79         PKGMGR_REQ_DISABLE_APP = 12,
80         PKGMGR_REQ_ENABLE_APP_SPLASH_SCREEN = 13,
81         PKGMGR_REQ_DISABLE_APP_SPLASH_SCREEN = 14,
82         PKGMGR_REQ_MOUNT_INSTALL = 15,
83         PKGMGR_REQ_DISABLE_PKG = 16,
84         PKGMGR_REQ_ENABLE_PKG = 17,
85         PKGMGR_REQ_MIGRATE_EXTIMG = 18,
86         PKGMGR_REQ_RECOVER_DB = 19,
87         PKGMGR_REQ_RES_COPY = 20,
88         PKGMGR_REQ_RES_REMOVE = 21,
89         PKGMGR_REQ_RES_UNINSTALL = 22
90 };
91
92 enum {
93         PKGMGR_INSTALLER_EINVAL = -2,           /**< Invalid argument */
94         PKGMGR_INSTALLER_ERROR = -1,            /**< General error */
95         PKGMGR_INSTALLER_EOK = 0                /**< General success */
96 };
97
98 typedef enum {
99         PM_SET_AUTHOR_ROOT_CERT = 0,
100         PM_SET_AUTHOR_INTERMEDIATE_CERT = 1,
101         PM_SET_AUTHOR_SIGNER_CERT = 2,
102         PM_SET_DISTRIBUTOR_ROOT_CERT = 3,
103         PM_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4,
104         PM_SET_DISTRIBUTOR_SIGNER_CERT = 5,
105         PM_SET_DISTRIBUTOR2_ROOT_CERT = 6,
106         PM_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7,
107         PM_SET_DISTRIBUTOR2_SIGNER_CERT = 8,
108 } pkgmgr_instcert_type;
109
110 typedef enum {
111         PM_PRIVILEGE_UNKNOWN = -1,
112         PM_PRIVILEGE_UNTRUSTED = 0,
113         PM_PRIVILEGE_PUBLIC = 1,
114         PM_PRIVILEGE_PARTNER = 2,
115         PM_PRIVILEGE_PLATFORM = 3
116 } pkgmgr_privilege_level;
117
118 #ifdef __cplusplus
119 }
120 #endif
121
122 #endif  /* __PKGMGR_INSTALLER_TYPE_H__ */
123