Tizen Native API
4.0
|
This module provides functionalities of copy and paste for applications.
This module provides functionalities about clipboard.
#include <cbhm.h>
Clipboard provides functionalities for copy and paste for applications The clipboard manages the history of copied items from applications. data can be transferred between applications by using clipboard with copy and paste operations
Functions | |
int | cbhm_open_service (cbhm_h *cbhm_handle) |
Creates and initializes clipboard handle. | |
int | cbhm_close_service (cbhm_h cbhm_handle) |
Closes clipboard handle. | |
int | cbhm_show (cbhm_h cbhm_handle) |
Shows clipboard. | |
int | cbhm_hide (cbhm_h cbhm_handle) |
Hides clipboard. | |
int | cbhm_selection_type_set (cbhm_h cbhm_handle, cbhm_sel_type_e type) |
Sets clipboard selection type. | |
int | cbhm_selection_type_get (cbhm_h cbhm_handle, cbhm_sel_type_e *type) |
Gets clipboard selection type. | |
int | cbhm_item_selected_callback_add (cbhm_h cbhm_handle, cbhm_selected_cb callback, void *user_data) |
Adds event callback function of selecting a clipboard item. | |
int | cbhm_item_selected_callback_remove (cbhm_h cbhm_handle, cbhm_selected_cb callback, void *user_data) |
Removes event callback function for selecting a clipboard item. | |
int | cbhm_selection_set (cbhm_h cbhm_handle, cbhm_sel_type_e type, const void *data, size_t len) |
Sends data to clipboard. | |
int | cbhm_selection_get (cbhm_h cbhm_handle, cbhm_sel_type_e type, cbhm_selection_data_cb callback, void *user_data) |
Receives data from clipboard. | |
int | cbhm_item_count_get (cbhm_h cbhm_handle) |
Gets the count of clipboard items. | |
int | cbhm_latest_item_type_get (cbhm_h cbhm_handle, cbhm_sel_type_e *type) |
Gets the type of the latest item in clipboard. | |
int | cbhm_item_changed_callback_add (cbhm_h cbhm_handle, cbhm_item_changed_cb callback, void *user_data) |
Adds event callback function for receiving changed event of clipboard items. | |
int | cbhm_item_changed_callback_remove (cbhm_h cbhm_handle, cbhm_item_changed_cb callback, void *user_data) |
Removes event callback function for receiving changed event of clipboard items. | |
int | cbhm_state_get (cbhm_h cbhm_handle, cbhm_state_type_e *type) |
Gets the clipboard state. | |
int | cbhm_monitor_callback_add (cbhm_h cbhm_handle, cbhm_monitor_cb callback, void *user_data) |
Adds event callback function of receiving monitored event of clipboard. | |
int | cbhm_monitor_callback_remove (cbhm_h cbhm_handle, cbhm_monitor_cb callback, void *user_data) |
Deletes event callback function of receiving monitored event of clipboard. | |
Typedefs | |
typedef struct cbhm * | cbhm_h |
Clipboard handle. | |
typedef int(* | cbhm_selected_cb )(cbhm_h cbhm_handle, void *user_data) |
Event callback signature of selecting a clipboard item. | |
typedef int(* | cbhm_selection_data_cb )(cbhm_h cbhm_handle, const char *buf, size_t len, void *user_data) |
Event callback signature of receiving data from clipboard. | |
typedef void(* | cbhm_item_changed_cb )(cbhm_h cbhm_handle, int item_count, void *user_data) |
Event callback signature for receiving changed event of clipboard items. | |
typedef void(* | cbhm_monitor_cb )(cbhm_h cbhm_handle, bool active_state, void *user_data) |
Event callback signature of receiving monitored event of clipboard. |
typedef struct cbhm* cbhm_h |
Clipboard handle.
typedef void(* cbhm_item_changed_cb)(cbhm_h cbhm_handle, int item_count, void *user_data) |
Event callback signature for receiving changed event of clipboard items.
[in] | cbhm_handle | The clipboard handle |
[in] | item_count | The number of clipboard items |
[in] | user_data | User data to be passed to the given event callback function |
CBHM_ERROR_NONE | Successful |
typedef void(* cbhm_monitor_cb)(cbhm_h cbhm_handle, bool active_state, void *user_data) |
Event callback signature of receiving monitored event of clipboard.
[in] | cbhm_handle | Clipboard handle |
[in] | active_state | Clipboard is active if true , inactive otherwise |
[in] | user_data | User data to be passed to the given event callback function |
typedef int(* cbhm_selected_cb)(cbhm_h cbhm_handle, void *user_data) |
Event callback signature of selecting a clipboard item.
[in] | cbhm_handle | Clipboard handle |
[in] | user_data | User data to be passed to the given event callback function |
typedef int(* cbhm_selection_data_cb)(cbhm_h cbhm_handle, const char *buf, size_t len, void *user_data) |
Event callback signature of receiving data from clipboard.
[in] | Clipboard | handle |
[out] | buf | Buffer for receiving data |
[in] | len | The length of buffer |
[in] | user_data | User data to be passed to the given event callback function |
enum cbhm_error_e |
Enumeration for Clipboard Error Codes.
enum cbhm_sel_type_e |
enum cbhm_state_type_e |
Enumeration for Clipboard State Type.
int cbhm_close_service | ( | cbhm_h | cbhm_handle | ) |
Closes clipboard handle.
[in] | cbhm_handle | Clipboard handle |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
Hides clipboard.
[in] | cbhm_handle | Clipboard handle |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
int cbhm_item_changed_callback_add | ( | cbhm_h | cbhm_handle, |
cbhm_item_changed_cb | callback, | ||
void * | user_data | ||
) |
Adds event callback function for receiving changed event of clipboard items.
[in] | cbhm_handle | The clipboard handle |
[in] | callback | The callback function called when a clipboard item is changed |
[in] | user_data | User data to be passed to the given event callback function |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
CBHM_ERROR_OUT_OF_MEMORY | Out of memory |
int cbhm_item_changed_callback_remove | ( | cbhm_h | cbhm_handle, |
cbhm_item_changed_cb | callback, | ||
void * | user_data | ||
) |
Removes event callback function for receiving changed event of clipboard items.
[in] | cbhm_handle | The clipboard handle |
[in] | callback | The callback function to be removed |
[in] | user_data | User data to be passed to the given event callback function |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
int cbhm_item_count_get | ( | cbhm_h | cbhm_handle | ) |
Gets the count of clipboard items.
[in] | cbhm_handle | Clipboard handle |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
int cbhm_item_selected_callback_add | ( | cbhm_h | cbhm_handle, |
cbhm_selected_cb | callback, | ||
void * | user_data | ||
) |
Adds event callback function of selecting a clipboard item.
[in] | cbhm_handle | Clipboard handle |
[in] | callback | Callback function called when a clipboard item is selected |
[in] | user_data | User data to be passed to the given event callback function |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
CBHM_ERROR_OUT_OF_MEMORY | Out of memory |
int cbhm_item_selected_callback_remove | ( | cbhm_h | cbhm_handle, |
cbhm_selected_cb | callback, | ||
void * | user_data | ||
) |
Removes event callback function for selecting a clipboard item.
[in] | cbhm_handle | The clipboard handle |
[in] | callback | The callback function to be deleted |
[in] | user_data | User data to be passed to the given event callback function |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
int cbhm_latest_item_type_get | ( | cbhm_h | cbhm_handle, |
cbhm_sel_type_e * | type | ||
) |
Gets the type of the latest item in clipboard.
[in] | cbhm_handle | The clipboard handle |
[out] | type | The type of the latest item |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
int cbhm_monitor_callback_add | ( | cbhm_h | cbhm_handle, |
cbhm_monitor_cb | callback, | ||
void * | user_data | ||
) |
Adds event callback function of receiving monitored event of clipboard.
[in] | cbhm_handle | Clipboard handle |
[in] | callback | Callback function called when clipboard becomes active or inactive |
[in] | user_data | User data to be passed to the given event callback function |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
CBHM_ERROR_OUT_OF_MEMORY | Out of memory |
int cbhm_monitor_callback_remove | ( | cbhm_h | cbhm_handle, |
cbhm_monitor_cb | callback, | ||
void * | user_data | ||
) |
Deletes event callback function of receiving monitored event of clipboard.
[in] | cbhm_handle | Clipboard handle |
[in] | callback | Callback function to be deleted |
[in] | user_data | User data to be passed to the given event callback function |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
int cbhm_open_service | ( | cbhm_h * | cbhm_handle | ) |
Creates and initializes clipboard handle.
[out] | cbhm_handle | Clipboard handle |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
CBHM_ERROR_OUT_OF_MEMORY | Out of memory |
int cbhm_selection_get | ( | cbhm_h | cbhm_handle, |
cbhm_sel_type_e | type, | ||
cbhm_selection_data_cb | callback, | ||
void * | user_data | ||
) |
Receives data from clipboard.
[in] | cbhm_handle | Clipboard handle |
[in] | type | Selection type |
[in] | callback | Callback function receiving data from clipboard |
[in] | user_data | User data to be passed to the given event callback function |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
CBHM_ERROR_NO_DATA | No data available |
int cbhm_selection_set | ( | cbhm_h | cbhm_handle, |
cbhm_sel_type_e | type, | ||
const void * | data, | ||
size_t | len | ||
) |
Sends data to clipboard.
[in] | cbhm_handle | Clipboard handle |
[in] | type | Selection type |
[in] | data | Data to be sent |
[in] | len | The length of data |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
CBHM_ERROR_OUT_OF_MEMORY | Out of memory |
int cbhm_selection_type_get | ( | cbhm_h | cbhm_handle, |
cbhm_sel_type_e * | type | ||
) |
Gets clipboard selection type.
[in] | cbhm_handle | Clipboard handle |
[out] | type | Selection type |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
int cbhm_selection_type_set | ( | cbhm_h | cbhm_handle, |
cbhm_sel_type_e | type | ||
) |
Sets clipboard selection type.
[in] | cbhm_handle | Clipboard handle |
[in] | type | Selection type |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
Shows clipboard.
[in] | cbhm_handle | Clipboard handle |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |
int cbhm_state_get | ( | cbhm_h | cbhm_handle, |
cbhm_state_type_e * | type | ||
) |
Gets the clipboard state.
[in] | cbhm_handle | Clipboard handle |
[out] | type | State type |
0
on success, otherwise a negative error value CBHM_ERROR_NONE | Successful |
CBHM_ERROR_INVALID_PARAMETER | Invalid function parameters |