Release version 0.5.9
[platform/core/appfw/librua.git] / include / rua_internal.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /**
18  * @file        rua.h
19  * @brief       RUA INTERNAL API declaration header file.
20  * @author      hyunho kang (hhstark.kang@samsung.com)
21  * @version     0.1
22  * @history     0.1: RUA INTERNAL API Declarations, structure declaration
23  */
24
25 #ifndef __RUA_INTERNAL_H__
26 #define __RUA_INTERNAL_H__
27
28 #include <sys/types.h>
29 #include <bundle.h>
30
31 #include "rua.h"
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /**
38  * @brief       Delete history from DB
39  * @return      0 on success, otherwise a nagative error value
40  * @retval      0 on successful
41  * @retval      -1 on failed
42  */
43 int rua_db_delete_history(bundle *b);
44 int rua_usr_db_delete_history(bundle *b, uid_t uid);
45
46 /**
47  * @brief       Add application to recently used application list
48  * @param[in]   rec  record to add history
49  * @return      0 on success, otherwise a nagative error value
50  * @retval      0 on successful
51  * @retval      -1 on failed
52  */
53 int rua_db_add_history(struct rua_rec *rec);
54 int rua_usr_db_add_history(struct rua_rec *rec, uid_t uid);
55
56 /**
57  * @brief       Update the image of the application
58  * @param[in]   pkg_name        The application ID
59  * @param[in]   comp_id         The component ID
60  * @param[in]   instance_id     The instance ID
61  * @param[in]   image           The image of the application
62  * @return      0 on success, otherwise a nagative error value
63  */
64 int rua_db_update_image(const char *pkg_name, const char *comp_id,
65                 const char *instance_id, const char *image);
66 int rua_usr_db_update_image(const char *pkg_name, const char *comp_id,
67                 const char *instance_id, const char *image, uid_t uid);
68 int rua_usr_db_update_history(const char *pkg_name,
69                 const char *comp_id, int launch_time, uid_t uid);
70 int rua_db_update_history(const char *pkg_name,
71                 const char *comp_id, int launch_time);
72
73 #ifdef __cplusplus
74 }
75 #endif
76 #endif          /*__RUA_INTERNAL_H__*/