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