Tizen Native API
5.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.
#include <attach_panel.h>
This API is related with the following features:
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. |
Enumeration for content categories.
typedef enum attach_panel_error attach_panel_error_e |
Enumeration for values of attach-panel response types.
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.
[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 |
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.
[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 |
Enumeration for content categories.
enum attach_panel_error |
Enumeration for values of attach-panel response types.
enum attach_panel_event |
Enumeration for events.
enum attach_panel_state_e |
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.
[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. |
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 |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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.
[in] | conformant | The caller's conformant |
[out] | attach_panel | Attach panel handler |
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 |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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.
[in] | attach_panel | Attach panel handler |
ATTACH_PANEL_ERROR_NONE | Successful |
ATTACH_PANEL_ERROR_INVALID_PARAMETER | Invalid parameter |
ATTACH_PANEL_ERROR_ALREADY_DESTROYED | already removed |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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.
[in] | attach_panel | The attach panel handle |
[out] | state | The attach_panel window state |
ATTACH_PANEL_ERROR_NONE | Successful |
ATTACH_PANEL_ERROR_INVALID_PARAMETER | Invalid parameter |
ATTACH_PANEL_ERROR_ALREADY_DESTROYED | already removed |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
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.
[in] | attach_panel | Attach panel handler |
[out] | visible | value of attach_panel state |
ATTACH_PANEL_ERROR_NONE | Successful |
ATTACH_PANEL_ERROR_INVALID_PARAMETER | Invalid parameter |
ATTACH_PANEL_ERROR_ALREADY_DESTROYED | already removed |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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.
[in] | attach_panel | Attach panel handler |
ATTACH_PANEL_ERROR_NONE | Successful |
ATTACH_PANEL_ERROR_INVALID_PARAMETER | Invalid parameter |
ATTACH_PANEL_ERROR_ALREADY_DESTROYED | already removed |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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.
[in] | attach_panel | The attach panel handle |
ATTACH_PANEL_ERROR_NONE | Successful |
ATTACH_PANEL_ERROR_INVALID_PARAMETER | Invalid parameter |
ATTACH_PANEL_ERROR_ALREADY_DESTROYED | The panel has been already destroyed |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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.
[in] | attach_panel | Attach panel handler |
[in] | content_category | The content_category adding in the attach_panel. |
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 |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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.
[in] | attach_panel | Attach panel handler |
[in] | panel_event_cb | Attach panel event callback |
[in] | user_data | User data |
ATTACH_PANEL_ERROR_NONE | Successful |
ATTACH_PANEL_ERROR_INVALID_PARAMETER | Invalid parameter |
ATTACH_PANEL_ERROR_ALREADY_DESTROYED | already removed |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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.
[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. |
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 |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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.
[in] | attach_panel | Attach panel handler |
[in] | result_cb | Attach panel result callback |
[in] | user_data | User data |
ATTACH_PANEL_ERROR_NONE | Successful |
ATTACH_PANEL_ERROR_INVALID_PARAMETER | Invalid parameter |
ATTACH_PANEL_ERROR_ALREADY_DESTROYED | already removed |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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.
[in] | attach_panel | Attach panel handler |
ATTACH_PANEL_ERROR_NONE | Successful |
ATTACH_PANEL_ERROR_INVALID_PARAMETER | Invalid parameter |
ATTACH_PANEL_ERROR_ALREADY_DESTROYED | already removed |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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.
[in] | attach_panel | The attach panel handle |
ATTACH_PANEL_ERROR_NONE | Successful |
ATTACH_PANEL_ERROR_INVALID_PARAMETER | Invalid parameter |
ATTACH_PANEL_ERROR_ALREADY_DESTROYED | The panel has been already destroyed |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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.
[in] | attach_panel | Attach panel handler |
ATTACH_PANEL_ERROR_NONE | Successful |
ATTACH_PANEL_ERROR_INVALID_PARAMETER | Invalid parameter |
ATTACH_PANEL_ERROR_ALREADY_DESTROYED | already removed |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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.
[in] | attach_panel | Attach panel handler |
ATTACH_PANEL_ERROR_NONE | Successful |
ATTACH_PANEL_ERROR_INVALID_PARAMETER | Invalid parameter |
ATTACH_PANEL_ERROR_ALREADY_DESTROYED | already removed |
ATTACH_PANEL_ERROR_NOT_SUPPORTED | Not supported |
#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; }