a2fe240b5125af38cbfb980b0dd44c34ef023dae
[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 /**
18  * Export by dynamicbox_service
19  */
20 #include <dynamicbox_buffer.h>
21 #include <dynamicbox_script.h>
22
23 #ifndef __DYNAMICBOX_UILITY_H
24 #define __DYNAMICBOX_UILITY_H
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 /**
31  * @file dynamicbox.h
32  * @brief This file declares API of libdynamicbox library
33  * @since_tizen 2.3
34  */
35
36 /**
37  * @addtogroup CAPI_DYNAMICBOX_UTILITY_MODULE
38  * @{
39  */
40
41 /**
42  * @internal
43  * @brief Definition for COLOR BLOCK.
44  * @since_tizen 2.3
45  */
46 #define DBOX_DESC_TYPE_COLOR "color"
47
48 /**
49  * @internal
50  * @brief Definition for TEXT BLOCK.
51  * @since_tizen 2.3
52  */
53 #define DBOX_DESC_TYPE_TEXT "text"
54
55 /**
56  * @internal
57  * @brief Definition for IMAGE BLOCK.
58  * @since_tizen 2.3
59  */
60 #define DBOX_DESC_TYPE_IMAGE "image"
61
62 /**
63  * @internal
64  * @brief Definition for SIGNAL BLOCK.
65  * @since_tizen 2.3
66  */
67 #define DBOX_DESC_TYPE_SIGNAL "signal"
68
69 /**
70  * @internal
71  * @brief Definition for INFO BLOCK.
72  * @since_tizen 2.3
73  */
74 #define DBOX_DESC_TYPE_INFO "info"
75
76 /**
77  * @internal
78  * @brief Definition for DRAG BLOCK.
79  * @since_tizen 2.3
80  */
81 #define DBOX_DESC_TYPE_DRAG "drag"
82
83 /**
84  * @internal
85  * @brief Definition for SCRIPT SCRIPT.
86  * @since_tizen 2.3
87  */
88 #define DBOX_DESC_TYPE_SCRIPT "script"
89
90 /**
91  * @internal
92  * @brief Definition for ACCESSIBILITY INFORMATION BLOCK.
93  * @since_tizen 2.3
94  */
95 #define DBOX_DESC_TYPE_ACCESS "access"
96
97 /**
98  * @internal
99  * @brief Definition for accessibility operation.
100  * @since_tizen 2.3
101  */
102 #define DBOX_DESC_TYPE_ACCESS_OPERATION "access,operation"
103
104 /**
105  * @internal
106  * @brief Definition for set highlight on specified part.
107  * @since_tizen 2.3
108  */
109 #define DBOX_DESC_DATA_ACCESS_OPERATION_HL_SET "set,hl"
110
111 /**
112  * @internal
113  * @brief Definition for remove highlight from specified part.
114  * @since_tizen 2.3
115  */
116 #define DBOX_DESC_DATA_ACCESS_OPERATION_HL_UNSET "unset,hl"
117
118 /**
119  * @internal
120  * @brief Definition for move the highlight to next part.
121  * @since_tizen 2.3
122  */
123 #define DBOX_DESC_DATA_ACCESS_OPERATION_HL_NEXT "next,hl"
124
125 /**
126  * @internal
127  * @brief Definition for move the highlight to previous part.
128  * @since_tizen 2.3
129  */
130 #define DBOX_DESC_DATA_ACCESS_OPERATION_HL_PREV "prev,hl"
131
132 /**
133  * @internal
134  * @brief Definition for reset the chain of accessibility highlight list.
135  * @since_tizen 2.3
136  */
137 #define DBOX_DESC_DATA_ACCESS_OPERATION_RESET "reset,focus"
138
139 /**
140  * @internal
141  * @brief Definition for specify the highlight move option.
142  * @details If the highlight list reaches to the last object, move back to the first object.
143  * @since_tizen 2.3
144  */
145 #define DBOX_DESC_OPTION_ACCESS_HL_LOOP "cycle"
146
147 /**
148  * @internal
149  * @brief Definition for specify the highlight move option.
150  * @details If the highlight list reaches to the last object(or the first object),
151  * the "prev,hl", "next,hl" will be failed.
152  * @since_tizen 2.3
153  */
154 #define DBOX_DESC_OPTION_ACCESS_HL_NOLOOP "no,cycle"
155
156 /**
157  * @internal
158  * @brief Dynamic Box description data handle.
159  * @since_tizen 2.3
160  */
161 typedef struct dynamicbox_desc *dynamicbox_desc_h;
162
163 /**
164  * @internal
165  * @brief Flush Callback for snapshot window
166  * @since_tizen 2.3
167  */
168 typedef void (*dynamicbox_flush_cb)(void *snapshot_window, const char *id, int status, void *data);
169
170 /**
171  * @internal
172  * @brief Updates a description file.
173  * @since_tizen 2.3
174  * @remarks Must be used only by Inhouse Dynamic Box.
175  * @param[in] id Dynamic Box Instance Id
176  * @param[in] gbar 1 for Glance Bar or 0
177  * @privlevel public
178  * @privilege %http://tizen.org/privilege/core/dynamicbox
179  * @return Handle of desc instance
180  * @pre Should be loaded by data-provider-slave.
181  * @post Should be destroyed(flushed) using dynamicbox_desc_close() API.
182  * @see dynamicbox_desc_close()
183  */
184 extern dynamicbox_desc_h dynamicbox_desc_open(const char *id, int gbar);
185
186 /**
187  * @internal
188  * @brief Completes the description file update.
189  * @details Only if this API is called, the description data will be applied to the content of Dynamic Box (or GBar).
190  * @since_tizen 2.3
191  * @remarks Must be used only by Inhouse Dynamic Box.
192  * @param[in] handle Handle which is created by dynamicbox_desc_open() function
193  * @privlevel public
194  * @privilege %http://tizen.org/privilege/core/dynamicbox
195  * @return int type
196  * @retval #DBOX_STATUS_ERROR_NONE If the flushing description data is successfully done
197  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER If the given handle is not valid
198  * @pre Handle must be created by dynamicbox_desc_open()
199  * @post Handle must not be used after return from this function.
200  * @see dynamicbox_desc_open()
201  */
202 extern int dynamicbox_desc_close(dynamicbox_desc_h handle);
203
204 /**
205  * @internal
206  * @brief Sets the category information of current description data.
207  * @details Creates a new description block for updating category information of layout object.
208  * @since_tizen 2.3
209  * @param[in] handle Handle which is created by dynamicbox_desc_open() function
210  * @param[in] id Id string of target object
211  * @param[in] category Category string that will be used by layout object
212  * @return int type
213  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid handle
214  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Memory is not enough to add this block
215  * @retval index Index(>=0) of added block, which can be used by dynamicbox_desc_set_id()
216  * @pre Must be called after create a handle using dynamicbox_desc_open()
217  * @see dynamicbox_desc_set_id()
218  */
219 extern int dynamicbox_desc_set_category(dynamicbox_desc_h handle, const char *id, const char *category);
220
221 /**
222  * @internal
223  * @brief Sets the content size.
224  * @details Sets the content size of layout.
225  * @since_tizen 2.3
226  * @param[in] handle Handle which is created by dynamicbox_desc_open() function
227  * @param[in] id Id string of target object
228  * @param[in] w Width in pixel
229  * @param[in] h Height in pixel
230  * @return int type
231  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
232  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Not enough memory to add a new block
233  * @retval index Index(>=0) of added block Successfully added
234  * @see dynamicbox_desc_open()
235  * @see dynamicbox_desc_set_id()
236  */
237 extern int dynamicbox_desc_set_size(dynamicbox_desc_h handle, const char *id, int w, int h);
238
239 /**
240  * @internal
241  * @brief Sets the target id of the given block.
242  * @details Only available for the script block.
243  * @since_tizen 2.3
244  * @param[in] handle Handle which is created by dynamicbox_desc_open() function
245  * @param[in] idx Index of target block
246  * @param[in] id Id String which will be used by other dynamicbox_desc_XXX functions
247  * @return int type
248  * @retval #DBOX_STATUS_ERROR_NONE Id is successfully updated for given idx of desc block
249  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
250  * @retval #DBOX_STATUS_ERROR_NOT_EXIST Given index of desc block is not exists
251  * @pre Desc block should be exists which has given index "idx".
252  * @post Specified Id string("id") can be used by other dynamicbox_desc_XXXX functions.
253  * @see dynamicbox_desc_open()
254  * @see dynamicbox_desc_set_id()
255  */
256 extern int dynamicbox_desc_set_id(dynamicbox_desc_h handle, int idx, const char *id);
257
258 /**
259  * @internal
260  * @brief Adds a new block.
261  * @since_tizen 2.3
262  * @param[in] handle Handle which is created by the dynamicbox_desc_open() function
263  * @param[in] id ID of source script object
264  * @param[in] type Type (image|text|script|signal|.. etc)
265  * @param[in] part Target part to update with given content(data)
266  * @param[in] data Content for specified part
267  * @param[in] option Option for the block. (script: group, image: option, ...)
268  * @return Index of current description block
269  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
270  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Not enough memory to add a new desc block
271  * @retval index Index(>=0) of added desc block
272  * @pre Handle must be created using dynamicbox_desc_open.
273  * @see dynamicbox_desc_set_id()
274  * @see dynamicbox_desc_del_block()
275  */
276 extern int dynamicbox_desc_add_block(dynamicbox_desc_h handle, const char *id, const char *type, const char *part, const char *data, const char *option);
277
278 /**
279  * @internal
280  * @brief Deletes an added block.
281  * @since_tizen 2.3
282  * @details If you discard the added desc block, use this API and the index of the created desc block.
283  * @param[in] handle Handle which is created by dynamicbox_desc_open() function
284  * @param[in] idx Index of added block, returned from dynamicbox_desc_add_block(), dynamicbox_desc_set_size(), dynamicbox_desc_set_category(), etc
285  * @return int type
286  * @retval #DBOX_STATUS_ERROR_NONE Successfully deleted
287  * @retval #DBOX_STATUS_ERROR_NOT_EXIST Given index of desc block is not exists
288  * @pre Index must be exists.
289  * @see dynamicbox_desc_add_block()
290  * @see dynamicbox_desc_open()
291  */
292 extern int dynamicbox_desc_del_block(dynamicbox_desc_h handle, int idx);
293
294 /**
295  * @brief Creates an Object to create an elm_win object.
296  * @details Creating a new Object using Dynamic Box frame buffer.
297  * @since_tizen 2.3
298  * @param[in] id Instance Id
299  * @param[in] gbar 1 if this object is created for Glance Bar or 0 (for Dynamic Box)
300  * @privlevel public
301  * @privilege %http://tizen.org/privilege/core/dynamicbox
302  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
303  * @feature http://tizen.org/feature/shell.appwidget
304  * @return void* Object type
305  * @retval Address Valid evas object
306  * @retval @c NULL failed to create
307  */
308 extern void *dynamicbox_get_evas_object(const char *id, int gbar);
309
310 /**
311  * @brief Set extra information for updated content.
312  * @details
313  *      If the provider should give some hints to the viewer,
314  *      such as title, icon and name, this function can set them.
315  *      provider will send those information to the viewer when the
316  *      content is updated.
317  * @since_tizen 2.3
318  * @remarks This function only works with the buffer type inhouse provider.
319  * @param[in] id Dynamic Box Instance Id
320  * @param[in] content Content string that will pass to a Dynamic Box via dynamicbox_create interface when it is re-created.
321  * @param[in] title Human readable text for accessitility, summarized text for representing the content of a box.
322  * @param[in] icon Path of icon image file - alternative image content
323  * @param[in] name Name of a box - alternative text content
324  * @return int type
325  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
326  * @feature http://tizen.org/feature/shell.appwidget
327  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Out of memory
328  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
329  * @retval #DBOX_STATUS_ERROR_FAULT Unrecoverable error
330  * @retval #DBOX_STATUS_ERROR_NONE Successfully sent
331  */
332 extern int dynamicbox_set_extra_info(const char *id, const char *content, const char *title, const char *icon, const char *name);
333
334
335 /**
336  * @internal
337  * @brief Structure for a Dynamic Box buffer defined by a provider.
338  * @since_tizen 2.3
339  */
340 typedef struct dynamicbox_buffer *dynamicbox_buffer_h;
341
342 /**
343  * @brief Return values of dynamicbox programming interfaces: Operation is successfully done.
344  * @since_tizen 2.3
345  */
346 extern const int DBOX_DONE;
347
348 /**
349  * @brief Return values of dynamicbox programming interfaces: Contents are updated.
350  * @since_tizen 2.3
351  */
352 extern const int DBOX_OUTPUT_UPDATED;
353
354 /**
355  * @brief Return values of dynamicbox programming interfaces: Need to call the dynamicbox_need_to_update and dynamicbox_update_content.
356  * @since_tizen 2.3
357  */
358 extern const int DBOX_NEED_TO_SCHEDULE;
359
360 /**
361  * @brief Return values of dynamicbox programming interfaces: Need to do force update.
362  * @since_tizen 2.3
363  */
364 extern const int DBOX_FORCE_TO_SCHEDULE;
365
366 /**
367  * @internal
368  * @brief Return values of dynamicbox programming interfaces: Need to create a new instance.
369  * @since_tizen 2.3
370  */
371 extern const int DBOX_NEED_TO_CREATE;
372
373 /**
374  * @brief Return values of dynamicbox programming interfaces: Need to destroy this instance.
375  * @since_tizen 2.3
376  */
377 extern const int DBOX_NEED_TO_DESTROY;
378
379 /**
380  * @brief Return values of dynamicbox programming interfaces: Need to update.
381  * @since_tizen 2.3
382  */
383 extern const int DBOX_NEED_TO_UPDATE;
384
385 /**
386  * @internal
387  * @brief Return values of dynamicbox programming interfaces: Using network.
388  * @since_tizen 2.3
389  */
390 extern const int DBOX_USE_NET;
391
392 /**
393  * @brief System event type: System font is changed.
394  * @since_tizen 2.3
395  */
396 extern const int DBOX_SYS_EVENT_FONT_CHANGED;
397
398 /**
399  * @brief System event type: System language is changed.
400  * @since_tizen 2.3
401  */
402 extern const int DBOX_SYS_EVENT_LANG_CHANGED;
403
404 /**
405  * @brief System event type: System time is changed.
406  * @since_tizen 2.3
407  */
408 extern const int DBOX_SYS_EVENT_TIME_CHANGED;
409
410 /**
411  * @brief System event type: Region changed.
412  * @since_tizen 2.3
413  */
414 extern const int DBOX_SYS_EVENT_REGION_CHANGED;
415
416 /**
417  * @brief System event type: Accessibility mode changed.
418  * @since_tizen 2.3
419  */
420 extern const int DBOX_SYS_EVENT_TTS_CHANGED;
421
422 /**
423  * @brief System event type: Dynamic Box is paused.
424  * @since_tizen 2.3
425  */
426 extern const int DBOX_SYS_EVENT_PAUSED;
427
428 /**
429  * @brief System event type: Dynamic Box is resumed.
430  * @since_tizen 2.3
431  */
432 extern const int DBOX_SYS_EVENT_RESUMED;
433
434 /**
435  * @internal
436  * @brief System event type: MMC Status change event.
437  * @since_tizen 2.3
438  */
439 extern const int DBOX_SYS_EVENT_MMC_STATUS_CHANGED;
440
441 /**
442  * @brief System event type: Dynamic Box instance is removed from a viewer.
443  * @since_tizen 2.3
444  */
445 extern const int DBOX_SYS_EVENT_DELETED;
446
447 /**
448  * @internal
449  * @brief Notifies the updated content to the provider.
450  * @details Forcedly notifies the updated contents.
451  *    This function can be used from async callback function to notify the updated content.
452  * @since_tizen 2.3
453  * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
454  * @param[in] gbar 1 for updating content of Glance Bar or 0(for content of Dynamic Box)
455  * @return int type
456  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Not enough memory
457  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
458  * @retval #DBOX_STATUS_ERROR_IO_ERROR I/O failed, Cannot access given resource file(id)
459  * @retval #DBOX_STATUS_ERROR_NONE Successfully notified
460  * @pre This API only can be used after loaded into the data-provider-slave process.
461  */
462 extern int dynamicbox_content_is_updated(const char *id, int gbar);
463
464 /**
465  * @internal
466  * @brief Acquires a buffer for GBar or DBox, currently only the GBar is supported.
467  * @since_tizen 2.3
468  * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
469  * @param[in] gbar 1 for Glance Bar or 0 for Dynamic Box
470  * @param[in] width Width in pixel
471  * @param[in] height Height in pixel
472  * @param[in] pixels Size of a pixel in bytes
473  * @param[in] handler Event handling callback
474  * @param[in] data User data for event handling callback
475  * @privlevel public
476  * @privilege %http://tizen.org/privilege/core/dynamicbox
477  * @return Buffer handle
478  * @retval @c NULL Failed to acquire buffer
479  * @retval handler Handle object
480  * @pre Given instance must be specify its type as buffer. or this API will be fail.
481  * @post Allocated buffer object must be released via dynamicbox_release_buffer().
482  * @see dynamicbox_release_buffer()
483  */
484 extern dynamicbox_buffer_h dynamicbox_create_buffer(const char *id, int gbar, int auto_align, int (*handler)(dynamicbox_buffer_h, dynamicbox_buffer_event_data_t, void *), void *data);
485
486 /**
487  * @internal
488  * @brief Acquire a buffer for GBar or DBox.
489  * @since_tizen 2.3
490  * @param[in] handle Buffer handle
491  * @param[in] idx Index of a buffer, DBOX_PRIMARY_BUFFER is used for accessing primary buffer
492  * @param[in] width Width of a buffer
493  * @param[in] height Height of a buffer
494  * @param[in] pixels Pixel size in byte
495  * @privlevel public
496  * @privilege %http://tizen.org/privilege/core/dynamicbox
497  * @return int status
498  * @retval #DBOX_STATUS_ERROR_NONE Successfully allocated
499  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameter
500  * @retval #DBOX_STATUS_ERROR_FAULT Unrecoverable error occurred
501  * @pre dynamicbox_create_buffer() must be called
502  * @see dynamicbox_create_buffer()
503  * @see dynamicbox_release_buffer()
504  */
505 extern int dynamicbox_acquire_buffer(dynamicbox_buffer_h handle, int idx, int width, int height, int pixels);
506
507 /**
508  * @internal
509  * @brief Acquires the Id of Resource (window system).
510  * @details Only if the provider uses Resource for providing render buffer.
511  * @since_tizen 2.3
512  * @remarks Pixmap Id can be destroyed if you call the dynamicbox_release_buffer(). Then this Resource Id is not guaranteed to use.
513  * @param[in] handle Buffer handle
514  * @param[in] idx Index of a buffer, #c DBOX_PRIMARY_BUFFER is used for accessing the primary buffer
515  * @return unsigned int Resource Id
516  * @retval >0 Resource Id
517  * @retval 0 Failed to get Resource Id
518  * @pre The system must be set to use the Resource Id method for content sharing.
519  * @see dynamicbox_acquire_buffer()
520  */
521 extern unsigned int dynamicbox_resource_id(dynamicbox_buffer_h handle, int idx);
522
523 /**
524  * @internal
525  * @brief Releases the buffer of dynamicbox.
526  * @since_tizen 2.3
527  * @param[in] handle Buffer handle
528  * @param[in] idx Index of a buffer, #c DBOX_PRIMARY_BUFFER is used for accessing the primary buffer
529  * @privlevel public
530  * @privilege %http://tizen.org/privilege/core/dynamicbox
531  * @return int status
532  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
533  * @retval #DBOX_STATUS_ERROR_NONE Successfully released
534  * @pre Handle must be created using dynamicbox_acquire_buffer().
535  * @see dynamicbox_acquire_buffer()
536  */
537 extern int dynamicbox_release_buffer(dynamicbox_buffer_h handle, int idx);
538
539 /**
540  * @internal
541  * @brief Destroy a buffer of dynamicbox
542  * @since_tizen 2.3
543  * @param[in] handle buffer handle
544  * @privlevel public
545  * @privilege %http://tizen.org/privilege/core/dynamicbox
546  * @return int status
547  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMTER Invalid argument
548  * @retval #DBOX_STATUS_ERROR_NONE Successfully destroyed
549  * @see dynamicbox_create_buffer()
550  */
551 extern int dynamicbox_destroy_buffer(dynamicbox_buffer_h handle);
552
553 /**
554  * @internal
555  * @brief Gets the address of buffer for S/W rendering.
556  * @details If you try to use this, after dynamicbox_create_hw_buffer(), you will get @c NULL.
557  *          This API only be used for primary buffer. you cannot access the extra buffer
558  * @since_tizen 2.3
559  * @param[in] handle Buffer handle
560  * @privlevel public
561  * @privilege %http://tizen.org/privilege/core/dynamicbox
562  * @return void* address of the render buffer
563  * @retval @c NULL If it falis to get buffer address
564  * @retval address If it succeed to get the buffer address
565  * @see dynamicbox_unref_buffer()
566  */
567 extern void *dynamicbox_ref_buffer(dynamicbox_buffer_h handle);
568
569 /**
570  * @internal
571  * @brief Releases the S/W render buffer.
572  * @since_tizen 2.3
573  * @param[in] buffer Address of render buffer
574  * @privlevel public
575  * @privilege %http://tizen.org/privilege/core/dynamicbox
576  * @return int type
577  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid handle
578  * @retval #DBOX_STATUS_ERROR_NONE Successfully unreference
579  * @pre dynamicbox_ref_buffer() must be called.
580  * @see dynamicbox_ref_buffer()
581  */
582 extern int dynamicbox_unref_buffer(void *buffer);
583
584 /**
585  * @internal
586  * @brief Synchronizes the updated buffer.
587  * @details This is only needed for non-H/W accelerated buffer.
588  *          This API is only supported for primary buffer (#c DBOX_PRIMARY_BUFFER)
589  * @since_tizen 2.3
590  * @param[in] handle Buffer handle
591  * @privlevel public
592  * @privilege %http://tizen.org/privilege/core/dynamicbox
593  * @return int type
594  * @retval #DBOX_STATUS_ERROR_NONE Successfully sync'd
595  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
596  * @see dynamicbox_acquire_buffer()
597  */
598 extern int dynamicbox_sync_buffer(dynamicbox_buffer_h handle);
599
600 /**
601  * @brief Requests to schedule the update operation to a provider.
602  *        Your DBox will get the update request, if the @a id is specified, specific box only will get it.
603  * @since_tizen 2.3
604  * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
605  * @privlevel public
606  * @privilege %http://tizen.org/privilege/core/dynamicbox
607  * @return If succes returns 0 or return less than 0
608  * @retval #DBOX_STATUS_ERROR_NONE Successfully triggered
609  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
610  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Not enough memory
611  * @retval #DBOX_STATUS_ERROR_NOT_EXIST Given id instance is not exist
612  */
613 extern int dynamicbox_request_update(const char *id);
614
615 /**
616  * @internal
617  * @brief Checks whether the dynamicbox supports H/W acceleration or not.
618  *        This API is only supported for primary buffer (#c DBOX_PRIMARY_BUFFER)
619  * @since_tizen 2.3
620  * @param[in] handle Buffer handle
621  * @return int type
622  * @retval 1 If the buffer handle support the H/W acceleration buffer
623  * @retval 0 If it doesn not supported
624  * @see dynamicbox_acquire_buffer()
625  */
626 extern int dynamicbox_support_hw_buffer(dynamicbox_buffer_h handle);
627
628 /**
629  * @internal
630  * @brief Creates the H/W accelerated buffer.
631  *        This API is only supported for primary buffer (#c DBOX_PRIMARY_BUFFER)
632  * @since_tizen 2.3
633  * @param[in] handle Buffer handle
634  * @privlevel public
635  * @privilege %http://tizen.org/privilege/core/dynamicbox
636  * @return int type
637  * @retval #DBOX_STATUS_ERROR_ALREADY H/W buffer is already created
638  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
639  * @retval #DBOX_STATUS_ERROR_NONE Successfully created
640  * @pre Must be checked whether the H/W buffer is supported or not.
641  * @post Must be destroyed if it is not necessary.
642  * @see dynamicbox_support_hw_buffer()
643  */
644 extern int dynamicbox_create_hw_buffer(dynamicbox_buffer_h handle);
645
646 /**
647  * @internal
648  * @brief Destroys the H/W accelerated buffer.
649  *        This API is only supported for primary buffer (#c DBOX_PRIMARY_BUFFER)
650  * @since_tizen 2.3
651  * @param[in] handle Buffer handle
652  * @privlevel public
653  * @privilege %http://tizen.org/privilege/core/dynamicbox
654  * @return int type
655  * @retval #DBOX_STATUS_ERROR_NONE Successfully destroyed
656  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
657  * @pre Must be created h/w buffer using dynamicbox_create_hw_buffer.
658  * @see dynamicbox_create_hw_buffer()
659  */
660 extern int dynamicbox_destroy_hw_buffer(dynamicbox_buffer_h handle);
661
662 /**
663  * @internal
664  * @brief Gets the address of the accelerated H/W buffer.
665  *        This API is only supported for primary buffer (#c DBOX_PRIMARY_BUFFER)
666  * @since_tizen 2.3
667  * @param[in] handle Buffer handle
668  * @privlevel public
669  * @privilege %http://tizen.org/privilege/core/dynamicbox
670  * @return void* type
671  * @retval @c NULL Failed to get H/W accelerated buffer address
672  * @retval addr H/W accelerated buffer address
673  * @see dynamicbox_create_hw_buffer()
674  */
675 extern void *dynamicbox_buffer_hw_buffer(dynamicbox_buffer_h handle);
676
677 /**
678  * @internal
679  * @brief Get the stride information from the buffer info
680  *        This API is only supported for primary buffer (#c DBOX_PRIMARY_BUFFER)
681  * @since_tizen 2.3
682  * @param[in] handle Buffer handle
683  * @return int stride size
684  * @retval positive_value length of stride
685  * @return #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameter
686  * @return #DBOX_STATUS_ERROR_FAULT Unrecoverable error
687  * @see dynamicbox_create_hw_buffer()
688  */
689 extern int dynamicbox_buffer_stride(dynamicbox_buffer_h handle);
690
691 /**
692  * @internal
693  * @brief Pre-processes for rendering content.
694  * @details This is only needed for accessing H/W accelerated buffer.
695  * @since_tizen 2.3
696  * @param[in] handle Buffer handle
697  * @privlevel public
698  * @privilege %http://tizen.org/privilege/core/dynamicbox
699  * @return int type
700  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid handle
701  * @retval #DBOX_STATUS_ERROR_NONE Successfully done
702  * @post dynamicbox_buffer_post_render must be called after the rendering (accessing buffer) is completed.
703  * @see dynamicbox_support_hw_buffer()
704  * @see dynamicbox_buffer_post_render()
705  */
706 extern int dynamicbox_buffer_pre_render(dynamicbox_buffer_h handle);
707
708 /**
709  * @internal
710  * @brief Post-processes for rendering content.
711  * @since_tizen 2.3
712  * @param[in] handle Buffer handle
713  * @privlevel public
714  * @privilege %http://tizen.org/privilege/core/dynamicbox
715  * @return If succes returns 0 or return less than 0
716  * @retval #DBOX_STATUS_ERROR_NONE If succeed
717  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
718  * @pre dynamicbox_buffer_pre_render must be called.
719  * @see dynamicbox_support_hw_buffer()
720  * @see dynamicbox_buffer_pre_render()
721  */
722 extern int dynamicbox_buffer_post_render(dynamicbox_buffer_h handle);
723
724 /**
725  * @internal
726  * @brief Sends a request to the viewer (homescreen) to close the GBar.
727  * @details Even though you call this function. the homescreen can ignore it.
728  * @since_tizen 2.3
729  * @param[in] dboxid Dynamic Box Package Id
730  * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
731  * @param[in] reason #DBOX_STATUS_ERROR_NONE(0)
732  * @privlevel public
733  * @privilege %http://tizen.org/privilege/core/dynamicbox
734  * @return int type
735  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
736  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Out of memory
737  * @retval #DBOX_STATUS_ERROR_FAULT Failed to send a request
738  * @retval #DBOX_STATUS_ERROR_NONE Successfully requested
739  */
740 extern int dynamicbox_request_close_glance_bar(const char *dboxid, const char *id, int reason);
741
742 /**
743  * @brief Send a freeze request to the viewer (homescreen)
744  * @details
745  *        The viewer will get this request via event callback.
746  *        Then it should freeze its scroller or stop moving the dynamicbox.
747  * @since_tizen 2.3
748  * @remarks If the viewer doesn't care this request, this will has no effect.
749  * @param[in] dboxid Dynamic Box Package Id
750  * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
751  * @privlevel public
752  * @privilege %http://tizen.org/privilege/core/dynamicbox
753  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
754  * @feature http://tizen.org/feature/shell.appwidget
755  * @return int type
756  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
757  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Out of memory
758  * @retval #DBOX_STATUS_ERROR_FAULT Failed to send requet
759  * @retval #DBOX_STATUS_ERROR_NONE Successfully requested
760  * @see dynamicbox_release_scroller()
761  */
762 extern int dynamicbox_freeze_scroller(const char *dboxid, const char *id);
763
764 /**
765  * @brief Send a release request to the viewer (homescreen)
766  * @details
767  *        The viewer will get this request via event callback.
768  *        Then it should release its scroller or continue moving the dynamicbox.
769  * @since_tizen 2.3
770  * @remarks If the viewer doesn't care this request, this will has no effect.
771  * @param[in] dboxid Dynamic Box Package Id
772  * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
773  * @privlevel public
774  * @privilege %http://tizen.org/privilege/core/dynamicbox
775  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
776  * @feature http://tizen.org/feature/shell.appwidget
777  * @return int type
778  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
779  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Out of memory
780  * @retval #DBOX_STATUS_ERROR_FAULT Failed to send requet
781  * @retval #DBOX_STATUS_ERROR_NONE Successfully requested
782  * @see dynamicbox_freeze_scroller()
783  */
784 extern int dynamicbox_thaw_scroller(const char *dboxid, const char *id);
785
786 /**
787  * @internal
788  * @brief Create a snapshot window
789  * @details
790  *         If you want create a snapshot image of contents, create this snapshot window
791  *         But it will not renders object asynchronously,
792  *         So you have to render the objects immediately, the delayed rendering object will not be on the canvas
793  *         After flush it to a file.
794  * @since_tizen 2.3
795  * @param[in] id
796  * @param[in] size_type
797  * @privlevel public
798  * @privilege %http://tizen.org/privilege/core/dynamicbox
799  * @return void* window
800  * @retval @c NULL failed to create a snapshot window
801  * @retval Object window object (ex, elementary window)
802  * @see dynamicbox_snapshot_window_flush()
803  */
804 extern void *dynamicbox_snapshot_window_add(const char *id, int size_type);
805
806 /**
807  * @internal
808  * @brief Flush to a file for snapshot window
809  * @since_tizen 2.3
810  * @param[in] snapshot_win Snapshot window
811  * @param[in] timeout After this, the image file will be created
812  * @param[in] flush_cb Right after flush an image file, this callback will be called
813  * @param[in] data Callback data for flush_cb
814  * @return int status
815  * @retval #DBOX_STATUS_ERROR_NONE Successfully flushed (flush timer added)
816  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid paramter
817  * @retval #DBOX_STATUS_ERROR_FAULT Failed to create a flush timer
818  * @see dynamicbox_snapshot_window_add()
819  */
820 extern int dynamicbox_snapshot_window_flush(void *snapshot_win, double timeout, dynamicbox_flush_cb flush_cb, void *data);
821
822 /**
823  * @internal
824  * @brief Sending the updated event to the viewer
825  * @since_tizen 2.3
826  * @param[in] handle Dynamicbox Buffer Handle
827  * @param[in] idx Index of a buffer
828  * @return int status
829  * @retval #DBOX_STATUS_ERROR_NONE Successfully sent
830  */
831 extern int dynamicbox_send_updated_by_idx(dynamicbox_buffer_h handle, int idx);
832
833 /**
834  * @}
835  */
836
837 #ifdef __cplusplus
838 }
839 #endif
840
841 #endif
842 /* End of a file */