Tizen Native API
4.0
|
Request to handle the quickpanel service.
#include <tzsh_quickpanel.h>
The Tizen WS Shell Quickpanel API provides functions to handle the quickpanel service.
Functions | |
tzsh_quickpanel_h | tzsh_quickpanel_create (tzsh_h tzsh, tzsh_window win) |
Creates a tzsh_quickpanel_h object which handles the quickpanel service. | |
int | tzsh_quickpanel_destroy (tzsh_quickpanel_h quickpanel) |
Destroys the given tzsh_quickpanel_h object. | |
int | tzsh_quickpanel_show (tzsh_quickpanel_h quickpanel) |
Shows the quickpanel service window if it is currently scrollable. | |
int | tzsh_quickpanel_hide (tzsh_quickpanel_h quickpanel) |
Hides the quickpanel service window. | |
int | tzsh_quickpanel_visible_get (tzsh_quickpanel_h quickpanel, tzsh_quickpanel_state_visible_e *visible) |
Gets the visible state of the quickpanel. | |
int | tzsh_quickpanel_scrollable_set (tzsh_quickpanel_h quickpanel, bool scrollable) |
Sets the scrollable state of a quickpanel service window. | |
int | tzsh_quickpanel_scrollable_get (tzsh_quickpanel_h quickpanel, tzsh_quickpanel_state_scrollable_e *scrollable) |
Checks if the quickpanel service window is scrollable. | |
int | tzsh_quickpanel_orientation_get (tzsh_quickpanel_h quickpanel, tzsh_quickpanel_state_orientation_e *orientation) |
Gets the orientation of the quickpanel. | |
tzsh_quickpanel_event_handler_h | tzsh_quickpanel_event_handler_add (tzsh_quickpanel_h quickpanel, int type, tzsh_quickpanel_event_cb func, void *user_data) |
Adds an event handler. | |
int | tzsh_quickpanel_event_handler_del (tzsh_quickpanel_h quickpanel, tzsh_quickpanel_event_handler_h event_handler) |
Removes the registered event handler. | |
int | tzsh_quickpanel_event_visible_get (tzsh_quickpanel_event_info_h event_info, tzsh_quickpanel_state_visible_e *visible) |
Gets the visible state from given event info. | |
int | tzsh_quickpanel_event_orientation_get (tzsh_quickpanel_event_info_h event_info, tzsh_quickpanel_state_orientation_e *orientation) |
Gets the orientation state from given event info. | |
Typedefs | |
typedef struct _tzsh_quickpanel_s * | tzsh_quickpanel_h |
Handle for the Tizen quickpanel client. | |
typedef struct _tzsh_event_handler_s * | tzsh_quickpanel_event_handler_h |
Handle for the event handler of the quickpanel. | |
typedef struct _tzsh_quickpanel_event_info_s * | tzsh_quickpanel_event_info_h |
Handle for the event information of the quickpanel. | |
typedef void(* | tzsh_quickpanel_event_cb )(int type, tzsh_quickpanel_event_info_h event_info, void *user_data) |
Called when a quickpanel event occurs. |
typedef void(* tzsh_quickpanel_event_cb)(int type, tzsh_quickpanel_event_info_h event_info, void *user_data) |
Called when a quickpanel event occurs.
[in] | type | The event type (TZSH_QUICKPANEL_EVENT_VISIBLE, TZSH_QUICKPANEL_EVENT_ORIENTATION) |
[in] | event_info | The tzsh_quickpanel_event_info_h handle |
[in] | user_data | The user data |
#include <tzsh_quickpanel.h> tzsh_quickpanel_h qp = NULL; tzsh_quickpanel_event_handler_h handler[2] = {NULL, NULL}; static void _cb_vis_changed (int type, tzsh_quickpanel_event_info_h ev_info, void *data) { tzsh_quickpanel_state_visible_e state; if (type != TZSH_QUICKPANEL_EVENT_VISIBLE) { return; } tzsh_quickpanel_event_visible_get(ev_info, &state); if (state == TZSH_QUICKPANEL_STATE_VISIBLE_SHOWN) { // quick panel is shown } else if (state == TZSH_QUICKPANEL_STATE_VISIBLE_HIDDEN) { // quick panel is hidden } else { // quick panel's state is unknown } } static void _cb_orientation_changed(int type, tzsh_quickpanel_event_info_h ev_info, void *data) { tzsh_quickpanel_state_orientation_e state; if (type != TZSH_QUICKPANEL_EVENT_ORIENTATION) { return; } tzsh_quickpanel_event_orientation_get(ev_info, &state); switch (state) { case TZSH_QUICKPANEL_STATE_ORIENTATION_0: // quickpanel is 0 degree break; case TZSH_QUICKPANEL_STATE_ORIENTATION_90: // quickpanel is 90 degree break; case TZSH_QUICKPANEL_STATE_ORIENTATION_180: // quickpanel is 180 degree break; case TZSH_QUICKPANEL_STATE_ORIENTATION_270: // quickpanel is 270 degree break; default: // quickpanel's degree is unknown break; } } void create_window(void) { ... qp = tzsh_quickpanel_create(tzsh, tz_win); ... handler[0] = tzsh_quickpanel_event_handler_add(qp, TZSH_QUICKPANEL_EVENT_VISIBLE, _cb_vis_changed, NULL); handler[1] = tzsh_quickpanel_event_handler_add(qp, TZSH_QUICKPANEL_EVENT_ORIENTATION, _cb_orientation_changed, NULL); ... }
typedef struct _tzsh_event_handler_s* tzsh_quickpanel_event_handler_h |
Handle for the event handler of the quickpanel.
typedef struct _tzsh_quickpanel_event_info_s* tzsh_quickpanel_event_info_h |
Handle for the event information of the quickpanel.
typedef struct _tzsh_quickpanel_s* tzsh_quickpanel_h |
Handle for the Tizen quickpanel client.
Enumeration for orientation state of quickpanel.
tzsh_quickpanel_h tzsh_quickpanel_create | ( | tzsh_h | tzsh, |
tzsh_window | win | ||
) |
Creates a tzsh_quickpanel_h object which handles the quickpanel service.
[in] | tzsh | The tzsh_h instance |
[in] | win | The native window |
NULL
otherwise TZSH_ERROR_NONE | Successful |
TZSH_ERROR_INVALID_PARAMETER | Invalid parameter |
#include <tzsh_quickpanel.h> tzsh_h tzsh = NULL; tzsh_quickpanel_h qp = NULL; Evas_Object *win; void init_tzsh(void) { tzsh = tzsh_create(TZSH_TOOLKIT_TYPE_EFL); ... } void create_window(void) { tzsh_window tz_win; win = elm_win_add(NULL, "sample", ELM_WIN_BASIC); ... tz_win = elm_win_window_id_get(win); ... qp = tzsh_quickpanel_create(tzsh, tz_win); ... }
int tzsh_quickpanel_destroy | ( | tzsh_quickpanel_h | quickpanel | ) |
Destroys the given tzsh_quickpanel_h object.
[in] | quickpanel | The tzsh_quickpanel_h object to be destroyed |
0
on success, otherwise a negative error value TZSH_ERROR_NONE | Successful |
TZSH_ERROR_INVALID_PARAMETER | Invalid parameter |
#include <tzsh_quickpanel.h> tzsh_h tzsh = NULL; tzsh_quickpanel_h qp = NULL; Evas_Object *win; void create_window(void) { tzsh_window tz_win; win = elm_win_add(NULL, "sample", ELM_WIN_BASIC); ... tz_win = elm_win_window_id_get(win); ... qp = tzsh_quickpanel_create(tzsh, tz_win); ... } void destroy_window(void) { ... tzsh_quickpanel_destroy(qp); qp = NULL; ... }
tzsh_quickpanel_event_handler_h tzsh_quickpanel_event_handler_add | ( | tzsh_quickpanel_h | quickpanel, |
int | type, | ||
tzsh_quickpanel_event_cb | func, | ||
void * | user_data | ||
) |
Adds an event handler.
[in] | quickpanel | The tzsh_quickpanel_h object |
[in] | type | The event type (TZSH_QUICKPANEL_EVENT_VISIBLE, TZSH_QUICKPANEL_EVENT_ORIENTATION) |
[in] | func | The callback function to be called |
[in] | user_data | The data passed to the callback function |
NULL
otherwise int tzsh_quickpanel_event_handler_del | ( | tzsh_quickpanel_h | quickpanel, |
tzsh_quickpanel_event_handler_h | event_handler | ||
) |
Removes the registered event handler.
[in] | quickpanel | The tzsh_quickpanel_h object |
[in] | event_handler | The tzsh_quickpanel_event_handler_h object |
0
on success, otherwise a negative error value TZSH_ERROR_NONE | Successful |
TZSH_ERROR_INVALID_PARAMETER | Invalid parameter |
int tzsh_quickpanel_event_orientation_get | ( | tzsh_quickpanel_event_info_h | event_info, |
tzsh_quickpanel_state_orientation_e * | orientation | ||
) |
Gets the orientation state from given event info.
[in] | event_info | The tzsh_quickpanel_event_info_h object |
[out] | orientation | The orientation state of quickpanel |
0
on success, otherwise a negative error value TZSH_ERROR_NONE | Successful |
TZSH_ERROR_INVALID_PARAMETER | Invalid parameter |
int tzsh_quickpanel_event_visible_get | ( | tzsh_quickpanel_event_info_h | event_info, |
tzsh_quickpanel_state_visible_e * | visible | ||
) |
Gets the visible state from given event info.
[in] | event_info | The tzsh_quickpanel_event_info_h object |
[out] | visible | The visible state of quickpanel |
0
on success, otherwise a negative error value TZSH_ERROR_NONE | Successful |
TZSH_ERROR_INVALID_PARAMETER | Invalid parameter |
int tzsh_quickpanel_hide | ( | tzsh_quickpanel_h | quickpanel | ) |
Hides the quickpanel service window.
[in] | quickpanel | The tzsh_quickpanel_h object |
0
on success, otherwise a negative error value TZSH_ERROR_NONE | Successful |
TZSH_ERROR_INVALID_PARAMETER | Invalid parameter |
TZSH_ERROR_NO_SERVICE | Service does not exist |
int tzsh_quickpanel_orientation_get | ( | tzsh_quickpanel_h | quickpanel, |
tzsh_quickpanel_state_orientation_e * | orientation | ||
) |
Gets the orientation of the quickpanel.
[in] | quickpanel | The tzsh_quickpanel_h object |
[out] | orientation | The orientation of the quickpanel service window |
0
on success, otherwise a negative error value TZSH_ERROR_NONE | Successful |
TZSH_ERROR_INVALID_PARAMETER | Invalid parameter |
TZSH_ERROR_NO_SERVICE | Service does not exist |
int tzsh_quickpanel_scrollable_get | ( | tzsh_quickpanel_h | quickpanel, |
tzsh_quickpanel_state_scrollable_e * | scrollable | ||
) |
Checks if the quickpanel service window is scrollable.
[in] | quickpanel | The tzsh_quickpanel_h object |
[out] | scrollable | The scrollable state of the quickpanel service window |
0
on success, otherwise a negative error value TZSH_ERROR_NONE | Successful |
TZSH_ERROR_INVALID_PARAMETER | Invalid parameter |
TZSH_ERROR_NO_SERVICE | Service does not exist |
int tzsh_quickpanel_scrollable_set | ( | tzsh_quickpanel_h | quickpanel, |
bool | scrollable | ||
) |
Sets the scrollable state of a quickpanel service window.
This API is useful when the application does not need to show the quickpanel service window. If the application set the scrollable to false
, the quickpanel service window does not show on the display as long as the application window is shown. Default scrollable state of the window is true.
[in] | quickpanel | The tzsh_quickpanel_h object |
[in] | scrollable | The scrollable state |
0
on success, otherwise a negative error value TZSH_ERROR_NONE | Successful |
TZSH_ERROR_INVALID_PARAMETER | Invalid parameter |
TZSH_ERROR_NO_SERVICE | Service does not exist |
int tzsh_quickpanel_show | ( | tzsh_quickpanel_h | quickpanel | ) |
Shows the quickpanel service window if it is currently scrollable.
[in] | quickpanel | The tzsh_quickpanel_h object |
0
on success, otherwise a negative error value TZSH_ERROR_NONE | Successful |
TZSH_ERROR_INVALID_PARAMETER | Invalid parameter |
TZSH_ERROR_NO_SERVICE | Service does not exist |
int tzsh_quickpanel_visible_get | ( | tzsh_quickpanel_h | quickpanel, |
tzsh_quickpanel_state_visible_e * | visible | ||
) |
Gets the visible state of the quickpanel.
[in] | quickpanel | The tzsh_quickpanel_h object |
[out] | visible | The visible state of the quickpanel service window |
0
on success, otherwise a negative error value TZSH_ERROR_NONE | Successful |
TZSH_ERROR_INVALID_PARAMETER | Invalid parameter |
TZSH_ERROR_NO_SERVICE | Service does not exist |
Tizen event type for the quickpanel orientation.
Tizen event type for the quickpanel visible state.