4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
25 * @file pkgmgr_parser_db.h
26 * @author Shobhit Srivastava <shobhit.s@samsung.com>
28 * @brief This file declares API to store/retrieve manifest data in DB
30 * @addtogroup APPLICATION_FRAMEWORK
33 * @defgroup PackageManagerParserDB
34 * @section Header Header file to include:
36 * #include <pkgmgr_parser_db.h>
42 #ifndef __PKGMGR_PARSER_DB_H__
43 #define __PKGMGR_PARSER_DB_H__
48 #include "pkgmgr_parser.h"
50 * @fn int pkgmgr_parser_insert_manifest_info_in_usr_db(manifest_x *mfx, uid_t uid)
51 * @fn int pkgmgr_parser_insert_manifest_info_in_db(manifest_x *mfx)
52 * @brief This API inserts the parsed manifest info in db
54 * @par This API is for package-manager installer backends
55 * @par Sync (or) Async : Synchronous API
57 * @param[in] mfx pointer to manifest info
58 * @param[in] uid the addressee user id of the instruction
59 * @return 0 if success, error code(<0) if fail
62 * @see pkgmgr_parser_update_manifest_info_in_db()
63 * @see pkgmgr_parser_delete_manifest_info_from_db()
65 static int insert_manifest_data(manifest_x *mfx)
68 ret = pkgmgr_parser_insert_manifest_info_in_db(mfx);
75 int pkgmgr_parser_insert_manifest_info_in_db(manifest_x *mfx);
76 int pkgmgr_parser_insert_manifest_info_in_usr_db(manifest_x *mfx, uid_t uid);
79 * @fn int pkgmgr_parser_update_manifest_info_in_db(manifest_x *mfx)
80 * @fn int pkgmgr_parser_update_manifest_info_in_db(manifest_x *mfx)
81 * @brief This API updates the manifest info in db
83 * @par This API is for package-manager installer backends
84 * @par Sync (or) Async : Synchronous API
86 * @param[in] mfx pointer to manifest info
87 * @param[in] uid the addressee user id of the instruction
88 * @return 0 if success, error code(<0) if fail
91 * @see pkgmgr_parser_insert_manifest_info_in_db()
92 * @see pkgmgr_parser_delete_manifest_info_from_db()
94 static int update_manifest_data(manifest_x *mfx)
97 ret = pkgmgr_parser_update_manifest_info_in_db(mfx);
104 int pkgmgr_parser_update_manifest_info_in_db(manifest_x *mfx);
105 int pkgmgr_parser_update_manifest_info_in_usr_db(manifest_x *mfx, uid_t uid);
108 * @fn int pkgmgr_parser_update_tep_info_in_db(const char * pkgid, const char * tep_path)
109 * @fn int pkgmgr_parser_update_tep_info_in_usr_db(const char * pkgid, const char * tep_path,uid_t uid)
110 * @brief This API updates the tep info in db
112 * @par This API is for package-manager installer backends
113 * @par Sync (or) Async : Synchronous API
115 * @param[in] pkgid pointer to pkgid
116 * @param[in] tep_path path of tep file
117 * @return 0 if success, error code(<0) if fail
121 static int update_tep_data(const char *pkgid, *tep_path)
124 ret = pkgmgr_parser_update_tep_info_in_db(pkgid, tep_path);
131 int pkgmgr_parser_update_tep_info_in_db(const char *pkgid, const char *tep_path);
132 int pkgmgr_parser_update_tep_info_in_usr_db(const char *pkgid, const char *tep_path, uid_t uid);
135 * @fn int pkgmgr_parser_delete_manifest_info_from_usr_db(manifest_x *mfx, uid_t uid)
136 * @fn int pkgmgr_parser_delete_manifest_info_from_db(manifest_x *mfx)
137 * @brief This API deletes the parsed manifest info from db
139 * @par This API is for package-manager installer backends
140 * @par Sync (or) Async : Synchronous API
142 * @param[in] mfx pointer to manifest info
143 * @param[in] uid the addressee user id of the instruction
144 * @return 0 if success, error code(<0) if fail
147 * @see pkgmgr_parser_update_manifest_info_in_db()
148 * @see pkgmgr_parser_insert_manifest_info_in_db()
150 static int delete_manifest_data(manifest_x *mfx)
153 ret = pkgmgr_parser_delete_manifest_info_from_db(mfx);
160 int pkgmgr_parser_delete_manifest_info_from_db(manifest_x *mfx);
161 int pkgmgr_parser_delete_manifest_info_from_usr_db(manifest_x *mfx, uid_t uid);
163 int pkgmgr_parser_update_preload_info_in_db();
164 int pkgmgr_parser_update_preload_info_in_usr_db(uid_t uid);
167 * @fn int pkgmgr_parser_update_global_app_disable_for_uid_info_in_db(const char *appid, uid_t uid, int is_disable)
168 * @brief This API updates disable info about global app for user specified by uid
170 * @par This API is for package-manager installer backends
171 * @par Sync (or) Async : Synchronous API
173 * @param[in] appid global application ID to be enabled or disabled
174 * @param[in] uid the addressee user id of the instruction
175 * @param[in]is_disable determine enable or disable of app
176 * @return 0 if success, error code(<0) if fail
180 static int disable_global_app_for_uid(const char *appid, uid_t uid)
183 ret = pkgmgr_parser_update_global_app_disable_for_uid_info_in_db(appid, uid, 1);
190 int pkgmgr_parser_update_global_app_disable_for_uid_info_in_db(const char *appid, uid_t uid, int is_disable);
193 * @fn int pkgmgr_parser_update_app_disable_info_in_db(const char *appid, int is_disable);
194 * @brief This API updates disable info about app
196 * @par This API is for package-manager installer backends
197 * @par Sync (or) Async : Synchronous API
199 * @param[in] appid application ID to be enabled or disabled
200 * @param[in]is_disable determine enable or disable of app
201 * @return 0 if success, error code(<0) if fail
205 static int disable_app(const char *appid)
208 ret = pkgmgr_parser_update_app_disable_info_in_db(appid, 1);
215 int pkgmgr_parser_update_app_disable_info_in_db(const char *appid, int is_disable);
216 int pkgmgr_parser_update_app_disable_info_in_usr_db(const char *appid, uid_t uid, int is_disable);
219 * @fn int pkgmgr_parser_update_global_app_splash_screen_info_in_usr_db(const char *appid, uid_t uid, int is_disable)
220 * @brief This API updates splash screen disable info about global app for user specified by uid
222 * @par This API is for package-manager installer backends
223 * @par Sync (or) Async : Synchronous API
225 * @param[in] appid global application ID to be enabled or disabled
226 * @param[in] uid the addressee user id of the instruction
227 * @param[in]is_disable determine enable or disable of app
228 * @return 0 if success, error code(<0) if fail
232 static int disable_global_app_splash_screen_for_uid(const char *appid, uid_t uid)
235 ret = pkgmgr_parser_update_global_app_splash_screen_info_in_usr_db(appid, uid, 1);
242 int pkgmgr_parser_update_global_app_splash_screen_info_in_usr_db(const char *appid, uid_t uid, int is_disable);
244 int pkgmgr_parser_create_and_initialize_db(uid_t uid);
251 #endif /* __PKGMGR_PARSER_DB_H__ */