2 * Copyright (c) 2011 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.
18 * @author jihoon Chung (jihoon.Chung@samsung.com)
20 * @brief This file contains declarations of wrt api
24 * @defgroup wrt_engine_group WebRunTime engine Library
25 * @ingroup internet_FW
26 * Functions to APIs to access wrt-engine
39 #define WRT_DEPRECATED __attribute__((deprecated))
44 WRT_SUCCESS = 0, /*< Success*/
45 WRT_ALREADY_INIT, /*< Wrt already initialized*/
46 WRT_UPDATE_NEED, /*< Widget data has been updated*/
47 WRT_SHUTDOWN, /*<WRT daemon has been closed*/
50 WRT_VERSION_OLD = 128, /*< widget's version is older*/
51 WRT_VERSION_NEW, /*< widget's version is latest*/
52 WRT_VERSION_EXACT, /*< widget's version the same as in arg*/
53 WRT_VERSION_NOT_COMPARABLE, /*< widget's version are not comparable */
56 WRT_ERROR_INTERNAL = -128, /*< Internal library error.
58 WRT_ERROR_INVALID_PARAMETER, /*< Invalid parameter value was given
60 WRT_ERROR_HANDLE_NOT_FOUND, /*< Widget handle was not found */
61 WRT_ERROR_ID_NOT_FOUND, /*< Widget id was not found */
62 WRT_ERROR_PKGNAME_NOT_FOUND, /*< package name was not found */
63 WRT_ERROR_ALREADY_RUNNING, /*< Widget is already running */
64 WRT_ERROR_ALREADY_STOPPED, /*< Widget is already stopped */
65 WRT_ERROR_STILL_AUTHORIZING, /*< Widget is still autorizing and has not
67 WRT_ERROR_EARLY_KILLED, /*< Widget was early killed during launch */
68 WRT_ERROR_ACCESS_DENIED, /*< Access denied from ACE */
69 WRT_ERROR_NOT_INITIALIZED, /*<Occur if wrt initialization fails*/
70 WRT_ERROR_INIT, /*<Occur if wrt initialization fails*/
71 WRT_ERROR_CONNECTION, /*<Connectiond error occured*/
72 WRT_ERROR_NO_PATH, /*<One of specific directory does not
76 WRT_INSTALLER_ERROR_INVALID_WIDGET_PACKAGE, /*< */
77 WRT_INSTALLER_ERROR_WIDGET_DOES_NOT_EXIST, /*< */
78 WRT_INSTALLER_ERROR_FACTORY_WIDGET, /*< Widget is factory installed,
79 and cannot be uninstalled */
80 WRT_INSTALLER_ERROR_ALREADY_UNINSTALLING, /*< Widget is already being
82 WRT_INSTALLER_ERROR_OUT_OUT_DISK_SPACE, /*< */
83 WRT_INSTALLER_ERROR_INVALID_CERTIFICATE, /*< */
84 WRT_INSTALLER_ERROR_ALREADY_INSTALLED, /*< Widget is already installed
86 WRT_INSTALLER_ERROR_INTERNAL, /*< */
87 WRT_INSTALLER_ERROR_NOT_ALLOWED, /*< Widget installation or
89 /*< because violation of policy
91 WRT_INSTALLER_ERROR_DEFERRED, /*< Widget installation deferred
93 WRT_INSTALLER_ERROR_DATABASE_FAILURE, /*< Failure in database */
94 WRT_INSTALLER_ERROR_UNKNOWN, /*< Temporary error. Try to not
96 WRT_ERROR_INVALID_LANGUAGE, /*< Widget is not valid in
99 /* Plugin Installer Errors */
100 WRT_PLUGIN_INSTALLER_ERROR_WRONG_PATH, /*< Wrong Path to plugin Dir */
101 WRT_PLUGIN_INSTALLER_ERROR_METAFILE, /*< Plugin metafile error */
102 WRT_PLUGIN_INSTALLER_ERROR_ALREADY_INSTALLED, /*< Plugin already installed*/
103 WRT_PLUGIN_INSTALLER_ERROR_LIBRARY_ERROR, /*< Shared library error*/
104 WRT_PLUGIN_INSTALLER_ERROR_WAITING, /*< Missing dependencies*/
105 WRT_PLUGIN_INSTALLER_ERROR_LOCK, /*< Another installation
106 in progress or lock file
108 WRT_PLUGIN_INSTALLER_ERROR_UNKNOWN /*< Unknown error*/
113 char* id; /**< the widget's id
114 (read from its config.xml during installation)*/
115 char* name; /**< the widget's name
116 (read from its config.xml during installation)*/
117 char* version; /**< the widget's varsion
118 (read from its config.xml during installation)*/
119 char* icon_path; /**< the widget's icon_path
120 (read from its config.xml during installation)*/
121 char* pkg_name; /**< the widget's pkg name */
123 /**< the widget's application storage size */
124 size_t application_size;
125 /**< the widget's data storage size */
131 char *src; /**< valid path to widget's icon*/
132 int width; /**< the width of the icon in pixels*/
133 int height; /**< the height of the icon in pixels*/
138 int width; /**< the width of the widget in pixels*/
139 int height; /**< the height of the widget in pixels*/
144 char *widget_name; /**< the widget's name*/
145 wrt_widget_icon *widget_icon; /**< the widget's icon data*/
146 wrt_widget_size widget_size; /**< the widget's size data*/
147 wrt_widget_info *widget_info; /**< the widget's info data*/
148 } wrt_widget_info_data;
152 * @fn inline bool wrt_has_succeded(WrtErrStatus err)
153 * @brief Checks whether call succeded
155 * This function checks whether call succeded.
156 * If call succeded it returns TRUE.
158 * @param [in] err WrtErrStatus to check
160 * @return Result of the test
161 * @retval TRUE - the call was successful
162 * @retval FALSE - the call failed
166 * static void InitCallback(WrtErrStatus status, void *data)
168 * MyApplication *This = (MyApplication *)(data);
170 * printf("[LAUNCH-WIDGET] init callback");
172 * if (wrt_has_succeded(status) && status!=WRT_UPDATE_NEED)
174 * This->InstallAllPlugins();
176 * if (This->m_argc == 2)
177 * wrt_install_widget(This->m_argv[1], This, InstallCallback);
179 * else if(wrt_has_failed(status))
180 * printf("[LAUNCH-WIDGET] INITIALIZATION HAS FAILED");
184 * @see wrt_has_failed
186 inline bool wrt_has_succeded(WrtErrStatus err)
192 * @fn inline bool wrt_has_failed(WrtErrStatus err)
193 * @brief Checks whether call failed
195 * This function checks whether call failed.
196 * If call failed it returns TRUE.
198 * @param [in] err WrtErrStatus to check
200 * @return Result of the test
201 * @retval TRUE - the call failed
202 * @retval FALSE - the call was successful
206 * static void InitCallback(WrtErrStatus status, void *data)
208 * MyApplication *This = (MyApplication *)(data);
210 * printf("[LAUNCH-WIDGET] init callback");
212 * if (wrt_has_succeded(status) && status!=WRT_UPDATE_NEED)
214 * This->InstallAllPlugins();
216 * if (This->m_argc == 2)
217 * wrt_install_widget(This->m_argv[1], This, InstallCallback);
219 * else if(wrt_has_failed(status))
220 * printf("[LAUNCH-WIDGET] INITIALIZATION HAS FAILED");
224 * @see wrt_has_succeded
226 inline bool wrt_has_failed(WrtErrStatus err)
235 #endif /* WRT_TYPE_H_ */