2 * Copyright (c) 2000 - 2013 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 #define DbgPrint(format, arg...) SECURE_LOGD(format, ##arg)
20 #define ErrPrint(format, arg...) SECURE_LOGE(format, ##arg)
22 extern FILE *__file_log_fp;
23 #define DbgPrint(format, arg...) do { fprintf(__file_log_fp, "[LOG] [
\e[32m%s/%s
\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
25 #define ErrPrint(format, arg...) do { fprintf(__file_log_fp, "[ERR] [
\e[32m%s/%s
\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
29 #define EAPI __attribute__((visibility("default")))
32 #if !defined(VCONFKEY_MASTER_STARTED)
33 #define VCONFKEY_MASTER_STARTED "memory/data-provider-master/started"
36 #define DEFAULT_ICON_LAYOUT ""
37 #define DEFAULT_ICON_GROUP ""
40 * @brief Definition for a macro to check the request type.
42 * @param[in] type Request type
44 * @retval true(1) Shortcut remove request
45 * @retval false(0) Not a remove request
48 #define ADD_TO_HOME_IS_REMOVE_SHORTCUT(type) (!!((type) & SHORTCUT_REMOVE))
51 * @brief Definition for a macro to check the request type.
53 * @param[in] type Request type
55 * @retval true(1) Dynamicbox remove request
56 * @retval false(0) Not a remove request
59 #define ADD_TO_HOME_IS_REMOVE_DYNAMICBOX(type) (!!((type) & DYNAMICBOX_REMOVE))
64 * @brief The application, which supporting the add_to_home feature, should invoke this.
68 * This is an asynchronous API.
71 * Application must check the return value of this function.\n
72 * Application must check the return status from the callback function\n
73 * Application should set the callback function to get the result of this request.
75 * Prospective Clients:
80 * @remarks - If a homescreen does not support this feature, you will get proper error code.
81 * @param[in] appid Package name of owner of this shortcut.
82 * @param[in] name Name for created shortcut icon.
83 * @param[in] content_info Specific information for delivering to the viewer for creating a shortcut.
84 * @param[in] result_cb Address of callback function which will be called when the result comes back from the viewer.
85 * @param[in] data Callback data which will be used in callback function
87 * @return Return Type (int)
88 * \retval 0 Succeed to send the request
89 * \retval #SHORTCUT_ERROR_FAULT Unrecoverable error
90 * \retval #SHORTCUT_ERROR_INVALID_PARAMETER Shortcut request is not valid, invalid parameter or invalid argument value
91 * \retval #SHORTCUT_ERROR_COMM Connection is not estabilished. or there is a problem of communication
92 * \retval #SHORTCUT_ERROR_OUT_OF_MEMORY Memory is not enough to handle new request
93 * \retval #SHORTCUT_ERROR_IO_ERROR Unable to access file or DB. Check your resource files
94 * \retval #SHORTCUT_ERROR_PERMISSION_DENIED Has no permission to add a shortcut
96 * @pre You have to prepare the callback function
98 * @post You have to check the return status from callback function which is passed by argument.
100 * @see result_internal_cb_t
106 * #include <shortcut.h>
108 * static int result_cb(int ret, int pid, void *data)
111 * printf("Failed to add a shortcut: %s\n", perror(ret));
113 * printf("Processed by the %d\n", pid);
117 * static int app_create(void *data)
119 * add_to_home_remove_shortcut("com.samsung.gallery.dynamicbox", "With friends",
120 * "gallery:0000-0000",
125 * int main(int argc, char *argv[])
132 extern int add_to_home_remove_shortcut(const char *appid, const char *name, const char *content_info, result_internal_cb_t result_cb, void *data);
137 * @brief The application, which supporting the add_to_home feature, should invoke this.
141 * This is an asynchronous API.
144 * Application must check the return value of this function.\n
145 * Application must check the return status from the callback function\n
146 * Application should set the callback function to get the result of this request.
148 * Prospective Clients:
153 * @remarks - If a homescreen does not support this feature, you will get proper error code.
154 * @param[in] appid Package name of owner of this shortcut.
155 * @param[in] name Name for created shortcut icon.
156 * @param[in] result_cb Address of callback function which will be called when the result comes back from the viewer.
157 * @param[in] data Callback data which will be used in callback function
159 * @return Return Type (int)
160 * \retval 0 Succeed to send the request
161 * \retval #SHORTCUT_ERROR_FAULT Unrecoverable error
162 * \retval #SHORTCUT_ERROR_INVALID_PARAMETER Shortcut request is not valid, invalid parameter or invalid argument value
163 * \retval #SHORTCUT_ERROR_COMM Connection is not estabilished. or there is a problem of communication
164 * \retval #SHORTCUT_ERROR_OUT_OF_MEMORY Memory is not enough to handle new request
165 * \retval #SHORTCUT_ERROR_IO_ERROR Unable to access file or DB. Check your resource files
166 * \retval #SHORTCUT_ERROR_PERMISSION_DENIED Has no permission to add a shortcut
168 * @pre You have to prepare the callback function
170 * @post You have to check the return status from callback function which is passed by argument.
172 * @see result_internal_cb_t
178 * #include <shortcut.h>
180 * static int result_cb(int ret, int pid, void *data)
183 * printf("Failed to add a shortcut: %s\n", perror(ret));
185 * printf("Processed by the %d\n", pid);
189 * static int app_create(void *data)
191 * add_to_home_remove_dynamicbox("com.samsung.gallery.dynamicbox", "With friends", result_cb, NULL);
195 * int main(int argc, char *argv[])
202 extern int add_to_home_remove_dynamicbox(const char *appid, const char *name, result_internal_cb_t result_cb, void *data);