Tizen Native API
4.0
|
Attach panel provides functions to attach images, voices, contacts, events and files. Users can attach images, take pictures, record voice and select files to attach into the caller app.
Required Header
#include <attach_panel.h>
Overview
- It provides functions for adding an attach panel (attach_panel_create()) and deleting it (attach_panel_destroy()) in an app.
- Content categories can be added (attach_panel_add_content_category()) or removed (attach_panel_remove_content_category()).
- Dynamic configurations can be handled with (attach_panel_set_extra_data()). This is used with a content category.
- Results can be returned into the result callback that is set with (attach_panel_set_result_cb()) or unset with (attach_panel_unset_result_cb()).
- Events are delivered into the event callback that is set with (attach_panel_set_event_cb()) or unset with (attach_panel_unset_event_cb()).
- The panel can be shown with (attach_panel_show()) and hidden with (attach_panel_hide()).
- You can get the state of the panel with (attach_panel_get_visibility()).
Related Features
This API is related with the following features:
- http://tizen.org/feature/camera
- http://tizen.org/feature/microphone It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Functions | |
int | attach_panel_create (Evas_Object *conformant, attach_panel_h *attach_panel) |
Creates an attach panel. | |
int | attach_panel_destroy (attach_panel_h attach_panel) |
Destroys the attach panel. | |
int | attach_panel_add_content_category (attach_panel_h attach_panel, attach_panel_content_category_e content_category, bundle *extra_data) |
Adds a content category in the attach panel. | |
int | attach_panel_remove_content_category (attach_panel_h attach_panel, attach_panel_content_category_e content_category) |
Removes the content category from the attach panel. | |
int | attach_panel_set_extra_data (attach_panel_h attach_panel, attach_panel_content_category_e content_category, bundle *extra_data) |
Sets extra data to send to the content category using a bundle. | |
int | attach_panel_set_result_cb (attach_panel_h attach_panel, attach_panel_result_cb result_cb, void *user_data) |
Sets the result callback that will be called when an user selects and confirms something to attach in the attach panel. | |
int | attach_panel_unset_result_cb (attach_panel_h attach_panel) |
Unsets the result callback that will be called when an user selects and confirms something to attach in the attach panel. | |
int | attach_panel_set_event_cb (attach_panel_h attach_panel, attach_panel_event_cb panel_event_cb, void *user_data) |
Sets the event callback that will be called when reserved events are published from the panel-side. | |
int | attach_panel_unset_event_cb (attach_panel_h attach_panel) |
Unsets the event callback. | |
int | attach_panel_show (attach_panel_h attach_panel) |
Shows the attach panel, asynchronously. | |
int | attach_panel_show_without_animation (attach_panel_h attach_panel) |
Shows the attach panel, synchronously. | |
int | attach_panel_hide (attach_panel_h attach_panel) |
Hides the attach panel, asynchronously. | |
int | attach_panel_hide_without_animation (attach_panel_h attach_panel) |
Hides the attach panel, synchronously. | |
int | attach_panel_get_visibility (attach_panel_h attach_panel, bool *visible) |
Gets a value that indicates whether the attach_panel is visible. | |
int | attach_panel_get_state (attach_panel_h attach_panel, attach_panel_state_e *state) |
Gets the state of the attach_panel. | |
Typedefs | |
typedef enum attach_panel_content_category | attach_panel_content_category_e |
Enumeration for content categories. | |
typedef enum attach_panel_event | attach_panel_event_e |
Enumeration for events. | |
typedef struct _attach_panel * | attach_panel_h |
Attach panel handle. | |
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) |
Called when an user selects and confirms something to attach on the caller app. | |
typedef void(* | attach_panel_event_cb )(attach_panel_h attach_panel, attach_panel_event_e event, void *event_info, void *user_data) |
Called when reserved events are published from the panel-side. | |
typedef enum attach_panel_error | attach_panel_error_e |
Enumeration for values of attach-panel response types. |
Typedef Documentation
Enumeration for content categories.
- Since :
- 2.4
typedef enum attach_panel_error attach_panel_error_e |
Enumeration for values of attach-panel response types.
- Since :
- 2.4
typedef void(* attach_panel_event_cb)(attach_panel_h attach_panel, attach_panel_event_e event, void *event_info, void *user_data) |
Called when reserved events are published from the panel-side.
- Since :
- 2.4
- Parameters:
-
[in] attach_panel Attach panel handler [in] event Attach panel event [in] event_info additional event information.
This can be NULL if there are no necessary information.[in] user_data user data
- Precondition:
- The callback must be registered using attach_panel_set_event_cb()
typedef enum attach_panel_event attach_panel_event_e |
Enumeration for events.
- Since :
- 2.4
typedef struct _attach_panel* attach_panel_h |
Attach panel handle.
- Since :
- 2.4
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) |
Called when an user selects and confirms something to attach on the caller app.
- Since :
- 2.4
- Parameters:
-
[in] attach_panel Attach panel handler [in] content_category results are from the content category [in] result app_control handler.
The caller app has to use app_control_get_extra_data_array() to get received data.
http://tizen.org/appcontrol/data/selected
[in] result_code result of app_control [in] user_data user data
- Precondition:
- The callback must be registered using attach_panel_set_result_cb()
attach_panel_add_content_category() and attach_panel_show() must be called to invoke this callback.
Enumeration Type Documentation
Enumeration for content categories.
- Since :
- 2.4
- Enumerator:
enum attach_panel_error |
Enumeration for values of attach-panel response types.
- Since :
- 2.4
- Enumerator:
enum attach_panel_event |
Enumeration for events.
- Since :
- 2.4
- Enumerator:
enum attach_panel_state_e |
Function Documentation
int attach_panel_add_content_category | ( | attach_panel_h | attach_panel, |
attach_panel_content_category_e | content_category, | ||
bundle * | extra_data | ||
) |
Adds a content category in the attach panel.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/mediastorage
- Privilege:
- http://tizen.org/privilege/camera
- Privilege:
- http://tizen.org/privilege/recorder
- Privilege:
- http://tizen.org/privilege/appmanager.launch
- Remarks:
- The caller app has to check the return value of this function.
Content categories will be shown as the sequence of using attach_panel_add_content_category.
Some contents need time to load it all.
So, it is needed to use this before the mainloop of attach_panel_show().
Privileges,
http://tizen.org/privilege/mediastorage, for using ATTACH_PANEL_CONTENT_CATEGORY_IMAGE or ATTACH_PANEL_CONTENT_CATEGORY_CAMERA
http://tizen.org/privilege/camera, for using ATTACH_PANEL_CONTENT_CATEGORY_CAMERA or ATTACH_PANEL_CONTENT_CATEGORY_TAKE_PICTURE
http://tizen.org/privilege/recorder, for using ATTACH_PANEL_CONTENT_CATEGORY_VOICE
http://tizen.org/privilege/appmanager.launch, for adding content categories on the More tab
Deliver more information to the callee with a bundle if you need.
http://tizen.org/appcontrol/data/total_count
http://tizen.org/appcontrol/data/total_size
- Parameters:
-
[in] attach_panel Attach panel handler [in] content_category The content_category to be added in the attach_panel. [in] extra_data The attach panel send some information using bundle.
- Returns:
- ATTACH_PANEL_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_PERMISSION_DENIED permission denied ATTACH_PANEL_ERROR_NOT_INITIALIZED not initialized ATTACH_PANEL_ERROR_UNSUPPORTED_CONTENT_CATEGORY not supported content category ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
- Precondition:
- Call attach_panel_create() before calling this function.
- See also:
- attach_panel_create()
- attach_panel_destroy()
- attach_panel_remove_content_category()
- attach_panel_set_result_cb()
- attach_panel_unset_result_cb()
- attach_panel_show()
- attach_panel_hide()
- attach_panel_get_visibility()
- ATTACH_PANEL_CONTENT_CATEGORY_IMAGE
- ATTACH_PANEL_CONTENT_CATEGORY_CAMERA
- ATTACH_PANEL_CONTENT_CATEGORY_VOICE
- ATTACH_PANEL_CONTENT_CATEGORY_VIDEO
- ATTACH_PANEL_CONTENT_CATEGORY_AUDIO
- ATTACH_PANEL_CONTENT_CATEGORY_CALENDAR
- ATTACH_PANEL_CONTENT_CATEGORY_CONTACT
- ATTACH_PANEL_CONTENT_CATEGORY_MYFILES
- ATTACH_PANEL_CONTENT_CATEGORY_DOCUMENT
- ATTACH_PANEL_CONTENT_CATEGORY_TAKE_PICTURE
- ATTACH_PANEL_CONTENT_CATEGORY_MEMO
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; 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) { char **select = NULL; int i = 0; int length = 0; int ret = APP_CONTROL_ERROR_NONE; if (!result) // Error handling if (APP_CONTROL_RESULT_SUCCEEDED != result_code) // Error handling ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length); if (APP_CONTROL_ERROR_NONE != ret || !select) // Error handling for (; i < length; i++) { printf("path is %s, %d\n", select[i], length); free(select[i]); } free(select); } static int app_control(void *data) { struct appdata *ad = data; bundle *extra_data = NULL; int ret = ATTACH_PANEL_ERROR_NONE; if (!ad) // Error handling if (!ad->conformant) // Error handling ret = attach_panel_create(ad->conformant, &ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling extra_data = bundle_create(); if (!extra_data) // Error handling bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3"); bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000"); ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_show(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling bundle_free(extra_data); return 0; }
int attach_panel_create | ( | Evas_Object * | conformant, |
attach_panel_h * | attach_panel | ||
) |
Creates an attach panel.
- Since :
- 2.4
- Remarks:
- The caller app has to check the return value of this function.
A conformant object can have only one attach_panel_h.
If a caller app try to add more than one attach-panel, it fails to add it.
- Parameters:
-
[in] conformant The caller's conformant [out] attach_panel Attach panel handler
- Returns:
- ATTACH_PANEL_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_OUT_OF_MEMORY Out of memory ATTACH_PANEL_ERROR_ALREADY_EXISTS Already exists
- See also:
- attach_panel_destroy()
- attach_panel_add_content_category()
- attach_panel_remove_content_category()
- attach_panel_set_extra_data()
- attach_panel_set_result_cb()
- attach_panel_unset_result_cb()
- attach_panel_set_event_cb()
- attach_panel_unset_event_cb()
- attach_panel_show()
- attach_panel_hide()
- attach_panel_get_visibility()
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; 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) { char **select = NULL; int i = 0; int length = 0; int ret = APP_CONTROL_ERROR_NONE; if (!result) // Error handling if (APP_CONTROL_RESULT_SUCCEEDED != result_code) // Error handling ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length); if (APP_CONTROL_ERROR_NONE != ret || !select) // Error handling for (; i < length; i++) { printf("path is %s, %d\n", select[i], length); free(select[i]); } free(select); } static int app_control(void *data) { struct appdata *ad = data; bundle *extra_data = NULL; int ret = ATTACH_PANEL_ERROR_NONE; if (!ad) // Error handling if (!ad->conformant) // Error handling ret = attach_panel_create(ad->conformant, &ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling extra_data = bundle_create(); if (!extra_data) // Error handling bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3"); bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000"); ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_show(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling bundle_free(extra_data); return 0; }
int attach_panel_destroy | ( | attach_panel_h | attach_panel | ) |
Destroys the attach panel.
- Since :
- 2.4
- Remarks:
- The caller app has to check the return value of this function.
- Parameters:
-
[in] attach_panel Attach panel handler
- Returns:
- ATTACH_PANEL_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
- See also:
- attach_panel_create()
- attach_panel_add_content_category()
- attach_panel_remove_content_category()
- attach_panel_set_extra_data()
- attach_panel_set_result_cb()
- attach_panel_unset_result_cb()
- attach_panel_set_event_cb()
- attach_panel_unset_event_cb()
- attach_panel_show()
- attach_panel_hide()
- attach_panel_get_visibility()
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; static int app_terminate(void *data) { struct appdata *ad = data; int ret = 0; if (!ad) // Error handling if (!ad->attach_panel) // Error handling ret = attach_panel_hide(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_unset_result_cb(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_destroy(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ad->attach_panel = NULL; return 0; }
int attach_panel_get_state | ( | attach_panel_h | attach_panel, |
attach_panel_state_e * | state | ||
) |
Gets the state of the attach_panel.
- Since :
- 3.0
- Remarks:
- Users can toggle the attach panel between full screen state or partial window state.
Developer can get the state of attach panel by calling this function.
- Parameters:
-
[in] attach_panel The attach panel handle [out] state The attach_panel window state
- Returns:
- ATTACH_PANEL_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
- Precondition:
- Call attach_panel_create() before calling this function.
- See also:
- attach_panel_state_e
- Example
int ret; attach_panel_state_e attach_panel_state; ret = attach_panel_get_state(attach_panel, &attach_panel_state); if (ATTACH_PANEL_ERROR_NONE != ret) { // Error handling } switch (attach_panel_state) { case ATTACH_PANEL_STATE_HIDDEN: // attach panel is hidden break; case ATTACH_PANEL_STATE_PARTIAL: // for partial window mode break; case ATTACH_PANEL_STATE_FULL: // full screen mode break; }
int attach_panel_get_visibility | ( | attach_panel_h | attach_panel, |
bool * | visible | ||
) |
Gets a value that indicates whether the attach_panel is visible.
- Since :
- 2.4
- Remarks:
- The caller app has to check the return value of this function.
- Parameters:
-
[in] attach_panel Attach panel handler [out] visible value of attach_panel state
- Returns:
- ATTACH_PANEL_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
- Precondition:
- Call attach_panel_create() before calling this function.
- See also:
- attach_panel_create()
- attach_panel_destroy()
- attach_panel_add_content_category()
- attach_panel_remove_content_category()
- attach_panel_set_extra_data()
- attach_panel_set_result_cb()
- attach_panel_unset_result_cb()
- attach_panel_show()
- attach_panel_hide()
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; static int app_terminate(void *data) { struct appdata *ad = data; bool visible = false; int ret = 0; if (!ad) // Error handling if (!ad->attach_panel) // Error handling ret = attach_panel_get_visibility(ad->attach_panel, &visible); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling if (visible) { ret = attach_panel_hide(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling } ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_unset_result_cb(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_destroy(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ad->attach_panel = NULL; return 0; }
int attach_panel_hide | ( | attach_panel_h | attach_panel | ) |
Hides the attach panel, asynchronously.
- Since :
- 2.4
- Remarks:
- The caller app has to check the return value of this function.
- Parameters:
-
[in] attach_panel Attach panel handler
- Returns:
- ATTACH_PANEL_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
- Precondition:
- Call attach_panel_create() before calling this function.
- See also:
- attach_panel_create()
- attach_panel_destroy()
- attach_panel_add_content_category()
- attach_panel_remove_content_category()
- attach_panel_set_extra_data()
- attach_panel_set_result_cb()
- attach_panel_unset_result_cb()
- attach_panel_show()
- attach_panel_get_visibility()
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; static int app_terminate(void *data) { struct appdata *ad = data; int ret = 0; if (!ad) // Error handling if (!ad->attach_panel) // Error handling ret = attach_panel_hide(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_unset_result_cb(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_destroy(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ad->attach_panel = NULL; return 0; }
int attach_panel_hide_without_animation | ( | attach_panel_h | attach_panel | ) |
Hides the attach panel, synchronously.
- Since :
- 4.0
- Parameters:
-
[in] attach_panel The attach panel handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_ALREADY_DESTROYED The panel has been already destroyed
- Precondition:
- Call attach_panel_create() before calling this function.
- See also:
- attach_panel_create()
- attach_panel_hide()
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; static int app_terminate(void *data) { struct appdata *ad = data; int ret = 0; if (!ad) // Error handling if (!ad->attach_panel) // Error handling ret = attach_panel_hide_without_animation(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_unset_result_cb(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_destroy(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ad->attach_panel = NULL; return 0; }
int attach_panel_remove_content_category | ( | attach_panel_h | attach_panel, |
attach_panel_content_category_e | content_category | ||
) |
Removes the content category from the attach panel.
- Since :
- 2.4
- Remarks:
- The caller app has to check the return value of this function.
- Parameters:
-
[in] attach_panel Attach panel handler [in] content_category The content_category adding in the attach_panel.
- Returns:
- ATTACH_PANEL_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_NOT_INITIALIZED not initialized ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
- Precondition:
- Call attach_panel_create() before calling this function.
- See also:
- attach_panel_create()
- attach_panel_destroy()
- attach_panel_add_content_category()
- attach_panel_set_extra_data()
- attach_panel_set_result_cb()
- attach_panel_unset_result_cb()
- attach_panel_show()
- attach_panel_hide()
- attach_panel_get_visibility()
- ATTACH_PANEL_CONTENT_CATEGORY_IMAGE
- ATTACH_PANEL_CONTENT_CATEGORY_CAMERA
- ATTACH_PANEL_CONTENT_CATEGORY_VOICE
- ATTACH_PANEL_CONTENT_CATEGORY_VIDEO
- ATTACH_PANEL_CONTENT_CATEGORY_AUDIO
- ATTACH_PANEL_CONTENT_CATEGORY_CALENDAR
- ATTACH_PANEL_CONTENT_CATEGORY_CONTACT
- ATTACH_PANEL_CONTENT_CATEGORY_MYFILES
- ATTACH_PANEL_CONTENT_CATEGORY_DOCUMENT
- ATTACH_PANEL_CONTENT_CATEGORY_TAKE_PICTURE
- ATTACH_PANEL_CONTENT_CATEGORY_MEMO
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; static int app_terminate(void *data) { struct appdata *ad = data; int ret = 0; if (!ad) // Error handling if (!ad->attach_panel) // Error handling ret = attach_panel_hide(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_unset_result_cb(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_destroy(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ad->attach_panel = NULL; return 0; }
int attach_panel_set_event_cb | ( | attach_panel_h | attach_panel, |
attach_panel_event_cb | panel_event_cb, | ||
void * | user_data | ||
) |
Sets the event callback that will be called when reserved events are published from the panel-side.
- Since :
- 2.4
- Remarks:
- The caller app has to check the return value of this function.
We can set only one callback function with this API.
If you set multiple callbacks with this API,
the last one is registered only.
- Parameters:
-
[in] attach_panel Attach panel handler [in] panel_event_cb Attach panel event callback [in] user_data User data
- Returns:
- ATTACH_PANEL_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
- Precondition:
- Call attach_panel_create() before calling this function.
- Postcondition:
- The event_cb set with attach_panel_set_event_cb() will be called after publishing reserved events.
- See also:
- attach_panel_create()
- attach_panel_destroy()
- attach_panel_show()
- attach_panel_hide()
- attach_panel_get_visibility()
- attach_panel_unset_event_cb()
- attach_panel_event_cb
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; static void _event_cb(attach_panel_h attach_panel, attach_panel_event_e event, void *event_info, void *data) { switch (event) { case ATTACH_PANEL_EVENT_SHOW_START: // Event handling break; case ATTACH_PANEL_EVENT_SHOW_FINISH: // Event handling break; case ATTACH_PANEL_EVENT_HIDE_START: // Event handling break; case ATTACH_PANEL_EVENT_HIDE_FINISH: // Event handling break; default: // Error handling break; } } static int app_control(void *data) { struct appdata *ad = data; int ret = ATTACH_PANEL_ERROR_NONE; if (!ad) // Error handling if (!ad->conformant) // Error handling ret = attach_panel_create(ad->conformant, &ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_set_event_cb(ad->attach_panel, _event_cb, ad); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling // Other routines return 0; }
int attach_panel_set_extra_data | ( | attach_panel_h | attach_panel, |
attach_panel_content_category_e | content_category, | ||
bundle * | extra_data | ||
) |
Sets extra data to send to the content category using a bundle.
- Since :
- 2.4
- Privilege Level:
- public
- Remarks:
- The caller app has to check the return value of this function.
extra data will be changed using attach_panel_set_extra_data.
http://tizen.org/appcontrol/data/total_count
http://tizen.org/appcontrol/data/total_size
- Parameters:
-
[in] attach_panel Attach panel handler [in] content_category The content_category to be set the some information in the attach_panel. [in] extra_data The attach panel set some information using bundle.
- Returns:
- ATTACH_PANEL_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed ATTACH_PANEL_ERROR_OUT_OF_MEMORY Fail to set the extra data
- Precondition:
- Call attach_panel_create() before calling this function.
- See also:
- attach_panel_create()
- attach_panel_destroy()
- attach_panel_add_content_category()
- attach_panel_remove_content_category()
- attach_panel_set_result_cb()
- attach_panel_unset_result_cb()
- attach_panel_show()
- attach_panel_hide()
- attach_panel_get_visibility()
- ATTACH_PANEL_CONTENT_CATEGORY_IMAGE
- ATTACH_PANEL_CONTENT_CATEGORY_CAMERA
- ATTACH_PANEL_CONTENT_CATEGORY_VOICE
- ATTACH_PANEL_CONTENT_CATEGORY_VIDEO
- ATTACH_PANEL_CONTENT_CATEGORY_AUDIO
- ATTACH_PANEL_CONTENT_CATEGORY_CALENDAR
- ATTACH_PANEL_CONTENT_CATEGORY_CONTACT
- ATTACH_PANEL_CONTENT_CATEGORY_MYFILES
- ATTACH_PANEL_CONTENT_CATEGORY_DOCUMENT
- ATTACH_PANEL_CONTENT_CATEGORY_TAKE_PICTURE
- ATTACH_PANEL_CONTENT_CATEGORY_MEMO
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; 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) { char **select = NULL; int i = 0; int length = 0; int ret = APP_CONTROL_ERROR_NONE; if (!result) // Error handling if (APP_CONTROL_RESULT_SUCCEEDED != result_code) // Error handling ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length); if (APP_CONTROL_ERROR_NONE != ret || !select) // Error handling for (; i < length; i++) { printf("path is %s, %d\n", select[i], length); free(select[i]); } free(select); } static void _reset_bundle_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { struct appdata *ad = data; bundle *extra_data = NULL; int ret = APP_CONTROL_ERROR_NONE; if (!ad) // Error handling extra_data = bundle_create(); if (!extra_data) // Error handling bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "5"); bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "20480000"); ret = attach_panel_set_extra_data(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_set_extra_data(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_set_extra_data(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling bundle_free(extra_data); } static int app_control(void *data) { struct appdata *ad = data; bundle *extra_data = NULL; int ret = ATTACH_PANEL_ERROR_NONE; if (!ad) // Error handling if (!ad->conformant) // Error handling ret = attach_panel_create(ad->conformant, &ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling extra_data = bundle_create(); if (!extra_data) // Error handling bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3"); bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000"); ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_show(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling bundle_free(extra_data); return 0; }
int attach_panel_set_result_cb | ( | attach_panel_h | attach_panel, |
attach_panel_result_cb | result_cb, | ||
void * | user_data | ||
) |
Sets the result callback that will be called when an user selects and confirms something to attach in the attach panel.
- Since :
- 2.4
- Remarks:
- The caller app has to check the return value of this function.
We can set only one callback function with this API.
If you set multiple callbacks with this API,
the last one is registered only.
- Parameters:
-
[in] attach_panel Attach panel handler [in] result_cb Attach panel result callback [in] user_data User data
- Returns:
- ATTACH_PANEL_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
- Precondition:
- Call attach_panel_create() before calling this function.
- Postcondition:
- The result_cb set with attach_panel_set_result_cb() will be called after an user select something to attach.
- See also:
- attach_panel_create()
- attach_panel_destroy()
- attach_panel_add_content_category()
- attach_panel_remove_content_category()
- attach_panel_set_extra_data()
- attach_panel_unset_result_cb()
- attach_panel_show()
- attach_panel_hide()
- attach_panel_get_visibility()
- attach_panel_result_cb
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; 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) { char **select = NULL; int i = 0; int length = 0; int ret = APP_CONTROL_ERROR_NONE; if (!result) // Error handling if (APP_CONTROL_RESULT_SUCCEEDED != result_code) // Error handling ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length); if (APP_CONTROL_ERROR_NONE != ret || !select) // Error handling for (; i < length; i++) { printf("path is %s, %d\n", select[i], length); free(select[i]); } free(select); } static int app_control(void *data) { struct appdata *ad = data; bundle *extra_data = NULL; int ret = ATTACH_PANEL_ERROR_NONE; if (!ad) // Error handling if (!ad->conformant) // Error handling ret = attach_panel_create(ad->conformant, &ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling extra_data = bundle_create(); if (!extra_data) // Error handling bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3"); bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000"); ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_show(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling bundle_free(extra_data); return 0; }
int attach_panel_show | ( | attach_panel_h | attach_panel | ) |
Shows the attach panel, asynchronously.
- Since :
- 2.4
- Remarks:
- The caller app has to check the return value of this function.
- Parameters:
-
[in] attach_panel Attach panel handler
- Returns:
- ATTACH_PANEL_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
- Precondition:
- Call attach_panel_create() before calling this function.
- See also:
- attach_panel_create()
- attach_panel_destroy()
- attach_panel_add_content_category()
- attach_panel_remove_content_category()
- attach_panel_set_extra_data()
- attach_panel_set_result_cb()
- attach_panel_unset_result_cb()
- attach_panel_hide()
- attach_panel_get_visibility()
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; 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) { char **select = NULL; int i = 0; int length = 0; int ret = APP_CONTROL_ERROR_NONE; if (!result) // Error handling if (APP_CONTROL_RESULT_SUCCEEDED != result_code) // Error handling ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length); if (APP_CONTROL_ERROR_NONE != ret || !select) // Error handling for (; i < length; i++) { printf("path is %s, %d\n", select[i], length); free(select[i]); } free(select); } static int app_control(void *data) { struct appdata *ad = data; bundle *extra_data = NULL; int ret = ATTACH_PANEL_ERROR_NONE; if (!ad) // Error handling if (!ad->conformant) // Error handling ret = attach_panel_create(ad->conformant, &ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling extra_data = bundle_create(); if (!extra_data) // Error handling bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3"); bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000"); ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_show(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling bundle_free(extra_data); return 0; }
int attach_panel_show_without_animation | ( | attach_panel_h | attach_panel | ) |
Shows the attach panel, synchronously.
- Since :
- 4.0
- Parameters:
-
[in] attach_panel The attach panel handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_ALREADY_DESTROYED The panel has been already destroyed
- Precondition:
- Call attach_panel_create() before calling this function.
- See also:
- attach_panel_create()
- attach_panel_show()
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; 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) { char **select = NULL; int i = 0; int length = 0; int ret = APP_CONTROL_ERROR_NONE; if (!result) // Error handling if (APP_CONTROL_RESULT_SUCCEEDED != result_code) // Error handling ret = app_control_get_extra_data_array(result, "http://tizen.org/appcontrol/data/selected", &select, &length); if (APP_CONTROL_ERROR_NONE != ret || !select) // Error handling for (; i < length; i++) { printf("path is %s, %d\n", select[i], length); free(select[i]); } free(select); } static int app_control(void *data) { struct appdata *ad = data; bundle *extra_data = NULL; int ret = ATTACH_PANEL_ERROR_NONE; if (!ad) // Error handling if (!ad->conformant) // Error handling ret = attach_panel_create(ad->conformant, &ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling extra_data = bundle_create(); if (!extra_data) // Error handling bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_count", "3"); bundle_add_str(extra_data, "http://tizen.org/appcontrol/data/total_size", "10240000"); ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_add_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE, extra_data); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_set_result_cb(ad->attach_panel, _result_cb, NULL); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_show_without_animation(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling bundle_free(extra_data); return 0; }
int attach_panel_unset_event_cb | ( | attach_panel_h | attach_panel | ) |
Unsets the event callback.
- Since :
- 2.4
- Remarks:
- The caller app has to check the return value of this function.
- Parameters:
-
[in] attach_panel Attach panel handler
- Returns:
- ATTACH_PANEL_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
- Precondition:
- Call attach_panel_create() before calling this function.
- See also:
- attach_panel_create()
- attach_panel_destroy()
- attach_panel_show()
- attach_panel_hide()
- attach_panel_get_visibility()
- attach_panel_set_event_cb()
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; static int app_terminate(void *data) { struct appdata *ad = data; int ret = 0; if (!ad) // Error handling if (!ad->attach_panel) // Error handling ret = attach_panel_unset_event_cb(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_destroy(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ad->attach_panel = NULL; return 0; }
int attach_panel_unset_result_cb | ( | attach_panel_h | attach_panel | ) |
Unsets the result callback that will be called when an user selects and confirms something to attach in the attach panel.
- Since :
- 2.4
- Remarks:
- The caller app has to check the return value of this function.
- Parameters:
-
[in] attach_panel Attach panel handler
- Returns:
- ATTACH_PANEL_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
ATTACH_PANEL_ERROR_NONE Successful ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
- Precondition:
- Call attach_panel_create() before calling this function.
- See also:
- attach_panel_create()
- attach_panel_destroy()
- attach_panel_add_content_category()
- attach_panel_remove_content_category()
- attach_panel_set_extra_data()
- attach_panel_set_result_cb()
- attach_panel_show()
- attach_panel_hide()
- attach_panel_get_visibility()
- Example
#include <attach_panel.h> struct appdata { Evas_Object *attach_panel; Evas_Object *conformant; }; static int app_terminate(void *data) { struct appdata *ad = data; int ret = 0; if (!ad) // Error handling if (!ad->attach_panel) // Error handling ret = attach_panel_hide(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_IMAGE); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_CAMERA); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_remove_content_category(ad->attach_panel, ATTACH_PANEL_CONTENT_CATEGORY_VOICE); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_unset_result_cb(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ret = attach_panel_destroy(ad->attach_panel); if (ATTACH_PANEL_ERROR_NONE != ret) // Error handling ad->attach_panel = NULL; return 0; }