4 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
24 * @brief RUA API declaration header file.
25 * @author Jinwoo Nam (jwoo.nam@samsung.com)
27 * @history 0.1: RUA API Declarations, structure declaration
38 #define API __attribute__ ((visibility("default")))
61 * @brief RUA record info structure
64 int id; /**< primary key */
65 char *pkg_name; /**< package name */
66 char *app_path; /**< application path */
67 char *arg; /**< application launching argument */
68 time_t launch_time; /**< application launching time */
74 * @brief Delete history from DB
75 * @return 0 on success, otherwise a nagative error value
76 * @retval 0 on successful
77 * @retval -1 on failed
79 API int rua_delete_history_from_db(bundle *b);
82 * @brief Clear history
83 * @return 0 on success, otherwise a nagative error value
84 * @retval 0 on successful
85 * @retval -1 on failed
87 API int rua_clear_history(void);
90 * @brief Delete history with pkg_name
91 * @param[in] pkg_name package name to delete history
92 * @return 0 on success, otherwise a nagative error value
93 * @retval 0 on successful
94 * @retval -1 on failed
96 API int rua_delete_history_with_pkgname(char *pkg_name);
99 * @brief Delete history with app_path
100 * @param[in] app_path package name to delete history
101 * @return 0 on success, otherwise a nagative error value
102 * @retval 0 on successful
103 * @retval -1 on failed
105 API int rua_delete_history_with_apppath(char *app_path);
108 * @brief Add application to recently used application list
109 * @param[in] rec record to add history
110 * @return 0 on success, otherwise a nagative error value
111 * @retval 0 on successful
112 * @retval -1 on failed
114 API int rua_add_history(struct rua_rec *rec);
117 * @brief Load recently used application history db.
118 * @param[out] table db table pointer
119 * @param[out] nrows the number of record
120 * @param[out] ncols the number of field
121 * @return 0 on success, otherwise a nagative error value
122 * @retval 0 on successful
123 * @retval -1 on failed
125 API int rua_history_load_db(char ***table, int *nrows, int *ncols);
128 * @brief Unload recently used application history db.
129 * @param[in] table db table pointer to unload
130 * @return 0 on success, otherwise a nagative error value
131 * @retval 0 on successful
132 * @retval -1 on failed
134 API int rua_history_unload_db(char ***table);
137 * @brief Load recently used application record.
138 * @param[out] rec record to load
139 * @param[in] table db table pointer
140 * @param[in] nrows the number of record
141 * @param[in] ncols the number of field
142 * @param[in] row record index to load
143 * @return 0 on success, otherwise a nagative error value
144 * @retval 0 on successful
145 * @retval -1 on failed
147 API int rua_history_get_rec(struct rua_rec *rec, char **table,
148 int nrows, int ncols, int row);
151 * @brief Check some package is latest or not with package name
152 * @param[in] pkg_name package name
153 * @return 0 on success, otherwise a nagative error value
154 * @retval 0 if given pkg_name is lastest application
155 * @retval -1 if not lastest applicaton or on failed
157 API int rua_is_latest_app(const char *pkg_name);
160 * @brief Initialize rua
161 * @return 0 on success, otherwise a nagative error value
162 * @retval 0 on successful
163 * @retval -1 on failed
165 API int rua_init(void);
168 * @brief Finalize rua
169 * @return 0 on success, otherwise a nagative error value
170 * @retval 0 on successful
171 * @retval -1 on failed
173 API int rua_fini(void);