6fe9d0e7153e9d7345b26953da9465fa3540ffa0
[apps/native/widget/widget.git] / include / dynamicbox.h
1 /*
2  * Copyright 2013  Samsung Electronics Co., Ltd
3  *
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
7  *
8  * http://floralicense.org/license/
9  *
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.
15  */
16
17 #ifndef __DYNAMICBOX_UILITY_H
18 #define __DYNAMICBOX_UILITY_H
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /**
25  * @file dynamicbox.h
26  * @brief This file declares API of libdynamicbox library
27  * @since_tizen 2.3
28  */
29
30 /**
31  * @addtogroup CAPI_DYNAMICBOX_UTILITY_MODULE
32  * @{
33  */
34
35 /**
36  * @brief Creates an Object to create an elm_win object.
37  * @details Creating a new Object using Dynamic Box frame buffer.
38  * @since_tizen 2.3
39  * @param[in] id Instance Id
40  * @param[in] gbar 1 if this object is created for Glance Bar or 0 (for Dynamic Box)
41  * @privlevel public
42  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
43  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
44  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
45  * @return void* Object type
46  * @retval Address Valid evas object
47  * @retval @c NULL failed to create, dynamicbox_last_status() will returns reason of failure
48  */
49 extern void *dynamicbox_get_evas_object(const char *id, int gbar);
50
51 /**
52  * @brief Set extra information for updated content.
53  * @details
54  *      If the provider should give some hints to the viewer,
55  *      such as title, icon and name, this function can set them.
56  *      provider will send those information to the viewer when the
57  *      content is updated.
58  * @since_tizen 2.3
59  * @remarks This function only works with the buffer type inhouse provider.
60  * @param[in] id Dynamic Box Instance Id
61  * @param[in] content Content string that will pass to a Dynamic Box via dynamicbox_create interface when it is re-created.
62  * @param[in] title Human readable text for accessitility, summarized text for representing the content of a box.
63  * @param[in] icon Path of icon image file - alternative image content
64  * @param[in] name Name of a box - alternative text content
65  * @return int type
66  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
67  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
68  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Out of memory
69  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
70  * @retval #DBOX_STATUS_ERROR_FAULT Unrecoverable error
71  * @retval #DBOX_STATUS_ERROR_NONE Successfully sent
72  */
73 extern int dynamicbox_set_extra_info(const char *id, const char *content, const char *title, const char *icon, const char *name);
74
75 /**
76  * @brief Return values of dynamicbox programming interfaces: Operation is successfully done.
77  * @since_tizen 2.3
78  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
79  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
80  */
81 extern const int DBOX_DONE;
82
83 /**
84  * @brief Return values of dynamicbox programming interfaces: Contents are updated.
85  * @since_tizen 2.3
86  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
87  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
88  */
89 extern const int DBOX_OUTPUT_UPDATED;
90
91 /**
92  * @brief Return values of dynamicbox programming interfaces: Need to call the dynamicbox_need_to_update and dynamicbox_update_content.
93  * @since_tizen 2.3
94  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
95  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
96  */
97 extern const int DBOX_NEED_TO_SCHEDULE;
98
99 /**
100  * @internal
101  * @brief Return values of dynamicbox programming interfaces: Need to create a new instance.
102  * @since_tizen 2.3
103  */
104 extern const int DBOX_NEED_TO_CREATE;
105
106 /**
107  * @brief Return values of dynamicbox programming interfaces: Need to do force update.
108  * @since_tizen 2.3
109  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
110  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
111  */
112 extern const int DBOX_FORCE_TO_SCHEDULE;
113
114 /**
115  * @brief Return values of dynamicbox programming interfaces: Need to destroy this instance.
116  * @since_tizen 2.3
117  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
118  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
119  */
120 extern const int DBOX_NEED_TO_DESTROY;
121
122 /**
123  * @brief Return values of dynamicbox programming interfaces: Need to update.
124  * @since_tizen 2.3
125  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
126  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
127  */
128 extern const int DBOX_NEED_TO_UPDATE;
129
130 /**
131  * @brief System event type: System font is changed.
132  * @since_tizen 2.3
133  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
134  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
135  */
136 extern const int DBOX_SYS_EVENT_FONT_CHANGED;
137
138 /**
139  * @brief System event type: System language is changed.
140  * @since_tizen 2.3
141  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
142  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
143  */
144 extern const int DBOX_SYS_EVENT_LANG_CHANGED;
145
146 /**
147  * @brief System event type: System time is changed.
148  * @since_tizen 2.3
149  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
150  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
151  */
152 extern const int DBOX_SYS_EVENT_TIME_CHANGED;
153
154 /**
155  * @brief System event type: MMC Status change event.
156  * @since_tizen 2.3
157  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
158  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
159  */
160 extern const int DBOX_SYS_EVENT_MMC_STATUS_CHANGED;
161
162 /**
163  * @brief System event type: Region changed.
164  * @since_tizen 2.3
165  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
166  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
167  */
168 extern const int DBOX_SYS_EVENT_REGION_CHANGED;
169
170 /**
171  * @brief System event type: Accessibility mode changed.
172  * @since_tizen 2.3
173  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
174  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
175  */
176 extern const int DBOX_SYS_EVENT_TTS_CHANGED;
177
178 /**
179  * @brief System event type: Dynamic Box is paused.
180  * @since_tizen 2.3
181  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
182  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
183  */
184 extern const int DBOX_SYS_EVENT_PAUSED;
185
186 /**
187  * @brief System event type: Dynamic Box is resumed.
188  * @since_tizen 2.3
189  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
190  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
191  */
192 extern const int DBOX_SYS_EVENT_RESUMED;
193
194 /**
195  * @brief System event type: Dynamic Box instance is removed from a viewer.
196  * @since_tizen 2.3
197  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
198  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
199  */
200 extern const int DBOX_SYS_EVENT_DELETED;
201
202 /**
203  * @brief Requests to schedule the update operation to a provider.
204  *        Your DBox will get the update request, if the @a id is specified, specific box only will get it.
205  * @since_tizen 2.3
206  * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
207  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
208  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
209  * @return If succes returns 0 or return less than 0
210  * @retval #DBOX_STATUS_ERROR_NONE Successfully triggered
211  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
212  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Not enough memory
213  * @retval #DBOX_STATUS_ERROR_NOT_EXIST Given id instance is not exist
214  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
215  * @retval #DBOX_STATUS_ERROR_DISABLED in case of direct request for updating is disabled
216  */
217 extern int dynamicbox_request_update(const char *id);
218
219 /**
220  * @brief Send a freeze request to the viewer (homescreen)
221  * @details
222  *        The viewer will get this request via event callback.
223  *        Then it should freeze its scroller or stop moving the dynamicbox.
224  * @since_tizen 2.3
225  * @remarks If the viewer doesn't care this request, this will has no effect.
226  * @param[in] dboxid Dynamic Box Package Id
227  * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
228  * @privlevel public
229  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
230  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
231  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
232  * @return int type
233  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
234  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Out of memory
235  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
236  * @retval #DBOX_STATUS_ERROR_FAULT Failed to send requet
237  * @retval #DBOX_STATUS_ERROR_NONE Successfully requested
238  * @see dynamicbox_release_scroller()
239  */
240 extern int dynamicbox_freeze_scroller(const char *dboxid, const char *id);
241
242 /**
243  * @brief Send a release request to the viewer (homescreen)
244  * @details
245  *        The viewer will get this request via event callback.
246  *        Then it should release its scroller or continue moving the dynamicbox.
247  * @since_tizen 2.3
248  * @remarks If the viewer doesn't care this request, this will has no effect.
249  * @param[in] dboxid Dynamic Box Package Id
250  * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
251  * @privlevel public
252  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
253  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
254  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
255  * @return int type
256  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
257  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
258  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Out of memory
259  * @retval #DBOX_STATUS_ERROR_FAULT Failed to send requet
260  * @retval #DBOX_STATUS_ERROR_NONE Successfully requested
261  * @see dynamicbox_freeze_scroller()
262  */
263 extern int dynamicbox_thaw_scroller(const char *dboxid, const char *id);
264
265 /**
266  * @}
267  */
268
269 #ifdef __cplusplus
270 }
271 #endif
272
273 #endif
274 /* End of a file */