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
37 #define API __attribute__ ((visibility("default")))
60 * @brief RUA record info structure
63 int id; /**< primary key */
64 char *pkg_name; /**< package name */
65 char *app_path; /**< application path */
66 char *arg; /**< application launching argument */
67 time_t launch_time; /**< application launching time */
71 * @brief Clear history
72 * @return 0 on success, otherwise a nagative error value
73 * @retval 0 on successful
74 * @retval -1 on failed
76 API int rua_clear_history(void);
79 * @brief Delete history with pkg_name
80 * @param[in] pkg_name package name to delete history
81 * @return 0 on success, otherwise a nagative error value
82 * @retval 0 on successful
83 * @retval -1 on failed
85 API int rua_delete_history_with_pkgname(char *pkg_name);
88 * @brief Delete history with app_path
89 * @param[in] app_path package name to delete history
90 * @return 0 on success, otherwise a nagative error value
91 * @retval 0 on successful
92 * @retval -1 on failed
94 API int rua_delete_history_with_apppath(char *app_path);
97 * @brief Add application to recently used application list
98 * @param[in] rec record to add history
99 * @return 0 on success, otherwise a nagative error value
100 * @retval 0 on successful
101 * @retval -1 on failed
103 API int rua_add_history(struct rua_rec *rec);
106 * @brief Load recently used application history db.
107 * @param[out] table db table pointer
108 * @param[out] nrows the number of record
109 * @param[out] ncols the number of field
110 * @return 0 on success, otherwise a nagative error value
111 * @retval 0 on successful
112 * @retval -1 on failed
114 API int rua_history_load_db(char ***table, int *nrows, int *ncols);
117 * @brief Unload recently used application history db.
118 * @param[in] table db table pointer to unload
119 * @return 0 on success, otherwise a nagative error value
120 * @retval 0 on successful
121 * @retval -1 on failed
123 API int rua_history_unload_db(char ***table);
126 * @brief Load recently used application record.
127 * @param[out] rec record to load
128 * @param[in] table db table pointer
129 * @param[in] nrows the number of record
130 * @param[in] ncols the number of field
131 * @param[in] row record index to load
132 * @return 0 on success, otherwise a nagative error value
133 * @retval 0 on successful
134 * @retval -1 on failed
136 API int rua_history_get_rec(struct rua_rec *rec, char **table,
137 int nrows, int ncols, int row);
140 * @brief Check some package is latest or not with package name
141 * @param[in] pkg_name package name
142 * @return 0 on success, otherwise a nagative error value
143 * @retval 0 if given pkg_name is lastest application
144 * @retval -1 if not lastest applicaton or on failed
146 API int rua_is_latest_app(const char *pkg_name);
149 * @brief Initialize rua
150 * @return 0 on success, otherwise a nagative error value
151 * @retval 0 on successful
152 * @retval -1 on failed
154 API int rua_init(void);
157 * @brief Finalize rua
158 * @return 0 on success, otherwise a nagative error value
159 * @retval 0 on successful
160 * @retval -1 on failed
162 API int rua_fini(void);