074ae2e9b39fd34c6f74bffcaaf4bbbde9aa4fc5
[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_CREATE_DIR_EVENT_STR "res_create_dir"
53 #define PKGMGR_INSTALLER_RES_REMOVE_EVENT_STR     "res_remove"
54 #define PKGMGR_INSTALLER_RES_UNINSTALL_EVENT_STR  "res_uninstall"
55 #define PKGMGR_INSTALLER_PKG_UPGRADE_EVENT_STR    "pkg_upgrade"
56 #define PKGMGR_INSTALLER_UNKNOWN_EVENT_STR        ""
57
58 #define PKGMGR_INSTALLER_APP_DISABLE_EVENT_STR         "disable_app"
59 #define PKGMGR_INSTALLER_APP_ENABLE_EVENT_STR          "enable_app"
60
61 #define PKGMGR_INSTALLER_APP_DISABLE_SPLASH_SCREEN_EVENT_STR         "disable_app_splash_screen"
62 #define PKGMGR_INSTALLER_APP_ENABLE_SPLASH_SCREEN_EVENT_STR          "enable_app_splash_screen"
63
64 /**
65  * Request type.
66  */
67 enum {
68         PKGMGR_REQ_PERM = -1,
69         PKGMGR_REQ_INVALID = 0,
70         PKGMGR_REQ_INSTALL = 1,
71         PKGMGR_REQ_UNINSTALL = 2,
72         PKGMGR_REQ_CLEAR = 3,
73         PKGMGR_REQ_MOVE = 4,
74         PKGMGR_REQ_RECOVER = 5,
75         PKGMGR_REQ_REINSTALL = 6,
76         PKGMGR_REQ_GETSIZE = 7,
77         PKGMGR_REQ_UPGRADE = 8,
78         PKGMGR_REQ_SMACK = 9,
79         PKGMGR_REQ_MANIFEST_DIRECT_INSTALL = 10,
80         PKGMGR_REQ_ENABLE_APP = 11,
81         PKGMGR_REQ_DISABLE_APP = 12,
82         PKGMGR_REQ_ENABLE_APP_SPLASH_SCREEN = 13,
83         PKGMGR_REQ_DISABLE_APP_SPLASH_SCREEN = 14,
84         PKGMGR_REQ_MOUNT_INSTALL = 15,
85         PKGMGR_REQ_DISABLE_PKG = 16,
86         PKGMGR_REQ_ENABLE_PKG = 17,
87         PKGMGR_REQ_MIGRATE_EXTIMG = 18,
88         PKGMGR_REQ_RECOVER_DB = 19,
89         PKGMGR_REQ_RES_COPY = 20,
90         PKGMGR_REQ_RES_CREATE_DIR = 21,
91         PKGMGR_REQ_RES_REMOVE = 22,
92         PKGMGR_REQ_RES_UNINSTALL = 23
93 };
94
95 enum {
96         PKGMGR_INSTALLER_EINVAL = -2,           /**< Invalid argument */
97         PKGMGR_INSTALLER_ERROR = -1,            /**< General error */
98         PKGMGR_INSTALLER_EOK = 0                /**< General success */
99 };
100
101 typedef enum {
102         PM_SET_AUTHOR_ROOT_CERT = 0,
103         PM_SET_AUTHOR_INTERMEDIATE_CERT = 1,
104         PM_SET_AUTHOR_SIGNER_CERT = 2,
105         PM_SET_DISTRIBUTOR_ROOT_CERT = 3,
106         PM_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4,
107         PM_SET_DISTRIBUTOR_SIGNER_CERT = 5,
108         PM_SET_DISTRIBUTOR2_ROOT_CERT = 6,
109         PM_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7,
110         PM_SET_DISTRIBUTOR2_SIGNER_CERT = 8,
111 } pkgmgr_instcert_type;
112
113 typedef enum {
114         PM_PRIVILEGE_UNKNOWN = -1,
115         PM_PRIVILEGE_UNTRUSTED = 0,
116         PM_PRIVILEGE_PUBLIC = 1,
117         PM_PRIVILEGE_PARTNER = 2,
118         PM_PRIVILEGE_PLATFORM = 3
119 } pkgmgr_privilege_level;
120
121 #ifdef __cplusplus
122 }
123 #endif
124
125 #endif  /* __PKGMGR_INSTALLER_TYPE_H__ */