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 with pkg_name
68 * @param[in] pkg_name package name to delete history
69 * @return 0 on success, otherwise a nagative error value
70 * @retval 0 on successful
71 * @retval -1 on failed
73 API int rua_delete_history_with_pkgname(char *pkg_name);
76 * @brief Delete history with app_path
77 * @param[in] app_path package name to delete history
78 * @return 0 on success, otherwise a nagative error value
79 * @retval 0 on successful
80 * @retval -1 on failed
82 API int rua_delete_history_with_apppath(char *app_path);
85 * @brief Clear history
86 * @return 0 on success, otherwise a nagative error value
87 * @retval 0 on successful
88 * @retval -1 on failed
90 API int rua_clear_history(void);
93 * @brief Load recently used application history db.
94 * @param[out] table db table pointer
95 * @param[out] nrows the number of record
96 * @param[out] ncols the number of field
97 * @return 0 on success, otherwise a nagative error value
98 * @retval 0 on successful
99 * @retval -1 on failed
101 API int rua_history_load_db(char ***table, int *nrows, int *ncols);
104 * @brief Unload recently used application history db.
105 * @param[in] table db table pointer to unload
106 * @return 0 on success, otherwise a nagative error value
107 * @retval 0 on successful
108 * @retval -1 on failed
110 API int rua_history_unload_db(char ***table);
113 * @brief Load recently used application record.
114 * @param[out] rec record to load
115 * @param[in] table db table pointer
116 * @param[in] nrows the number of record
117 * @param[in] ncols the number of field
118 * @param[in] row record index to load
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_get_rec(struct rua_rec *rec, char **table,
124 int nrows, int ncols, int row);
127 * @brief Check some package is latest or not with package name
128 * @param[in] pkg_name package name
129 * @return 0 on success, otherwise a nagative error value
130 * @retval 0 if given pkg_name is lastest application
131 * @retval -1 if not lastest applicaton or on failed
133 API int rua_is_latest_app(const char *pkg_name);
136 * @brief Initialize rua
137 * @return 0 on success, otherwise a nagative error value
138 * @retval 0 on successful
139 * @retval -1 on failed
141 API int rua_init(void);
144 * @brief Finalize rua
145 * @return 0 on success, otherwise a nagative error value
146 * @retval 0 on successful
147 * @retval -1 on failed
149 API int rua_fini(void);