Tizen 2.4.0 rev3 SDK Public Release
[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 extern 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 extern 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  * @remarks The caller app has to check the return value of this function.\n
342  *          Content categories will be shown as the sequence of using @a attach_panel_add_content_category.\n
343  *          Some contents need time to load it all.\n
344  *          So, it is needed to use this before the mainloop of attach_panel_show().\n
345  *          Privileges,\n
346  *          %http://tizen.org/privilege/camera, for using ATTACH_PANEL_CONTENT_CATEGORY_CAMERA\n
347  *          %http://tizen.org/privilege/recorder, for using ATTACH_PANEL_CONTENT_CATEGORY_VOICE\n
348  *          %http://tizen.org/privilege/appmanager.launch, for adding content categories on the More tab\n
349  *          Deliver more information to the callee with a bundle if you need.\n
350  *          %http://tizen.org/appcontrol/data/total_count\n
351  *          %http://tizen.org/appcontrol/data/total_size
352  *
353  * @param[in] attach_panel Attach panel handler
354  * @param[in] content_category The content_category to be added in the @a attach_panel.
355  * @param[in] The attach panel send some information using @a bundle.
356  * @return #ATTACH_PANEL_ERROR_NONE on success,
357  *         otherwise a negative error value
358  * @retval #ATTACH_PANEL_ERROR_NONE Successful
359  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
360  * @retval #ATTACH_PANEL_ERROR_PERMISSION_DENIED permission denied
361  * @retval #ATTACH_PANEL_ERROR_NOT_INITIALIZED not initialized
362  * @retval #ATTACH_PANEL_ERROR_UNSUPPORTED_CONTENT_CATEGORY not supported content category
363  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
364  *
365  * @pre Call attach_panel_create() before calling this function.
366  * @see attach_panel_create()
367  * @see attach_panel_destroy()
368  * @see attach_panel_remove_content_category()
369  * @see attach_panel_set_result_cb()
370  * @see attach_panel_unset_result_cb()
371  * @see attach_panel_show()
372  * @see attach_panel_hide()
373  * @see attach_panel_get_visibility()
374  * @see ATTACH_PANEL_CONTENT_CATEGORY_IMAGE
375  * @see ATTACH_PANEL_CONTENT_CATEGORY_CAMERA
376  * @see ATTACH_PANEL_CONTENT_CATEGORY_VOICE
377  * @see ATTACH_PANEL_CONTENT_CATEGORY_VIDEO
378  * @see ATTACH_PANEL_CONTENT_CATEGORY_AUDIO
379  * @see ATTACH_PANEL_CONTENT_CATEGORY_CALENDAR
380  * @see ATTACH_PANEL_CONTENT_CATEGORY_CONTACT
381  * @see ATTACH_PANEL_CONTENT_CATEGORY_MYFILES
382  *
383  * @par Example
384  * @code
385  * #include <attach_panel.h>
386  *
387  * struct appdata {
388  *   Evas_Object *attach_panel;
389  *   Evas_Object *conformant;
390  * };
391  *
392  * 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)
393  * {
394  *   char **select = NULL;
395  *   int i = 0;
396  *   int length = 0;
397  *   int ret = APP_CONTROL_ERROR_NONE;
398  *
399  *   if (!result) {
400  *     // Error handling
401  *   }
402  *
403  *   if (APP_CONTROL_RESULT_SUCCEEDED != result_code) {
404  *     // Error handling
405  *   }
406  *
407  *   ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length);
408  *   if (APP_CONTROL_ERROR_NONE != ret || !select) {
409  *     // Error handling
410  *   }
411  *
412  *   for (; i < length; i++) {
413  *      printf("path is %s, %d\n", select[i], length);
414  *      free(select[i]);
415  *   }
416  *
417  *   free(select);
418  * }
419  *
420  * static int app_control(void *data)
421  * {
422  *   struct appdata *ad = data;
423  *   bundle *extra_data = NULL;
424  *   int ret = ATTACH_PANEL_ERROR_NONE;
425  *
426  *   if (!ad) {
427  *     // Error handling
428  *   }
429  *
430  *   if (!ad->conformant) {
431  *     // Error handling
432  *   }
433  *
434  *   ret = attach_panel_create(ad->conformant, &ad->attach_panel);
435  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
436  *      // Error handling
437  *   }
438  *
439  *   extra_data = bundle_create();
440  *   if (!extra_data) {
441  *      // Error handling
442  *   }
443  *
444  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3");
445  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000");
446  *
447  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data);
448  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
449  *      // Error handling
450  *   }
451  *
452  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, 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_VOICE, extra_data);
458  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
459  *      // Error handling
460  *   }
461  *
462  *   ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL);
463  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
464  *      // Error handling
465  *   }
466  *
467  *   ret = attach_panel_show(ad->attach_panel);
468  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
469  *      // Error handling
470  *   }
471  *
472  *   bundle_free(extra_data);
473  *
474  *       return 0;
475  * }
476  *
477  * @endcode
478  */
479 extern int attach_panel_add_content_category(attach_panel_h attach_panel, attach_panel_content_category_e content_category, bundle *extra_data);
480
481 /**
482  * @brief Removes the content category from the attach panel.
483  * @since_tizen 2.4
484  * @remarks The caller app has to check the return value of this function.\n
485  *
486  * @param[in] attach_panel Attach panel handler
487  * @param[in] content_category The content_category adding in the @a attach_panel.
488  * @return #ATTACH_PANEL_ERROR_NONE on success,
489  *         otherwise a negative error value
490  * @retval #ATTACH_PANEL_ERROR_NONE Successful
491  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
492  * @retval #ATTACH_PANEL_ERROR_NOT_INITIALIZED not initialized
493  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
494  *
495  * @pre Call attach_panel_create() before calling this function.
496  * @see attach_panel_create()
497  * @see attach_panel_destroy()
498  * @see attach_panel_add_content_category()
499  * @see attach_panel_set_extra_data()
500  * @see attach_panel_set_result_cb()
501  * @see attach_panel_unset_result_cb()
502  * @see attach_panel_show()
503  * @see attach_panel_hide()
504  * @see attach_panel_get_visibility()
505  * @see ATTACH_PANEL_CONTENT_CATEGORY_IMAGE
506  * @see ATTACH_PANEL_CONTENT_CATEGORY_CAMERA
507  * @see ATTACH_PANEL_CONTENT_CATEGORY_VOICE
508  * @see ATTACH_PANEL_CONTENT_CATEGORY_VIDEO
509  * @see ATTACH_PANEL_CONTENT_CATEGORY_AUDIO
510  * @see ATTACH_PANEL_CONTENT_CATEGORY_CALENDAR
511  * @see ATTACH_PANEL_CONTENT_CATEGORY_CONTACT
512  * @see ATTACH_PANEL_CONTENT_CATEGORY_MYFILES
513  *
514  * @par Example
515  * @code
516  * #include <attach_panel.h>
517  *
518  * struct appdata {
519  *   Evas_Object *attach_panel;
520  *   Evas_Object *conformant;
521  * };
522  *
523  * static int app_terminate(void *data)
524  * {
525  *   struct appdata *ad = data;
526  *   int ret = 0;
527  *
528  *   if (!ad) {
529  *     // Error handling
530  *   }
531  *
532  *   if (!ad->attach_panel) {
533  *     // Error handling
534  *   }
535  *
536  *   ret = attach_panel_hide(ad->attach_panel);
537  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
538  *      // Error handling
539  *   }
540  *
541  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE);
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_CAMERA);
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_VOICE);
552  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
553  *      // Error handling
554  *   }
555  *
556  *   ret = attach_panel_unset_result_cb(ad->attach_panel);
557  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
558  *      // Error handling
559  *   }
560  *
561  *   ret = attach_panel_destroy(ad->attach_panel);
562  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
563  *      // Error handling
564  *   }
565  *   ad->attach_panel = NULL;
566  *
567  *   return 0;
568  * }
569  *
570  * @endcode
571  */
572 extern int attach_panel_remove_content_category(attach_panel_h attach_panel, attach_panel_content_category_e content_category);
573
574 /**
575  * @brief Sets extra data to send to the content category using a bundle.
576  * @since_tizen 2.4
577  * @privlevel public
578  * @remarks The caller app has to check the return value of this function.\n
579  *          extra data will be changed using @a attach_panel_set_extra_data.\n
580  *          %http://tizen.org/appcontrol/data/total_count\n
581  *          %http://tizen.org/appcontrol/data/total_size
582  *
583  * @param[in] attach_panel Attach panel handler
584  * @param[in] content_category The content_category to be set the some information in the @a attach_panel.
585  * @param[in] The attach panel set some information using @a bundle.
586  * @return #ATTACH_PANEL_ERROR_NONE on success,
587  *         otherwise a negative error value
588  * @retval #ATTACH_PANEL_ERROR_NONE Successful
589  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
590  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
591  * @retval #ATTACH_PANEL_ERROR_OUT_OF_MEMORY Fail to set the extra data
592  *
593  * @pre Call attach_panel_create() before calling this function.
594  * @see attach_panel_create()
595  * @see attach_panel_destroy()
596  * @see attach_panel_add_content_category()
597  * @see attach_panel_remove_content_category()
598  * @see attach_panel_set_result_cb()
599  * @see attach_panel_unset_result_cb()
600  * @see attach_panel_show()
601  * @see attach_panel_hide()
602  * @see attach_panel_get_visibility()
603  * @see ATTACH_PANEL_CONTENT_CATEGORY_IMAGE
604  * @see ATTACH_PANEL_CONTENT_CATEGORY_CAMERA
605  * @see ATTACH_PANEL_CONTENT_CATEGORY_VOICE
606  * @see ATTACH_PANEL_CONTENT_CATEGORY_VIDEO
607  * @see ATTACH_PANEL_CONTENT_CATEGORY_AUDIO
608  * @see ATTACH_PANEL_CONTENT_CATEGORY_CALENDAR
609  * @see ATTACH_PANEL_CONTENT_CATEGORY_CONTACT
610  * @see ATTACH_PANEL_CONTENT_CATEGORY_MYFILES
611  *
612  * @par Example
613  * @code
614  * #include <attach_panel.h>
615  *
616  * struct appdata {
617  *   Evas_Object *attach_panel;
618  *   Evas_Object *conformant;
619  * };
620  *
621  * 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)
622  * {
623  *   char **select = NULL;
624  *   int i = 0;
625  *   int length = 0;
626  *   int ret = APP_CONTROL_ERROR_NONE;
627  *
628  *   if (!result) {
629  *     // Error handling
630  *   }
631  *
632  *   if (APP_CONTROL_RESULT_SUCCEEDED != result_code) {
633  *     // Error handling
634  *   }
635  *
636  *   ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length);
637  *   if (APP_CONTROL_ERROR_NONE != ret || !select) {
638  *     // Error handling
639  *   }
640  *
641  *   for (; i < length; i++) {
642  *      printf("path is %s, %d\n", select[i], length);
643  *      free(select[i]);
644  *   }
645  *
646  *   free(select);
647  * }
648  *
649  * static void _reset_bundle_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
650  * {
651  *   struct appdata *ad = data;
652  *   bundle *extra_data = NULL;
653  *   int ret = APP_CONTROL_ERROR_NONE;
654  *
655  *   if (!ad) {
656  *     // Error handling
657  *   }
658  *
659  *   extra_data = bundle_create();
660  *   if (!extra_data) {
661  *      // Error handling
662  *   }
663  *
664  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "5");
665  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "20480000");
666  *
667  *   ret = attach_panel_set_extra_data(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data);
668  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
669  *      // Error handling
670  *   }
671  *
672  *   ret = attach_panel_set_extra_data(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, 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_VOICE, extra_data);
678  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
679  *      // Error handling
680  *   }
681  *
682  *   bundle_free(extra_data);
683  * }
684  *
685  * static int app_control(void *data)
686  * {
687  *   struct appdata *ad = data;
688  *   bundle *extra_data = NULL;
689  *   int ret = ATTACH_PANEL_ERROR_NONE;
690  *
691  *   if (!ad) {
692  *     // Error handling
693  *   }
694  *
695  *   if (!ad->conformant) {
696  *     // Error handling
697  *   }
698  *
699  *   ret = attach_panel_create(ad->conformant, &ad->attach_panel);
700  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
701  *      // Error handling
702  *   }
703  *
704  *   extra_data = bundle_create();
705  *   if (!extra_data) {
706  *      // Error handling
707  *   }
708  *
709  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3");
710  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000");
711  *
712  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data);
713  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
714  *      // Error handling
715  *   }
716  *
717  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, 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_VOICE, extra_data);
723  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
724  *      // Error handling
725  *   }
726  *
727  *   ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL);
728  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
729  *      // Error handling
730  *   }
731  *
732  *   ret = attach_panel_show(ad->attach_panel);
733  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
734  *      // Error handling
735  *   }
736  *
737  *   bundle_free(extra_data);
738  *
739  *       return 0;
740  * }
741  *
742  * @endcode
743  */
744 extern int attach_panel_set_extra_data(attach_panel_h attach_panel, attach_panel_content_category_e content_category, bundle *extra_data);
745
746 /**
747  * @brief Sets the result callback that will be called when an user selects and confirms something to attach in the attach panel.
748  * @since_tizen 2.4
749  * @remarks The caller app has to check the return value of this function.\n
750  *          We can set only one callback function with this API.\n
751  *          If you set multiple callbacks with this API,\n
752  *          the last one is registered only.
753  *
754  * @param[in] attach_panel Attach panel handler
755  * @param[in] result_cb Attach panel result callback
756  * @param[in] user_data User data
757  * @return #ATTACH_PANEL_ERROR_NONE on success,
758  *         otherwise a negative error value
759  * @retval #ATTACH_PANEL_ERROR_NONE Successful
760  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
761  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
762  *
763  * @pre Call attach_panel_create() before calling this function.
764  * @post The result_cb set with attach_panel_set_result_cb() will be called after an user select something to attach.
765  * @see attach_panel_create()
766  * @see attach_panel_destroy()
767  * @see attach_panel_add_content_category()
768  * @see attach_panel_remove_content_category()
769  * @see attach_panel_set_extra_data()
770  * @see attach_panel_unset_result_cb()
771  * @see attach_panel_show()
772  * @see attach_panel_hide()
773  * @see attach_panel_get_visibility()
774  * @see attach_panel_result_cb
775  *
776  * @par Example
777  * @code
778  * #include <attach_panel.h>
779  *
780  * struct appdata {
781  *   Evas_Object *attach_panel;
782  *   Evas_Object *conformant;
783  * };
784  *
785  * 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)
786  * {
787  *   char **select = NULL;
788  *   int i = 0;
789  *   int length = 0;
790  *   int ret = APP_CONTROL_ERROR_NONE;
791  *
792  *   if (!result) {
793  *     // Error handling
794  *   }
795  *
796  *   if (APP_CONTROL_RESULT_SUCCEEDED != result_code) {
797  *     // Error handling
798  *   }
799  *
800  *   ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length);
801  *   if (APP_CONTROL_ERROR_NONE != ret || !select) {
802  *     // Error handling
803  *   }
804  *
805  *   for (; i < length; i++) {
806  *      printf("path is %s, %d\n", select[i], length);
807  *      free(select[i]);
808  *   }
809  *
810  *   free(select);
811  * }
812  *
813  * static int app_control(void *data)
814  * {
815  *   struct appdata *ad = data;
816  *   bundle *extra_data = NULL;
817  *   int ret = ATTACH_PANEL_ERROR_NONE;
818  *
819  *   if (!ad) {
820  *     // Error handling
821  *   }
822  *
823  *   if (!ad->conformant) {
824  *     // Error handling
825  *   }
826  *
827  *   ret = attach_panel_create(ad->conformant, &ad->attach_panel);
828  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
829  *      // Error handling
830  *   }
831  *
832  *   extra_data = bundle_create();
833  *   if (!extra_data) {
834  *      // Error handling
835  *   }
836  *
837  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3");
838  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000");
839  *
840  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data);
841  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
842  *      // Error handling
843  *   }
844  *
845  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, 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_VOICE, extra_data);
851  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
852  *      // Error handling
853  *   }
854  *
855  *   ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL);
856  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
857  *      // Error handling
858  *   }
859  *
860  *   ret = attach_panel_show(ad->attach_panel);
861  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
862  *      // Error handling
863  *   }
864  *
865  *   bundle_free(extra_data);
866  *
867  *       return 0;
868  * }
869  *
870  * @endcode
871  */
872 extern int attach_panel_set_result_cb(attach_panel_h attach_panel, attach_panel_result_cb result_cb, void *user_data);
873
874 /**
875  * @brief Unsets the result callback that will be called when an user selects and confirms something to attach in the attach panel.
876  * @since_tizen 2.4
877  * @remarks The caller app has to check the return value of this function.\n
878  *
879  * @param[in] attach_panel Attach panel handler
880  * @return #ATTACH_PANEL_ERROR_NONE on success,
881  *         otherwise a negative error value
882  * @retval #ATTACH_PANEL_ERROR_NONE Successful
883  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
884  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
885  *
886  * @pre Call attach_panel_create() before calling this function.
887  * @see attach_panel_create()
888  * @see attach_panel_destroy()
889  * @see attach_panel_add_content_category()
890  * @see attach_panel_remove_content_category()
891  * @see attach_panel_set_extra_data()
892  * @see attach_panel_set_result_cb()
893  * @see attach_panel_show()
894  * @see attach_panel_hide()
895  * @see attach_panel_get_visibility()
896  *
897  * @par Example
898  * @code
899  * #include <attach_panel.h>
900  *
901  * struct appdata {
902  *   Evas_Object *attach_panel;
903  *   Evas_Object *conformant;
904  * };
905  *
906  * static int app_terminate(void *data)
907  * {
908  *   struct appdata *ad = data;
909  *   int ret = 0;
910  *
911  *   if (!ad) {
912  *     // Error handling
913  *   }
914  *
915  *   if (!ad->attach_panel) {
916  *     // Error handling
917  *   }
918  *
919  *   ret = attach_panel_hide(ad->attach_panel);
920  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
921  *      // Error handling
922  *   }
923  *
924  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE);
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_CAMERA);
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_VOICE);
935  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
936  *      // Error handling
937  *   }
938  *
939  *   ret = attach_panel_unset_result_cb(ad->attach_panel);
940  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
941  *      // Error handling
942  *   }
943  *
944  *   ret = attach_panel_destroy(ad->attach_panel);
945  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
946  *      // Error handling
947  *   }
948  *   ad->attach_panel = NULL;
949  *
950  *       return 0;
951  * }
952  *
953  * @endcode
954  */
955 extern int attach_panel_unset_result_cb(attach_panel_h attach_panel);
956
957 /**
958  * @brief Sets the event callback that will be called when reserved events are published from the panel-side.
959  * @since_tizen 2.4
960  * @remarks The caller app has to check the return value of this function.\n
961  *          We can set only one callback function with this API.\n
962  *          If you set multiple callbacks with this API,\n
963  *          the last one is registered only.
964  *
965  * @param[in] attach_panel Attach panel handler
966  * @param[in] event_cb Attach panel event callback
967  * @param[in] user_data User data
968  * @return #ATTACH_PANEL_ERROR_NONE on success,
969  *         otherwise a negative error value
970  * @retval #ATTACH_PANEL_ERROR_NONE Successful
971  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
972  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
973  *
974  * @pre Call attach_panel_create() before calling this function.
975  * @post The event_cb set with attach_panel_set_event_cb() will be called after publishing reserved events.
976  * @see attach_panel_create()
977  * @see attach_panel_destroy()
978  * @see attach_panel_show()
979  * @see attach_panel_hide()
980  * @see attach_panel_get_visibility()
981  * @see attach_panel_unset_event_cb()
982  * @see attach_panel_event_cb
983  *
984  * @par Example
985  * @code
986  * #include <attach_panel.h>
987  *
988  * struct appdata {
989  *   Evas_Object *attach_panel;
990  *   Evas_Object *conformant;
991  * };
992  *
993  * static void _event_cb(attach_panel_h attach_panel, attach_panel_event_e event, void *event_info, void *data)
994  * {
995  *   switch (event) {
996  *   case ATTACH_PANEL_EVENT_SHOW_START:
997  *     // event handling
998  *     break;
999  *   case ATTACH_PANEL_EVENT_SHOW_FINISH:
1000  *     // event handling
1001  *     break;
1002  *   case ATTACH_PANEL_EVENT_HIDE_START:
1003  *     // event handling
1004  *     break;
1005  *   case ATTACH_PANEL_EVENT_HIDE_FINISH:
1006  *     // event handling
1007  *     break;
1008  *   default:
1009  *     // error handling
1010  *     break;
1011  *   }
1012  * }
1013  *
1014  * static int app_control(void *data)
1015  * {
1016  *   struct appdata *ad = data;
1017  *   int ret = ATTACH_PANEL_ERROR_NONE;
1018  *
1019  *   if (!ad) {
1020  *     // Error handling
1021  *   }
1022  *
1023  *   if (!ad->conformant) {
1024  *     // Error handling
1025  *   }
1026  *
1027  *   ret = attach_panel_create(ad->conformant, &ad->attach_panel);
1028  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1029  *      // Error handling
1030  *   }
1031  *
1032  *   ret = attach_panel_set_event_cb(ad->attach_panel, _event_cb, ad);
1033  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1034  *      // Error handling
1035  *   }
1036  *
1037  *   // other routines
1038  *
1039  *       return 0;
1040  * }
1041  *
1042  * @endcode
1043  */
1044 extern int attach_panel_set_event_cb(attach_panel_h attach_panel, attach_panel_event_cb event_cb, void *user_data);
1045
1046 /**
1047  * @brief Unsets the event callback
1048  * @since_tizen 2.4
1049  * @remarks The caller app has to check the return value of this function.
1050  *
1051  * @param[in] attach_panel Attach panel handler
1052  * @param[in] result_cb Attach panel result callback
1053  * @return #ATTACH_PANEL_ERROR_NONE on success,
1054  *         otherwise a negative error value
1055  * @retval #ATTACH_PANEL_ERROR_NONE Successful
1056  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
1057  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
1058  *
1059  * @pre Call attach_panel_create() before calling this function.
1060  * @see attach_panel_create()
1061  * @see attach_panel_destroy()
1062  * @see attach_panel_show()
1063  * @see attach_panel_hide()
1064  * @see attach_panel_get_visibility()
1065  * @see attach_panel_set_event_cb()
1066  *
1067  * @par Example
1068  * @code
1069  * #include <attach_panel.h>
1070  *
1071  * struct appdata {
1072  *   Evas_Object *attach_panel;
1073  *   Evas_Object *conformant;
1074  * };
1075  *
1076  * static int app_terminate(void *data)
1077  * {
1078  *   struct appdata *ad = data;
1079  *   int ret = 0;
1080  *
1081  *   if (!ad) {
1082  *     // Error handling
1083  *   }
1084  *
1085  *   if (!ad->attach_panel) {
1086  *     // Error handling
1087  *   }
1088  *
1089  *   ret = attach_panel_unset_event_cb(ad->attach_panel);
1090  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1091  *      // Error handling
1092  *   }
1093  *
1094  *   ret = attach_panel_destroy(ad->attach_panel);
1095  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1096  *      // Error handling
1097  *   }
1098  *   ad->attach_panel = NULL;
1099  *
1100  *       return 0;
1101  * }
1102  *
1103  * @endcode
1104  */
1105 extern int attach_panel_unset_event_cb(attach_panel_h attach_panel);
1106
1107 /**
1108  * @brief Shows the attach panel, asynchronously.
1109  * @since_tizen 2.4
1110  * @remarks The caller app has to check the return value of this function.\n
1111  *
1112  * @param[in] attach_panel Attach panel handler
1113  * @return #ATTACH_PANEL_ERROR_NONE on success,
1114  *         otherwise a negative error value
1115  * @retval #ATTACH_PANEL_ERROR_NONE Successful
1116  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
1117  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
1118  *
1119  * @pre Call attach_panel_create() before calling this function.
1120  * @see attach_panel_create()
1121  * @see attach_panel_destroy()
1122  * @see attach_panel_add_content_category()
1123  * @see attach_panel_remove_content_category()
1124  * @see attach_panel_set_extra_data()
1125  * @see attach_panel_set_result_cb()
1126  * @see attach_panel_unset_result_cb()
1127  * @see attach_panel_hide()
1128  * @see attach_panel_get_visibility()
1129  *
1130  * @par Example
1131  * @code
1132  * #include <attach_panel.h>
1133  *
1134  * struct appdata {
1135  *   Evas_Object *attach_panel;
1136  *   Evas_Object *conformant;
1137  * };
1138  *
1139  * 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)
1140  * {
1141  *   char **select = NULL;
1142  *   int i = 0;
1143  *   int length = 0;
1144  *   int ret = APP_CONTROL_ERROR_NONE;
1145  *
1146  *   if (!result) {
1147  *     // Error handling
1148  *   }
1149  *
1150  *   if (APP_CONTROL_RESULT_SUCCEEDED != result_code) {
1151  *     // Error handling
1152  *   }
1153  *
1154  *   ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length);
1155  *   if (APP_CONTROL_ERROR_NONE != ret || !select) {
1156  *     // Error handling
1157  *   }
1158  *
1159  *   for (; i < length; i++) {
1160  *      printf("path is %s, %d\n", select[i], length);
1161  *      free(select[i]);
1162  *   }
1163  *
1164  *   free(select);
1165  * }
1166  *
1167  * static int app_control(void *data)
1168  * {
1169  *   struct appdata *ad = data;
1170  *   bundle *extra_data = NULL;
1171  *   int ret = ATTACH_PANEL_ERROR_NONE;
1172  *
1173  *   if (!ad) {
1174  *     // Error handling
1175  *   }
1176  *
1177  *   if (!ad->conformant) {
1178  *     // Error handling
1179  *   }
1180  *
1181  *   ret = attach_panel_create(ad->conformant, &ad->attach_panel);
1182  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1183  *      // Error handling
1184  *   }
1185  *
1186  *   extra_data = bundle_create();
1187  *   if (!extra_data) {
1188  *      // Error handling
1189  *   }
1190  *
1191  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3");
1192  *   bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000");
1193  *
1194  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data);
1195  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1196  *      // Error handling
1197  *   }
1198  *
1199  *   ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, 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_VOICE, extra_data);
1205  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1206  *      // Error handling
1207  *   }
1208  *
1209  *   ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL);
1210  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1211  *      // Error handling
1212  *   }
1213  *
1214  *   ret = attach_panel_show(ad->attach_panel);
1215  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1216  *      // Error handling
1217  *   }
1218  *
1219  *   bundle_free(extra_data);
1220  *
1221  *       return 0;
1222  * }
1223  *
1224  * @endcode
1225  */
1226 extern int attach_panel_show(attach_panel_h attach_panel);
1227
1228 /**
1229  * @brief Hides the attach panel, asynchronously.
1230  * @since_tizen 2.4
1231  * @remarks The caller app has to check the return value of this function.\n
1232  *
1233  * @param[in] attach_panel Attach panel handler
1234  * @return #ATTACH_PANEL_ERROR_NONE on success,
1235  *         otherwise a negative error value
1236  * @retval #ATTACH_PANEL_ERROR_NONE Successful
1237  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
1238  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
1239  *
1240  * @pre Call attach_panel_create() before calling this function.
1241  * @see attach_panel_create()
1242  * @see attach_panel_destroy()
1243  * @see attach_panel_add_content_category()
1244  * @see attach_panel_remove_content_category()
1245  * @see attach_panel_set_extra_data()
1246  * @see attach_panel_set_result_cb()
1247  * @see attach_panel_unset_result_cb()
1248  * @see attach_panel_show()
1249  * @see attach_panel_get_visibility()
1250  *
1251  * @par Example
1252  * @code
1253  * #include <attach_panel.h>
1254  *
1255  * struct appdata {
1256  *   Evas_Object *attach_panel;
1257  *   Evas_Object *conformant;
1258  * };
1259  *
1260  * static int app_terminate(void *data)
1261  * {
1262  *   struct appdata *ad = data;
1263  *   int ret = 0;
1264  *
1265  *   if (!ad) {
1266  *     // Error handling
1267  *   }
1268  *
1269  *   if (!ad->attach_panel) {
1270  *     // Error handling
1271  *   }
1272  *
1273  *   ret = attach_panel_hide(ad->attach_panel);
1274  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1275  *      // Error handling
1276  *   }
1277  *
1278  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE);
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_CAMERA);
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_VOICE);
1289  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1290  *      // Error handling
1291  *   }
1292  *
1293  *   ret = attach_panel_unset_result_cb(ad->attach_panel);
1294  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1295  *      // Error handling
1296  *   }
1297  *
1298  *   ret = attach_panel_destroy(ad->attach_panel);
1299  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1300  *      // Error handling
1301  *   }
1302  *   ad->attach_panel = NULL;
1303  *
1304  *       return 0;
1305  * }
1306  *
1307  * @endcode
1308  */
1309 extern int attach_panel_hide(attach_panel_h attach_panel);
1310
1311 /**
1312  * @brief Gets a value that indicates whether the attach_panel is visible.
1313  * @since_tizen 2.4
1314  * @remarks The caller app has to check the return value of this function.\n
1315  *
1316  * @param[in] attach_panel Attach panel handler
1317  * @param[out] visible value of attach_panel state
1318  * @return #ATTACH_PANEL_ERROR_NONE on success,
1319  *         otherwise a negative error value
1320  * @retval #ATTACH_PANEL_ERROR_NONE Successful
1321  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
1322  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
1323  *
1324  * @pre Call attach_panel_create() before calling this function.
1325  * @see attach_panel_create()
1326  * @see attach_panel_destroy()
1327  * @see attach_panel_add_content_category()
1328  * @see attach_panel_remove_content_category()
1329  * @see attach_panel_set_extra_data()
1330  * @see attach_panel_set_result_cb()
1331  * @see attach_panel_unset_result_cb()
1332  * @see attach_panel_show()
1333  * @see attach_panel_hide()
1334  *
1335  * @par Example
1336  * @code
1337  * #include <attach_panel.h>
1338  *
1339  * struct appdata {
1340  *   Evas_Object *attach_panel;
1341  *   Evas_Object *conformant;
1342  * };
1343  *
1344  * static int app_terminate(void *data)
1345  * {
1346  *   struct appdata *ad = data;
1347  *   bool vislble = false;
1348  *   int ret = 0;
1349  *
1350  *   if (!ad) {
1351  *     // Error handling
1352  *   }
1353  *
1354  *   if (!ad->attach_panel) {
1355  *     // Error handling
1356  *   }
1357  *
1358  *   ret = attach_panel_get_visibility(ad->attach_panel, &visible);
1359  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1360  *      // Error handling
1361  *   }
1362  *
1363  *   if (visible) {
1364  *      ret = attach_panel_hide(ad->attach_panel);
1365  *      if (ATTACH_PANEL_ERROR_NONE != ret) {
1366  *         // Error handling
1367  *      }
1368  *   }
1369  *
1370  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE);
1371  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1372  *      // Error handling
1373  *   }
1374  *
1375  *   ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA);
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_VOICE);
1381  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1382  *      // Error handling
1383  *   }
1384  *
1385  *   ret = attach_panel_unset_result_cb(ad->attach_panel);
1386  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1387  *      // Error handling
1388  *   }
1389  *
1390  *   ret = attach_panel_destroy(ad->attach_panel);
1391  *   if (ATTACH_PANEL_ERROR_NONE != ret) {
1392  *      // Error handling
1393  *   }
1394  *   ad->attach_panel = NULL;
1395  *
1396  *       return 0;
1397  * }
1398  *
1399  * @endcode
1400  */
1401 extern int attach_panel_get_visibility(attach_panel_h attach_panel, bool *visible);
1402
1403 /**
1404  * @}
1405  */
1406
1407 #ifdef __cplusplus
1408 }
1409 #endif
1410 #endif // __TIZEN_ATTACH_PANEL_H__
1411