83e5026ee59db9906734c149f96ea8fadf8c9d73
[apps/home/attach-panel.git] / include / attach_panel.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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 __TIZEN_ATTACH_PANEL_H__
18 #define __TIZEN_ATTACH_PANEL_H__
19
20 #include <Elementary.h>
21 #include <tizen_error.h>
22 #include <app_control.h>
23 #include <stdbool.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /**
30  * @file attach_panel.h
31  * @brief Declares the API of the libattach-panel library.
32  */
33
34 /**
35  * @addtogroup CAPI_PANEL_ATTACH_MODULE
36  * @{
37  */
38
39 /**
40  * @brief Enumeration for content categories
41  * @since_tizen 2.4
42  * @see attach_panel_add_content_category()
43  * @see attach_panel_remove_content_category()
44  */
45 typedef enum attach_panel_content_category {
46         ATTACH_PANEL_CONTENT_CATEGORY_IMAGE = 1, /**< Attaching images from the gallery */
47         ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, /**< Taking pictures to attach */
48         ATTACH_PANEL_CONTENT_CATEGORY_VOICE, /**< Taking a voice clip to attach */
49         ATTACH_PANEL_CONTENT_CATEGORY_VIDEO, /**< Attaching video from the gallery */
50         ATTACH_PANEL_CONTENT_CATEGORY_AUDIO, /**< Attaching audio from my files */
51         ATTACH_PANEL_CONTENT_CATEGORY_CALENDAR, /**< Attaching calendar data from the calendar */
52         ATTACH_PANEL_CONTENT_CATEGORY_CONTACT, /**< Attaching contact data from the contacts */
53         ATTACH_PANEL_CONTENT_CATEGORY_MYFILES, /**< Attaching files data from my files */
54         ATTACH_PANEL_CONTENT_CATEGORY_VIDEO_RECORDER, /**< Taking a video clip to attach */
55 } attach_panel_content_category_e;
56
57 /**
58  * @brief Enumeration for events
59  * @since_tizen 2.4
60  * @see attach_panel_set_event_cb()
61  * @see attach_panel_unset_event_cb()
62  */
63 typedef enum attach_panel_event {
64         ATTACH_PANEL_EVENT_SHOW_START = 1, /**< Attach panel starts the effect to show */
65         ATTACH_PANEL_EVENT_SHOW_FINISH, /**< Attach panel finishes the effect to show */
66         ATTACH_PANEL_EVENT_HIDE_START, /**< Attach panel starts the effect to hide the panel */
67         ATTACH_PANEL_EVENT_HIDE_FINISH, /**< Attach panel finishes the effect to hide the panel */
68 } attach_panel_event_e;
69
70 /**
71  * @brief Attach panel handle.
72  * @since_tizen 2.4
73  */
74 typedef struct _attach_panel *attach_panel_h;
75
76 /**
77  * @brief Called when an user selects and confirms something to attach on the caller app.
78  *
79  * @since_tizen 2.4
80  * @param[in] attach_panel Attach panel handler
81  * @param[in] content_category results are from the content category
82  * @param[in] result app_control handler.\n
83  *                   The caller app has to use app_control_get_extra_data_array() to get received data.\n
84  *                   http://tizen.org/appcontrol/data/selected\n
85  * @param[in] result_code result of app_control
86  * @param[in] user_data user data
87  * @pre The callback must be registered using attach_panel_set_result_cb()\n
88  * attach_panel_add_content_category() and attach_panel_show() must be called to invoke this callback.
89  *
90  * @see @ref CAPI_APP_CONTROL_MODULE API app_control_get_extra_data_array()
91  * @see attach_panel_set_result_cb()
92  * @see attach_panel_unset_result_cb()
93  */
94 typedef void (*attach_panel_result_cb)(attach_panel_h attach_panel, attach_panel_content_category_e content_category, app_control_h result, app_control_result_e result_code, void *user_data);
95
96 /**
97  * @brief Called when reserved events are published from the panel-side.
98  *
99  * @since_tizen 2.4
100  * @param[in] attach_panel Attach panel handler
101  * @param[in] event Attach panel event
102  * @param[in] event_info additional event information.\n
103  *                       This can be NULL if there are no necessary information.
104  * @param[in] user_data user data
105  * @pre The callback must be registered using attach_panel_set_event_cb()
106  *
107  * @see attach_panel_set_event_cb()
108  * @see attach_panel_unset_event_cb()
109  */
110 typedef void (*attach_panel_event_cb)(attach_panel_h attach_panel, attach_panel_event_e event, void *event_info, void *user_data);
111
112 /**
113  * @brief Enumeration for values of attach-panel response types.
114  * @since_tizen 2.4
115  */
116 typedef enum attach_panel_error {
117         ATTACH_PANEL_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successfully handled */
118         ATTACH_PANEL_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Request is not valid, invalid parameter or invalid argument value */
119         ATTACH_PANEL_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Memory is not enough to handle a new request */
120         ATTACH_PANEL_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Has no permission to attach contents */
121         ATTACH_PANEL_ERROR_ALREADY_EXISTS = TIZEN_ERROR_PANEL | 0x01, /**< There is already a panel in the conformant */
122         ATTACH_PANEL_ERROR_NOT_INITIALIZED = TIZEN_ERROR_PANEL | 0x02, /**< The panel is not initialized yet */
123         ATTACH_PANEL_ERROR_UNSUPPORTED_CONTENT_CATEGORY = TIZEN_ERROR_PANEL | 0x03, /**< Not supported content category */
124         ATTACH_PANEL_ERROR_ALREADY_DESTROYED = TIZEN_ERROR_PANEL | 0x05, /**< The panel is already removed */
125 } attach_panel_error_e;
126
127 /**
128  * @brief Creates an attach panel.
129  * @since_tizen 2.4
130  * @remarks The caller app has to check the return value of this function.\n
131  *          A conformant object can have only one @a attach_panel_h.\n
132  *          If a caller app try to add more than one attach-panel, it fails to add it.
133  *
134  * @param[in] conformant The caller's conformant
135  * @param[out] attach_panel Attach panel handler
136  * @return #ATTACH_PANEL_ERROR_NONE on success,
137  *         otherwise a negative error value
138  * @retval #ATTACH_PANEL_ERROR_NONE Successful
139  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
140  * @retval #ATTACH_PANEL_ERROR_OUT_OF_MEMORY Out of memory
141  * @retval #ATTACH_PANEL_ERROR_ALREADY_EXISTS Already exists
142  *
143  * @see attach_panel_destroy()
144  * @see attach_panel_add_content_category()
145  * @see attach_panel_remove_content_category()
146  * @see attach_panel_set_extra_data()
147  * @see attach_panel_set_result_cb()
148  * @see attach_panel_unset_result_cb()
149  * @see attach_panel_set_event_cb()
150  * @see attach_panel_unset_event_cb()
151  * @see attach_panel_show()
152  * @see attach_panel_hide()
153  * @see attach_panel_get_visibility()
154  *
155  * @par Example
156  * @code
157  * #include <attach_panel.h>
158  *
159  * struct appdata {
160  *   Evas_Object *attach_panel;
161  *   Evas_Object *conformant;
162  * };
163  *
164  * static void _result_cb(attach_panel_h attach_panel, attach_panel_content_category_e content_category, app_control_h result, app_control_result_e result_code, void *data)
165  * {
166  *   char **select = NULL;
167  *   int i = 0;
168  *   int length = 0;
169  *   int ret = APP_CONTROL_ERROR_NONE;
170  *
171  *   if (!result) {
172  *     // Error handling
173  *   }
174  *
175  *   if (APP_CONTROL_RESULT_SUCCEEDED != result_code) {
176  *     // Error handling
177  *   }
178  *
179  *   ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length);
180  *   if (APP_CONTROL_ERROR_NONE != ret || !select) {
181  *     // Error handling
182  *   }
183  *
184  *   for (; i < length; i++) {
185  *      printf("path is %s, %d\n", select[i], length);
186  *      free(select[i]);
187  *   }
188  *
189  *   free(select);
190  * }
191  *
192  * static int app_control(void *data)
193  * {
194  *   struct appdata *ad = data;
195  *   bundle *extra_data = NULL;
196  *   int ret = ATTACH_PANEL_ERROR_NONE;
197  *
198  *   if (!ad) {
199  *     // Error handling
200  *   }
201  *
202  *   if (!ad->conformant) {
203  *     // Error handling
204  *   }
205  *
206  *   ret = attach_panel_create(ad->conformant, &ad->attach_panel);
207  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
208  *      // Error handling
209  *   }
210  *
211  *   extra_data = bundle_create();
212  *   if (!extra_data) {
213  *      // Error handling
214  *   }
215  *
216  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3");
217  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000");
218  *
219  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data);
220  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
221  *      // Error handling
222  *   }
223  *
224  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, extra_data);
225  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
226  *      // Error handling
227  *   }
228  *
229  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE, extra_data);
230  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
231  *      // Error handling
232  *   }
233  *
234  *   ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL);
235  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
236  *      // Error handling
237  *   }
238  *
239  *   ret = attach_panel_show(ad->attach_panel);
240  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
241  *      // Error handling
242  *   }
243  *
244  *   bundle_free(extra_data);
245  *
246  *       return 0;
247  * }
248  *
249  * @endcode
250  */
251 int attach_panel_create(Evas_Object *conformant, attach_panel_h *attach_panel);
252
253 /**
254  * @brief Destroys the attach panel.
255  * @since_tizen 2.4
256  * @remarks The caller app has to check the return value of this function.\n
257  *
258  * @param[in] attach_panel Attach panel handler
259  * @return #ATTACH_PANEL_ERROR_NONE on success,
260  *         otherwise a negative error value
261  * @retval #ATTACH_PANEL_ERROR_NONE Successful
262  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
263  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
264  *
265  * @see attach_panel_create()
266  * @see attach_panel_add_content_category()
267  * @see attach_panel_remove_content_category()
268  * @see attach_panel_set_extra_data()
269  * @see attach_panel_set_result_cb()
270  * @see attach_panel_unset_result_cb()
271  * @see attach_panel_set_event_cb()
272  * @see attach_panel_unset_event_cb()
273  * @see attach_panel_show()
274  * @see attach_panel_hide()
275  * @see attach_panel_get_visibility()
276  *
277  * @par Example
278  * @code
279  * #include <attach_panel.h>
280  *
281  * struct appdata {
282  *   Evas_Object *attach_panel;
283  *   Evas_Object *conformant;
284  * };
285  *
286  * static int app_terminate(void *data)
287  * {
288  *   struct appdata *ad = data;
289  *   int ret = 0;
290  *
291  *   if (!ad) {
292  *     // Error handling
293  *   }
294  *
295  *   if (!ad->attach_panel) {
296  *     // Error handling
297  *   }
298  *
299  *   ret = attach_panel_hide(ad->attach_panel);
300  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
301  *      // Error handling
302  *   }
303  *
304  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE);
305  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
306  *      // Error handling
307  *   }
308  *
309  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA);
310  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
311  *      // Error handling
312  *   }
313  *
314  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE);
315  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
316  *      // Error handling
317  *   }
318  *
319  *   ret = attach_panel_unset_result_cb(ad->attach_panel);
320  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
321  *      // Error handling
322  *   }
323  *
324  *   ret = attach_panel_destroy(ad->attach_panel);
325  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
326  *      // Error handling
327  *   }
328  *   ad->attach_panel = NULL;
329  *
330  *       return 0;
331  * }
332  *
333  * @endcode
334  */
335 int attach_panel_destroy(attach_panel_h attach_panel);
336
337 /**
338  * @brief Adds a content category in the attach panel.
339  * @since_tizen 2.4
340  * @privlevel public
341  * @privilege %http://tizen.org/privilege/mediastorage
342  * @privilege %http://tizen.org/privilege/camera
343  * @privilege %http://tizen.org/privilege/recorder
344  * @privilege %http://tizen.org/privilege/appmanager.launch
345  * @remarks The caller app has to check the return value of this function.\n
346  *          Content categories will be shown as the sequence of using @a attach_panel_add_content_category.\n
347  *          Some contents need time to load it all.\n
348  *          So, it is needed to use this before the mainloop of attach_panel_show().\n
349  *          Privileges,\n
350  *          %http://tizen.org/privilege/mediastorage, for using ATTACH_PANEL_CONTENT_CATEGORY_IMAGE or ATTACH_PANEL_CONTENT_CATEGORY_CAMERA\n
351  *          %http://tizen.org/privilege/camera, for using ATTACH_PANEL_CONTENT_CATEGORY_CAMERA\n
352  *          %http://tizen.org/privilege/recorder, for using ATTACH_PANEL_CONTENT_CATEGORY_VOICE\n
353  *          %http://tizen.org/privilege/appmanager.launch, for adding content categories on the More tab\n
354  *          Deliver more information to the callee with a bundle if you need.\n
355  *          %http://tizen.org/appcontrol/data/total_count\n
356  *          %http://tizen.org/appcontrol/data/total_size
357  *
358  * @param[in] attach_panel Attach panel handler
359  * @param[in] content_category The content_category to be added in the @a attach_panel.
360  * @param[in] extra_data The attach panel send some information using @a bundle.
361  * @return #ATTACH_PANEL_ERROR_NONE on success,
362  *         otherwise a negative error value
363  * @retval #ATTACH_PANEL_ERROR_NONE Successful
364  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
365  * @retval #ATTACH_PANEL_ERROR_PERMISSION_DENIED permission denied
366  * @retval #ATTACH_PANEL_ERROR_NOT_INITIALIZED not initialized
367  * @retval #ATTACH_PANEL_ERROR_UNSUPPORTED_CONTENT_CATEGORY not supported content category
368  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
369  *
370  * @pre Call attach_panel_create() before calling this function.
371  * @see attach_panel_create()
372  * @see attach_panel_destroy()
373  * @see attach_panel_remove_content_category()
374  * @see attach_panel_set_result_cb()
375  * @see attach_panel_unset_result_cb()
376  * @see attach_panel_show()
377  * @see attach_panel_hide()
378  * @see attach_panel_get_visibility()
379  * @see ATTACH_PANEL_CONTENT_CATEGORY_IMAGE
380  * @see ATTACH_PANEL_CONTENT_CATEGORY_CAMERA
381  * @see ATTACH_PANEL_CONTENT_CATEGORY_VOICE
382  * @see ATTACH_PANEL_CONTENT_CATEGORY_VIDEO
383  * @see ATTACH_PANEL_CONTENT_CATEGORY_AUDIO
384  * @see ATTACH_PANEL_CONTENT_CATEGORY_CALENDAR
385  * @see ATTACH_PANEL_CONTENT_CATEGORY_CONTACT
386  * @see ATTACH_PANEL_CONTENT_CATEGORY_MYFILES
387  *
388  * @par Example
389  * @code
390  * #include <attach_panel.h>
391  *
392  * struct appdata {
393  *   Evas_Object *attach_panel;
394  *   Evas_Object *conformant;
395  * };
396  *
397  * static void _result_cb(attach_panel_h attach_panel, attach_panel_content_category_e content_category, app_control_h result, app_control_result_e result_code, void *data)
398  * {
399  *   char **select = NULL;
400  *   int i = 0;
401  *   int length = 0;
402  *   int ret = APP_CONTROL_ERROR_NONE;
403  *
404  *   if (!result) {
405  *     // Error handling
406  *   }
407  *
408  *   if (APP_CONTROL_RESULT_SUCCEEDED != result_code) {
409  *     // Error handling
410  *   }
411  *
412  *   ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length);
413  *   if (APP_CONTROL_ERROR_NONE != ret || !select) {
414  *     // Error handling
415  *   }
416  *
417  *   for (; i < length; i++) {
418  *      printf("path is %s, %d\n", select[i], length);
419  *      free(select[i]);
420  *   }
421  *
422  *   free(select);
423  * }
424  *
425  * static int app_control(void *data)
426  * {
427  *   struct appdata *ad = data;
428  *   bundle *extra_data = NULL;
429  *   int ret = ATTACH_PANEL_ERROR_NONE;
430  *
431  *   if (!ad) {
432  *     // Error handling
433  *   }
434  *
435  *   if (!ad->conformant) {
436  *     // Error handling
437  *   }
438  *
439  *   ret = attach_panel_create(ad->conformant, &ad->attach_panel);
440  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
441  *      // Error handling
442  *   }
443  *
444  *   extra_data = bundle_create();
445  *   if (!extra_data) {
446  *      // Error handling
447  *   }
448  *
449  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3");
450  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000");
451  *
452  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data);
453  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
454  *      // Error handling
455  *   }
456  *
457  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, extra_data);
458  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
459  *      // Error handling
460  *   }
461  *
462  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE, extra_data);
463  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
464  *      // Error handling
465  *   }
466  *
467  *   ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL);
468  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
469  *      // Error handling
470  *   }
471  *
472  *   ret = attach_panel_show(ad->attach_panel);
473  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
474  *      // Error handling
475  *   }
476  *
477  *   bundle_free(extra_data);
478  *
479  *       return 0;
480  * }
481  *
482  * @endcode
483  */
484 int attach_panel_add_content_category(attach_panel_h attach_panel, attach_panel_content_category_e content_category, bundle *extra_data);
485
486 /**
487  * @brief Removes the content category from the attach panel.
488  * @since_tizen 2.4
489  * @remarks The caller app has to check the return value of this function.\n
490  *
491  * @param[in] attach_panel Attach panel handler
492  * @param[in] content_category The content_category adding in the @a attach_panel.
493  * @return #ATTACH_PANEL_ERROR_NONE on success,
494  *         otherwise a negative error value
495  * @retval #ATTACH_PANEL_ERROR_NONE Successful
496  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
497  * @retval #ATTACH_PANEL_ERROR_NOT_INITIALIZED not initialized
498  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
499  *
500  * @pre Call attach_panel_create() before calling this function.
501  * @see attach_panel_create()
502  * @see attach_panel_destroy()
503  * @see attach_panel_add_content_category()
504  * @see attach_panel_set_extra_data()
505  * @see attach_panel_set_result_cb()
506  * @see attach_panel_unset_result_cb()
507  * @see attach_panel_show()
508  * @see attach_panel_hide()
509  * @see attach_panel_get_visibility()
510  * @see ATTACH_PANEL_CONTENT_CATEGORY_IMAGE
511  * @see ATTACH_PANEL_CONTENT_CATEGORY_CAMERA
512  * @see ATTACH_PANEL_CONTENT_CATEGORY_VOICE
513  * @see ATTACH_PANEL_CONTENT_CATEGORY_VIDEO
514  * @see ATTACH_PANEL_CONTENT_CATEGORY_AUDIO
515  * @see ATTACH_PANEL_CONTENT_CATEGORY_CALENDAR
516  * @see ATTACH_PANEL_CONTENT_CATEGORY_CONTACT
517  * @see ATTACH_PANEL_CONTENT_CATEGORY_MYFILES
518  *
519  * @par Example
520  * @code
521  * #include <attach_panel.h>
522  *
523  * struct appdata {
524  *   Evas_Object *attach_panel;
525  *   Evas_Object *conformant;
526  * };
527  *
528  * static int app_terminate(void *data)
529  * {
530  *   struct appdata *ad = data;
531  *   int ret = 0;
532  *
533  *   if (!ad) {
534  *     // Error handling
535  *   }
536  *
537  *   if (!ad->attach_panel) {
538  *     // Error handling
539  *   }
540  *
541  *   ret = attach_panel_hide(ad->attach_panel);
542  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
543  *      // Error handling
544  *   }
545  *
546  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE);
547  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
548  *      // Error handling
549  *   }
550  *
551  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA);
552  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
553  *      // Error handling
554  *   }
555  *
556  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE);
557  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
558  *      // Error handling
559  *   }
560  *
561  *   ret = attach_panel_unset_result_cb(ad->attach_panel);
562  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
563  *      // Error handling
564  *   }
565  *
566  *   ret = attach_panel_destroy(ad->attach_panel);
567  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
568  *      // Error handling
569  *   }
570  *   ad->attach_panel = NULL;
571  *
572  *   return 0;
573  * }
574  *
575  * @endcode
576  */
577 int attach_panel_remove_content_category(attach_panel_h attach_panel, attach_panel_content_category_e content_category);
578
579 /**
580  * @brief Sets extra data to send to the content category using a bundle.
581  * @since_tizen 2.4
582  * @privlevel public
583  * @remarks The caller app has to check the return value of this function.\n
584  *          extra data will be changed using @a attach_panel_set_extra_data.\n
585  *          %http://tizen.org/appcontrol/data/total_count\n
586  *          %http://tizen.org/appcontrol/data/total_size
587  *
588  * @param[in] attach_panel Attach panel handler
589  * @param[in] content_category The content_category to be set the some information in the @a attach_panel.
590  * @param[in] extra_data The attach panel set some information using @a bundle.
591  * @return #ATTACH_PANEL_ERROR_NONE on success,
592  *         otherwise a negative error value
593  * @retval #ATTACH_PANEL_ERROR_NONE Successful
594  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
595  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
596  * @retval #ATTACH_PANEL_ERROR_OUT_OF_MEMORY Fail to set the extra data
597  *
598  * @pre Call attach_panel_create() before calling this function.
599  * @see attach_panel_create()
600  * @see attach_panel_destroy()
601  * @see attach_panel_add_content_category()
602  * @see attach_panel_remove_content_category()
603  * @see attach_panel_set_result_cb()
604  * @see attach_panel_unset_result_cb()
605  * @see attach_panel_show()
606  * @see attach_panel_hide()
607  * @see attach_panel_get_visibility()
608  * @see ATTACH_PANEL_CONTENT_CATEGORY_IMAGE
609  * @see ATTACH_PANEL_CONTENT_CATEGORY_CAMERA
610  * @see ATTACH_PANEL_CONTENT_CATEGORY_VOICE
611  * @see ATTACH_PANEL_CONTENT_CATEGORY_VIDEO
612  * @see ATTACH_PANEL_CONTENT_CATEGORY_AUDIO
613  * @see ATTACH_PANEL_CONTENT_CATEGORY_CALENDAR
614  * @see ATTACH_PANEL_CONTENT_CATEGORY_CONTACT
615  * @see ATTACH_PANEL_CONTENT_CATEGORY_MYFILES
616  *
617  * @par Example
618  * @code
619  * #include <attach_panel.h>
620  *
621  * struct appdata {
622  *   Evas_Object *attach_panel;
623  *   Evas_Object *conformant;
624  * };
625  *
626  * static void _result_cb(attach_panel_h attach_panel, attach_panel_content_category_e content_category, app_control_h result, app_control_result_e result_code, void *data)
627  * {
628  *   char **select = NULL;
629  *   int i = 0;
630  *   int length = 0;
631  *   int ret = APP_CONTROL_ERROR_NONE;
632  *
633  *   if (!result) {
634  *     // Error handling
635  *   }
636  *
637  *   if (APP_CONTROL_RESULT_SUCCEEDED != result_code) {
638  *     // Error handling
639  *   }
640  *
641  *   ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length);
642  *   if (APP_CONTROL_ERROR_NONE != ret || !select) {
643  *     // Error handling
644  *   }
645  *
646  *   for (; i < length; i++) {
647  *      printf("path is %s, %d\n", select[i], length);
648  *      free(select[i]);
649  *   }
650  *
651  *   free(select);
652  * }
653  *
654  * static void _reset_bundle_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
655  * {
656  *   struct appdata *ad = data;
657  *   bundle *extra_data = NULL;
658  *   int ret = APP_CONTROL_ERROR_NONE;
659  *
660  *   if (!ad) {
661  *     // Error handling
662  *   }
663  *
664  *   extra_data = bundle_create();
665  *   if (!extra_data) {
666  *      // Error handling
667  *   }
668  *
669  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "5");
670  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "20480000");
671  *
672  *   ret = attach_panel_set_extra_data(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data);
673  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
674  *      // Error handling
675  *   }
676  *
677  *   ret = attach_panel_set_extra_data(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, extra_data);
678  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
679  *      // Error handling
680  *   }
681  *
682  *   ret = attach_panel_set_extra_data(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE, extra_data);
683  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
684  *      // Error handling
685  *   }
686  *
687  *   bundle_free(extra_data);
688  * }
689  *
690  * static int app_control(void *data)
691  * {
692  *   struct appdata *ad = data;
693  *   bundle *extra_data = NULL;
694  *   int ret = ATTACH_PANEL_ERROR_NONE;
695  *
696  *   if (!ad) {
697  *     // Error handling
698  *   }
699  *
700  *   if (!ad->conformant) {
701  *     // Error handling
702  *   }
703  *
704  *   ret = attach_panel_create(ad->conformant, &ad->attach_panel);
705  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
706  *      // Error handling
707  *   }
708  *
709  *   extra_data = bundle_create();
710  *   if (!extra_data) {
711  *      // Error handling
712  *   }
713  *
714  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3");
715  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000");
716  *
717  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data);
718  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
719  *      // Error handling
720  *   }
721  *
722  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, extra_data);
723  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
724  *      // Error handling
725  *   }
726  *
727  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE, extra_data);
728  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
729  *      // Error handling
730  *   }
731  *
732  *   ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL);
733  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
734  *      // Error handling
735  *   }
736  *
737  *   ret = attach_panel_show(ad->attach_panel);
738  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
739  *      // Error handling
740  *   }
741  *
742  *   bundle_free(extra_data);
743  *
744  *       return 0;
745  * }
746  *
747  * @endcode
748  */
749 int attach_panel_set_extra_data(attach_panel_h attach_panel, attach_panel_content_category_e content_category, bundle *extra_data);
750
751 /**
752  * @brief Sets the result callback that will be called when an user selects and confirms something to attach in the attach panel.
753  * @since_tizen 2.4
754  * @remarks The caller app has to check the return value of this function.\n
755  *          We can set only one callback function with this API.\n
756  *          If you set multiple callbacks with this API,\n
757  *          the last one is registered only.
758  *
759  * @param[in] attach_panel Attach panel handler
760  * @param[in] result_cb Attach panel result callback
761  * @param[in] user_data User data
762  * @return #ATTACH_PANEL_ERROR_NONE on success,
763  *         otherwise a negative error value
764  * @retval #ATTACH_PANEL_ERROR_NONE Successful
765  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
766  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
767  *
768  * @pre Call attach_panel_create() before calling this function.
769  * @post The result_cb set with attach_panel_set_result_cb() will be called after an user select something to attach.
770  * @see attach_panel_create()
771  * @see attach_panel_destroy()
772  * @see attach_panel_add_content_category()
773  * @see attach_panel_remove_content_category()
774  * @see attach_panel_set_extra_data()
775  * @see attach_panel_unset_result_cb()
776  * @see attach_panel_show()
777  * @see attach_panel_hide()
778  * @see attach_panel_get_visibility()
779  * @see attach_panel_result_cb
780  *
781  * @par Example
782  * @code
783  * #include <attach_panel.h>
784  *
785  * struct appdata {
786  *   Evas_Object *attach_panel;
787  *   Evas_Object *conformant;
788  * };
789  *
790  * static void _result_cb(attach_panel_h attach_panel, attach_panel_content_category_e content_category, app_control_h result, app_control_result_e result_code, void *data)
791  * {
792  *   char **select = NULL;
793  *   int i = 0;
794  *   int length = 0;
795  *   int ret = APP_CONTROL_ERROR_NONE;
796  *
797  *   if (!result) {
798  *     // Error handling
799  *   }
800  *
801  *   if (APP_CONTROL_RESULT_SUCCEEDED != result_code) {
802  *     // Error handling
803  *   }
804  *
805  *   ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length);
806  *   if (APP_CONTROL_ERROR_NONE != ret || !select) {
807  *     // Error handling
808  *   }
809  *
810  *   for (; i < length; i++) {
811  *      printf("path is %s, %d\n", select[i], length);
812  *      free(select[i]);
813  *   }
814  *
815  *   free(select);
816  * }
817  *
818  * static int app_control(void *data)
819  * {
820  *   struct appdata *ad = data;
821  *   bundle *extra_data = NULL;
822  *   int ret = ATTACH_PANEL_ERROR_NONE;
823  *
824  *   if (!ad) {
825  *     // Error handling
826  *   }
827  *
828  *   if (!ad->conformant) {
829  *     // Error handling
830  *   }
831  *
832  *   ret = attach_panel_create(ad->conformant, &ad->attach_panel);
833  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
834  *      // Error handling
835  *   }
836  *
837  *   extra_data = bundle_create();
838  *   if (!extra_data) {
839  *      // Error handling
840  *   }
841  *
842  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3");
843  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000");
844  *
845  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data);
846  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
847  *      // Error handling
848  *   }
849  *
850  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, extra_data);
851  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
852  *      // Error handling
853  *   }
854  *
855  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE, extra_data);
856  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
857  *      // Error handling
858  *   }
859  *
860  *   ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL);
861  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
862  *      // Error handling
863  *   }
864  *
865  *   ret = attach_panel_show(ad->attach_panel);
866  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
867  *      // Error handling
868  *   }
869  *
870  *   bundle_free(extra_data);
871  *
872  *       return 0;
873  * }
874  *
875  * @endcode
876  */
877 int attach_panel_set_result_cb(attach_panel_h attach_panel, attach_panel_result_cb result_cb, void *user_data);
878
879 /**
880  * @brief Unsets the result callback that will be called when an user selects and confirms something to attach in the attach panel.
881  * @since_tizen 2.4
882  * @remarks The caller app has to check the return value of this function.\n
883  *
884  * @param[in] attach_panel Attach panel handler
885  * @return #ATTACH_PANEL_ERROR_NONE on success,
886  *         otherwise a negative error value
887  * @retval #ATTACH_PANEL_ERROR_NONE Successful
888  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
889  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
890  *
891  * @pre Call attach_panel_create() before calling this function.
892  * @see attach_panel_create()
893  * @see attach_panel_destroy()
894  * @see attach_panel_add_content_category()
895  * @see attach_panel_remove_content_category()
896  * @see attach_panel_set_extra_data()
897  * @see attach_panel_set_result_cb()
898  * @see attach_panel_show()
899  * @see attach_panel_hide()
900  * @see attach_panel_get_visibility()
901  *
902  * @par Example
903  * @code
904  * #include <attach_panel.h>
905  *
906  * struct appdata {
907  *   Evas_Object *attach_panel;
908  *   Evas_Object *conformant;
909  * };
910  *
911  * static int app_terminate(void *data)
912  * {
913  *   struct appdata *ad = data;
914  *   int ret = 0;
915  *
916  *   if (!ad) {
917  *     // Error handling
918  *   }
919  *
920  *   if (!ad->attach_panel) {
921  *     // Error handling
922  *   }
923  *
924  *   ret = attach_panel_hide(ad->attach_panel);
925  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
926  *      // Error handling
927  *   }
928  *
929  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE);
930  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
931  *      // Error handling
932  *   }
933  *
934  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA);
935  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
936  *      // Error handling
937  *   }
938  *
939  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE);
940  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
941  *      // Error handling
942  *   }
943  *
944  *   ret = attach_panel_unset_result_cb(ad->attach_panel);
945  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
946  *      // Error handling
947  *   }
948  *
949  *   ret = attach_panel_destroy(ad->attach_panel);
950  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
951  *      // Error handling
952  *   }
953  *   ad->attach_panel = NULL;
954  *
955  *       return 0;
956  * }
957  *
958  * @endcode
959  */
960 int attach_panel_unset_result_cb(attach_panel_h attach_panel);
961
962 /**
963  * @brief Sets the event callback that will be called when reserved events are published from the panel-side.
964  * @since_tizen 2.4
965  * @remarks The caller app has to check the return value of this function.\n
966  *          We can set only one callback function with this API.\n
967  *          If you set multiple callbacks with this API,\n
968  *          the last one is registered only.
969  *
970  * @param[in] attach_panel Attach panel handler
971  * @param[in] panel_event_cb Attach panel event callback
972  * @param[in] user_data User data
973  * @return #ATTACH_PANEL_ERROR_NONE on success,
974  *         otherwise a negative error value
975  * @retval #ATTACH_PANEL_ERROR_NONE Successful
976  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
977  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
978  *
979  * @pre Call attach_panel_create() before calling this function.
980  * @post The event_cb set with attach_panel_set_event_cb() will be called after publishing reserved events.
981  * @see attach_panel_create()
982  * @see attach_panel_destroy()
983  * @see attach_panel_show()
984  * @see attach_panel_hide()
985  * @see attach_panel_get_visibility()
986  * @see attach_panel_unset_event_cb()
987  * @see attach_panel_event_cb
988  *
989  * @par Example
990  * @code
991  * #include <attach_panel.h>
992  *
993  * struct appdata {
994  *   Evas_Object *attach_panel;
995  *   Evas_Object *conformant;
996  * };
997  *
998  * static void _event_cb(attach_panel_h attach_panel, attach_panel_event_e event, void *event_info, void *data)
999  * {
1000  *   switch (event) {
1001  *   case ATTACH_PANEL_EVENT_SHOW_START:
1002  *     // event handling
1003  *     break;
1004  *   case ATTACH_PANEL_EVENT_SHOW_FINISH:
1005  *     // event handling
1006  *     break;
1007  *   case ATTACH_PANEL_EVENT_HIDE_START:
1008  *     // event handling
1009  *     break;
1010  *   case ATTACH_PANEL_EVENT_HIDE_FINISH:
1011  *     // event handling
1012  *     break;
1013  *   default:
1014  *     // error handling
1015  *     break;
1016  *   }
1017  * }
1018  *
1019  * static int app_control(void *data)
1020  * {
1021  *   struct appdata *ad = data;
1022  *   int ret = ATTACH_PANEL_ERROR_NONE;
1023  *
1024  *   if (!ad) {
1025  *     // Error handling
1026  *   }
1027  *
1028  *   if (!ad->conformant) {
1029  *     // Error handling
1030  *   }
1031  *
1032  *   ret = attach_panel_create(ad->conformant, &ad->attach_panel);
1033  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1034  *      // Error handling
1035  *   }
1036  *
1037  *   ret = attach_panel_set_event_cb(ad->attach_panel, _event_cb, ad);
1038  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1039  *      // Error handling
1040  *   }
1041  *
1042  *   // other routines
1043  *
1044  *       return 0;
1045  * }
1046  *
1047  * @endcode
1048  */
1049 int attach_panel_set_event_cb(attach_panel_h attach_panel, attach_panel_event_cb panel_event_cb, void *user_data);
1050
1051 /**
1052  * @brief Unsets the event callback
1053  * @since_tizen 2.4
1054  * @remarks The caller app has to check the return value of this function.
1055  *
1056  * @param[in] attach_panel Attach panel handler
1057  * @param[in] result_cb Attach panel result callback
1058  * @return #ATTACH_PANEL_ERROR_NONE on success,
1059  *         otherwise a negative error value
1060  * @retval #ATTACH_PANEL_ERROR_NONE Successful
1061  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
1062  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
1063  *
1064  * @pre Call attach_panel_create() before calling this function.
1065  * @see attach_panel_create()
1066  * @see attach_panel_destroy()
1067  * @see attach_panel_show()
1068  * @see attach_panel_hide()
1069  * @see attach_panel_get_visibility()
1070  * @see attach_panel_set_event_cb()
1071  *
1072  * @par Example
1073  * @code
1074  * #include <attach_panel.h>
1075  *
1076  * struct appdata {
1077  *   Evas_Object *attach_panel;
1078  *   Evas_Object *conformant;
1079  * };
1080  *
1081  * static int app_terminate(void *data)
1082  * {
1083  *   struct appdata *ad = data;
1084  *   int ret = 0;
1085  *
1086  *   if (!ad) {
1087  *     // Error handling
1088  *   }
1089  *
1090  *   if (!ad->attach_panel) {
1091  *     // Error handling
1092  *   }
1093  *
1094  *   ret = attach_panel_unset_event_cb(ad->attach_panel);
1095  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1096  *      // Error handling
1097  *   }
1098  *
1099  *   ret = attach_panel_destroy(ad->attach_panel);
1100  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1101  *      // Error handling
1102  *   }
1103  *   ad->attach_panel = NULL;
1104  *
1105  *       return 0;
1106  * }
1107  *
1108  * @endcode
1109  */
1110 int attach_panel_unset_event_cb(attach_panel_h attach_panel);
1111
1112 /**
1113  * @brief Shows the attach panel, asynchronously.
1114  * @since_tizen 2.4
1115  * @remarks The caller app has to check the return value of this function.\n
1116  *
1117  * @param[in] attach_panel Attach panel handler
1118  * @return #ATTACH_PANEL_ERROR_NONE on success,
1119  *         otherwise a negative error value
1120  * @retval #ATTACH_PANEL_ERROR_NONE Successful
1121  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
1122  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
1123  *
1124  * @pre Call attach_panel_create() before calling this function.
1125  * @see attach_panel_create()
1126  * @see attach_panel_destroy()
1127  * @see attach_panel_add_content_category()
1128  * @see attach_panel_remove_content_category()
1129  * @see attach_panel_set_extra_data()
1130  * @see attach_panel_set_result_cb()
1131  * @see attach_panel_unset_result_cb()
1132  * @see attach_panel_hide()
1133  * @see attach_panel_get_visibility()
1134  *
1135  * @par Example
1136  * @code
1137  * #include <attach_panel.h>
1138  *
1139  * struct appdata {
1140  *   Evas_Object *attach_panel;
1141  *   Evas_Object *conformant;
1142  * };
1143  *
1144  * static void _result_cb(attach_panel_h attach_panel, attach_panel_content_category_e content_category, app_control_h result, app_control_result_e result_code, void *data)
1145  * {
1146  *   char **select = NULL;
1147  *   int i = 0;
1148  *   int length = 0;
1149  *   int ret = APP_CONTROL_ERROR_NONE;
1150  *
1151  *   if (!result) {
1152  *     // Error handling
1153  *   }
1154  *
1155  *   if (APP_CONTROL_RESULT_SUCCEEDED != result_code) {
1156  *     // Error handling
1157  *   }
1158  *
1159  *   ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length);
1160  *   if (APP_CONTROL_ERROR_NONE != ret || !select) {
1161  *     // Error handling
1162  *   }
1163  *
1164  *   for (; i < length; i++) {
1165  *      printf("path is %s, %d\n", select[i], length);
1166  *      free(select[i]);
1167  *   }
1168  *
1169  *   free(select);
1170  * }
1171  *
1172  * static int app_control(void *data)
1173  * {
1174  *   struct appdata *ad = data;
1175  *   bundle *extra_data = NULL;
1176  *   int ret = ATTACH_PANEL_ERROR_NONE;
1177  *
1178  *   if (!ad) {
1179  *     // Error handling
1180  *   }
1181  *
1182  *   if (!ad->conformant) {
1183  *     // Error handling
1184  *   }
1185  *
1186  *   ret = attach_panel_create(ad->conformant, &ad->attach_panel);
1187  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1188  *      // Error handling
1189  *   }
1190  *
1191  *   extra_data = bundle_create();
1192  *   if (!extra_data) {
1193  *      // Error handling
1194  *   }
1195  *
1196  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3");
1197  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000");
1198  *
1199  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data);
1200  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1201  *      // Error handling
1202  *   }
1203  *
1204  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, extra_data);
1205  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1206  *      // Error handling
1207  *   }
1208  *
1209  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE, extra_data);
1210  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1211  *      // Error handling
1212  *   }
1213  *
1214  *   ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL);
1215  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1216  *      // Error handling
1217  *   }
1218  *
1219  *   ret = attach_panel_show(ad->attach_panel);
1220  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1221  *      // Error handling
1222  *   }
1223  *
1224  *   bundle_free(extra_data);
1225  *
1226  *       return 0;
1227  * }
1228  *
1229  * @endcode
1230  */
1231 int attach_panel_show(attach_panel_h attach_panel);
1232
1233 /**
1234  * @brief Hides the attach panel, asynchronously.
1235  * @since_tizen 2.4
1236  * @remarks The caller app has to check the return value of this function.\n
1237  *
1238  * @param[in] attach_panel Attach panel handler
1239  * @return #ATTACH_PANEL_ERROR_NONE on success,
1240  *         otherwise a negative error value
1241  * @retval #ATTACH_PANEL_ERROR_NONE Successful
1242  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
1243  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
1244  *
1245  * @pre Call attach_panel_create() before calling this function.
1246  * @see attach_panel_create()
1247  * @see attach_panel_destroy()
1248  * @see attach_panel_add_content_category()
1249  * @see attach_panel_remove_content_category()
1250  * @see attach_panel_set_extra_data()
1251  * @see attach_panel_set_result_cb()
1252  * @see attach_panel_unset_result_cb()
1253  * @see attach_panel_show()
1254  * @see attach_panel_get_visibility()
1255  *
1256  * @par Example
1257  * @code
1258  * #include <attach_panel.h>
1259  *
1260  * struct appdata {
1261  *   Evas_Object *attach_panel;
1262  *   Evas_Object *conformant;
1263  * };
1264  *
1265  * static int app_terminate(void *data)
1266  * {
1267  *   struct appdata *ad = data;
1268  *   int ret = 0;
1269  *
1270  *   if (!ad) {
1271  *     // Error handling
1272  *   }
1273  *
1274  *   if (!ad->attach_panel) {
1275  *     // Error handling
1276  *   }
1277  *
1278  *   ret = attach_panel_hide(ad->attach_panel);
1279  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1280  *      // Error handling
1281  *   }
1282  *
1283  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE);
1284  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1285  *      // Error handling
1286  *   }
1287  *
1288  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA);
1289  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1290  *      // Error handling
1291  *   }
1292  *
1293  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE);
1294  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1295  *      // Error handling
1296  *   }
1297  *
1298  *   ret = attach_panel_unset_result_cb(ad->attach_panel);
1299  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1300  *      // Error handling
1301  *   }
1302  *
1303  *   ret = attach_panel_destroy(ad->attach_panel);
1304  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1305  *      // Error handling
1306  *   }
1307  *   ad->attach_panel = NULL;
1308  *
1309  *       return 0;
1310  * }
1311  *
1312  * @endcode
1313  */
1314 int attach_panel_hide(attach_panel_h attach_panel);
1315
1316 /**
1317  * @brief Gets a value that indicates whether the attach_panel is visible.
1318  * @since_tizen 2.4
1319  * @remarks The caller app has to check the return value of this function.\n
1320  *
1321  * @param[in] attach_panel Attach panel handler
1322  * @param[out] visible value of attach_panel state
1323  * @return #ATTACH_PANEL_ERROR_NONE on success,
1324  *         otherwise a negative error value
1325  * @retval #ATTACH_PANEL_ERROR_NONE Successful
1326  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
1327  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
1328  *
1329  * @pre Call attach_panel_create() before calling this function.
1330  * @see attach_panel_create()
1331  * @see attach_panel_destroy()
1332  * @see attach_panel_add_content_category()
1333  * @see attach_panel_remove_content_category()
1334  * @see attach_panel_set_extra_data()
1335  * @see attach_panel_set_result_cb()
1336  * @see attach_panel_unset_result_cb()
1337  * @see attach_panel_show()
1338  * @see attach_panel_hide()
1339  *
1340  * @par Example
1341  * @code
1342  * #include <attach_panel.h>
1343  *
1344  * struct appdata {
1345  *   Evas_Object *attach_panel;
1346  *   Evas_Object *conformant;
1347  * };
1348  *
1349  * static int app_terminate(void *data)
1350  * {
1351  *   struct appdata *ad = data;
1352  *   bool vislble = false;
1353  *   int ret = 0;
1354  *
1355  *   if (!ad) {
1356  *     // Error handling
1357  *   }
1358  *
1359  *   if (!ad->attach_panel) {
1360  *     // Error handling
1361  *   }
1362  *
1363  *   ret = attach_panel_get_visibility(ad->attach_panel, &visible);
1364  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1365  *      // Error handling
1366  *   }
1367  *
1368  *   if (visible) {
1369  *      ret = attach_panel_hide(ad->attach_panel);
1370  *      if (ATTACH_PANEL_ERROR_NONE != ret) {
1371  *         // Error handling
1372  *      }
1373  *   }
1374  *
1375  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE);
1376  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1377  *      // Error handling
1378  *   }
1379  *
1380  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA);
1381  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1382  *      // Error handling
1383  *   }
1384  *
1385  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE);
1386  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1387  *      // Error handling
1388  *   }
1389  *
1390  *   ret = attach_panel_unset_result_cb(ad->attach_panel);
1391  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1392  *      // Error handling
1393  *   }
1394  *
1395  *   ret = attach_panel_destroy(ad->attach_panel);
1396  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1397  *      // Error handling
1398  *   }
1399  *   ad->attach_panel = NULL;
1400  *
1401  *       return 0;
1402  * }
1403  *
1404  * @endcode
1405  */
1406 int attach_panel_get_visibility(attach_panel_h attach_panel, bool *visible);
1407
1408 /**
1409  * @}
1410  */
1411
1412 #ifdef __cplusplus
1413 }
1414 #endif
1415 #endif // __TIZEN_ATTACH_PANEL_H__
1416