2 * Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @brief RUA API declaration header file.
20 * @author Jinwoo Nam (jwoo.nam@samsung.com)
22 * @history 0.1: RUA API Declarations, structure declaration
33 #define API __attribute__ ((visibility("default")))
56 * @brief RUA record info structure
59 int id; /**< primary key */
60 char *pkg_name; /**< package name */
61 char *app_path; /**< application path */
62 char *arg; /**< application launching argument */
63 time_t launch_time; /**< application launching time */
67 * @brief Delete history from DB
68 * @return 0 on success, otherwise a nagative error value
69 * @retval 0 on successful
70 * @retval -1 on failed
72 API int rua_delete_history_from_db(bundle *b);
75 * @brief Clear history
76 * @return 0 on success, otherwise a nagative error value
77 * @retval 0 on successful
78 * @retval -1 on failed
80 API int rua_clear_history(void);
83 * @brief Delete history with pkg_name
84 * @param[in] pkg_name package name to delete history
85 * @return 0 on success, otherwise a nagative error value
86 * @retval 0 on successful
87 * @retval -1 on failed
89 API int rua_delete_history_with_pkgname(char *pkg_name);
92 * @brief Delete history with app_path
93 * @param[in] app_path package name to delete history
94 * @return 0 on success, otherwise a nagative error value
95 * @retval 0 on successful
96 * @retval -1 on failed
98 API int rua_delete_history_with_apppath(char *app_path);
101 * @brief Add application to recently used application list
102 * @param[in] rec record to add history
103 * @return 0 on success, otherwise a nagative error value
104 * @retval 0 on successful
105 * @retval -1 on failed
107 API int rua_add_history(struct rua_rec *rec);
110 * @brief Load recently used application history db.
111 * @param[out] table db table pointer
112 * @param[out] nrows the number of record
113 * @param[out] ncols the number of field
114 * @return 0 on success, otherwise a nagative error value
115 * @retval 0 on successful
116 * @retval -1 on failed
118 API int rua_history_load_db(char ***table, int *nrows, int *ncols);
121 * @brief Unload recently used application history db.
122 * @param[in] table db table pointer to unload
123 * @return 0 on success, otherwise a nagative error value
124 * @retval 0 on successful
125 * @retval -1 on failed
127 API int rua_history_unload_db(char ***table);
130 * @brief Load recently used application record.
131 * @param[out] rec record to load
132 * @param[in] table db table pointer
133 * @param[in] nrows the number of record
134 * @param[in] ncols the number of field
135 * @param[in] row record index to load
136 * @return 0 on success, otherwise a nagative error value
137 * @retval 0 on successful
138 * @retval -1 on failed
140 API int rua_history_get_rec(struct rua_rec *rec, char **table,
141 int nrows, int ncols, int row);
144 * @brief Check some package is latest or not with package name
145 * @param[in] pkg_name package name
146 * @return 0 on success, otherwise a nagative error value
147 * @retval 0 if given pkg_name is lastest application
148 * @retval -1 if not lastest applicaton or on failed
150 API int rua_is_latest_app(const char *pkg_name);
153 * @brief Initialize rua
154 * @return 0 on success, otherwise a nagative error value
155 * @retval 0 on successful
156 * @retval -1 on failed
158 API int rua_init(void);
161 * @brief Finalize rua
162 * @return 0 on success, otherwise a nagative error value
163 * @retval 0 on successful
164 * @retval -1 on failed
166 API int rua_fini(void);