2 * Copyright 2013 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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.
17 #include <widget_service.h>
19 #ifndef __WIDGET_UILITY_H
20 #define __WIDGET_UILITY_H
28 * @brief This file declares API of libwidget library
33 * @addtogroup CAPI_WIDGET_UTILITY_MODULE
38 * @brief Event information type for widget_content_event()
39 * @details definition is in widget_service.h file
42 typedef struct widget_event_info *widget_event_info_t;
45 * @brief Creates an Object to create an elm_win object.
46 * @details Creating a new Object using widget frame buffer.
48 * @param[in] id Instance Id
49 * @param[in] gbar 1 if this object is created for Glance Bar or 0 (for widget)
51 * @privilege %http://tizen.org/privilege/widget.provider
52 * @feature http://tizen.org/feature/shell.appwidget
53 * @return void* Object type
54 * @retval Address Valid evas object
55 * @retval @c NULL failed to create, widget_last_status() will returns reason of failure
57 extern void *widget_get_evas_object(const char *id, int gbar);
60 * @brief Set extra information for updated content.
62 * If the provider should give some hints to the viewer,
63 * such as title, icon and name, this function can set them.
64 * provider will send those information to the viewer when the
68 * @feature http://tizen.org/feature/shell.appwidget
69 * @remarks This function only works with the buffer type inhouse provider.
70 * @param[in] id widget Instance Id
71 * @param[in] content Content string that will pass to a widget via widget_create interface when it is re-created.
72 * @param[in] title Human readable text for accessitility, summarized text for representing the content of a box.
73 * @param[in] icon Path of icon image file - alternative image content
74 * @param[in] name Name of a box - alternative text content
75 * @return #WIDGET_STATUS_ERROR_NONE on success,
76 * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
77 * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Out of memory
78 * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
79 * @retval #WIDGET_STATUS_ERROR_FAULT Unrecoverable error
80 * @retval #WIDGET_STATUS_ERROR_NONE Successfully sent
82 extern int widget_set_extra_info(const char *id, const char *content, const char *title, const char *icon, const char *name);
85 * @brief Return values of widget programming interfaces: Operation is successfully done.
87 * @feature http://tizen.org/feature/shell.appwidget
89 extern const int WIDGET_DONE;
92 * @brief Return values of widget programming interfaces: Contents are updated.
94 * @feature http://tizen.org/feature/shell.appwidget
96 extern const int WIDGET_OUTPUT_UPDATED;
99 * @brief Return values of widget programming interfaces: Need to call the widget_need_to_update and widget_update_content.
101 * @feature http://tizen.org/feature/shell.appwidget
103 extern const int WIDGET_NEED_TO_SCHEDULE;
107 * @brief Return values of widget programming interfaces: Need to create a new instance.
110 extern const int WIDGET_NEED_TO_CREATE;
113 * @brief Return values of widget programming interfaces: Need to do force update.
115 * @feature http://tizen.org/feature/shell.appwidget
117 extern const int WIDGET_FORCE_TO_SCHEDULE;
120 * @brief Return values of widget programming interfaces: Need to destroy this instance.
122 * @feature http://tizen.org/feature/shell.appwidget
124 extern const int WIDGET_NEED_TO_DESTROY;
127 * @brief Return values of widget programming interfaces: Need to update.
129 * @feature http://tizen.org/feature/shell.appwidget
131 extern const int WIDGET_NEED_TO_UPDATE;
134 * @brief System event type: System font is changed.
136 * @feature http://tizen.org/feature/shell.appwidget
138 extern const int WIDGET_SYS_EVENT_FONT_CHANGED;
141 * @brief System event type: System language is changed.
143 * @feature http://tizen.org/feature/shell.appwidget
145 extern const int WIDGET_SYS_EVENT_LANG_CHANGED;
148 * @brief System event type: System time is changed.
150 * @feature http://tizen.org/feature/shell.appwidget
152 extern const int WIDGET_SYS_EVENT_TIME_CHANGED;
155 * @brief System event type: MMC Status change event.
157 * @feature http://tizen.org/feature/shell.appwidget
159 extern const int WIDGET_SYS_EVENT_MMC_STATUS_CHANGED;
162 * @brief System event type: Region changed.
164 * @feature http://tizen.org/feature/shell.appwidget
166 extern const int WIDGET_SYS_EVENT_REGION_CHANGED;
169 * @brief System event type: Accessibility mode changed.
171 * @feature http://tizen.org/feature/shell.appwidget
173 extern const int WIDGET_SYS_EVENT_TTS_CHANGED;
176 * @brief System event type: widget is paused.
178 * @feature http://tizen.org/feature/shell.appwidget
180 extern const int WIDGET_SYS_EVENT_PAUSED;
183 * @brief System event type: widget is resumed.
185 * @feature http://tizen.org/feature/shell.appwidget
187 extern const int WIDGET_SYS_EVENT_RESUMED;
190 * @brief System event type: widget instance is removed from a viewer.
192 * @feature http://tizen.org/feature/shell.appwidget
194 extern const int WIDGET_SYS_EVENT_DELETED;
197 * @brief Requests to schedule the update operation to a provider.
198 * Your widget will get the update request, if the @a id is specified, specific box only will get it.
200 * @param[in] id Instance Id which is passed to you via the first parameter of every widget_XXXX interface functions
201 * @feature http://tizen.org/feature/shell.appwidget
202 * @return If succes returns 0 or return less than 0
203 * @retval #WIDGET_STATUS_ERROR_NONE Successfully triggered
204 * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument
205 * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Not enough memory
206 * @retval #WIDGET_STATUS_ERROR_NOT_EXIST Given id instance is not exist
207 * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
208 * @retval #WIDGET_STATUS_ERROR_DISABLED in case of direct request for updating is disabled
210 extern int widget_request_update(const char *id);
213 * @brief Send a freeze request to the viewer (homescreen)
215 * The viewer will get this request via event callback.
216 * Then it should freeze its scroller or stop moving the widget.
218 * @remarks If the viewer doesn't care this request, this will has no effect.
219 * @param[in] widgetid widget Package Id
220 * @param[in] id Instance Id which is passed to you via the first parameter of every widget_XXXX interface functions
222 * @privilege %http://tizen.org/privilege/widget.provider
223 * @feature http://tizen.org/feature/shell.appwidget
224 * @return #WIDGET_STATUS_ERROR_NONE on success,
225 * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
226 * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
227 * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Out of memory
228 * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
229 * @retval #WIDGET_STATUS_ERROR_FAULT Failed to send requet
230 * @retval #WIDGET_STATUS_ERROR_NONE Successfully requested
231 * @see widget_release_scroller()
233 extern int widget_freeze_scroller(const char *widgetid, const char *id);
236 * @brief Send a release request to the viewer (homescreen)
238 * The viewer will get this request via event callback.
239 * Then it should release its scroller or continue moving the widget.
241 * @remarks If the viewer doesn't care this request, this will has no effect.
242 * @param[in] widgetid widget Package Id
243 * @param[in] id Instance Id which is passed to you via the first parameter of every widget_XXXX interface functions
245 * @privilege %http://tizen.org/privilege/widget.provider
246 * @feature http://tizen.org/feature/shell.appwidget
247 * @return #WIDGET_STATUS_ERROR_NONE on success,
248 * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
249 * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
250 * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
251 * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Out of memory
252 * @retval #WIDGET_STATUS_ERROR_FAULT Failed to send requet
253 * @retval #WIDGET_STATUS_ERROR_NONE Successfully requested
254 * @see widget_freeze_scroller()
256 extern int widget_thaw_scroller(const char *widgetid, const char *id);