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