Tizen Native API
6.0
|
This module provides functionalities of copy and paste for applications.
This module provides functionalities about clipboard.
Required Header
#include <cbhm.h>
Overview
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 Documentation
typedef struct cbhm* cbhm_h |
Clipboard handle.
- Since :
- 3.0
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.
- Since :
- 4.0
- Parameters:
-
[in] cbhm_handle The clipboard handle
- Remarks:
- cbhm_handle is the same handle as the one used in the cbhm_item_changed_callback_add() call with which the callback was added
- Parameters:
-
[in] item_count The number of clipboard items [in] user_data User data to be passed to the given event callback function
- Returns:
- CBHM_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
CBHM_ERROR_NONE Successful
- See also:
- cbhm_item_selected_callback_add()
typedef void(* cbhm_monitor_cb)(cbhm_h cbhm_handle, bool active_state, void *user_data) |
Event callback signature of receiving monitored event of clipboard.
- Since :
- 4.0
- Parameters:
-
[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.
- Since :
- 3.0
- Parameters:
-
[in] cbhm_handle Clipboard handle [in] user_data User data to be passed to the given event callback function
- Returns:
- This is reserved
- See also:
- cbhm_item_selected_callback_add()
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.
- Since :
- 3.0
- Parameters:
-
[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
- Returns:
- This is reserved
- See also:
- cbhm_item_selected_callback_add()
Enumeration Type Documentation
enum cbhm_error_e |
Enumeration for Clipboard Error Codes.
- Since :
- 3.0
enum cbhm_sel_type_e |
Enumeration for Clipboard Data Type.
- Since :
- 3.0
- Enumerator:
enum cbhm_state_type_e |
Function Documentation
int cbhm_close_service | ( | cbhm_h | cbhm_handle | ) |
Closes clipboard handle.
- Since :
- 3.0
- Parameters:
-
[in] cbhm_handle Clipboard handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CBHM_ERROR_NONE Successful CBHM_ERROR_INVALID_PARAMETER Invalid function parameters
- See also:
- cbhm_open_service()
Hides clipboard.
- Since :
- 3.0
- Parameters:
-
[in] cbhm_handle Clipboard handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CBHM_ERROR_NONE Successful CBHM_ERROR_INVALID_PARAMETER Invalid function parameters
- See also:
- cbhm_show()
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.
- Since :
- 4.0
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 4.0
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 3.0
- Parameters:
-
[in] cbhm_handle Clipboard handle
- Returns:
- The count of clipboard items
- Return values:
-
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.
- Since :
- 3.0
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 4.0
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 4.0
- Parameters:
-
[in] cbhm_handle The clipboard handle [out] type The type of the latest item
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CBHM_ERROR_NONE Successful CBHM_ERROR_INVALID_PARAMETER Invalid function parameters
- See also:
- cbhm_selection_type_set()
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.
- Since :
- 4.0
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CBHM_ERROR_NONE Successful CBHM_ERROR_INVALID_PARAMETER Invalid function parameters CBHM_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- cbhm_monitor_callback_remove()
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.
- Since :
- 4.0
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CBHM_ERROR_NONE Successful CBHM_ERROR_INVALID_PARAMETER Invalid function parameters
- See also:
- cbhm_monitor_callback_add()
int cbhm_open_service | ( | cbhm_h * | cbhm_handle | ) |
Creates and initializes clipboard handle.
- Since :
- 3.0
- Parameters:
-
[out] cbhm_handle Clipboard handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CBHM_ERROR_NONE Successful CBHM_ERROR_INVALID_PARAMETER Invalid function parameters CBHM_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- cbhm_close_service()
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.
- Since :
- 3.0
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CBHM_ERROR_NONE Successful CBHM_ERROR_INVALID_PARAMETER Invalid function parameters CBHM_ERROR_NO_DATA No data available
- See also:
- cbhm_selection_set()
int cbhm_selection_set | ( | cbhm_h | cbhm_handle, |
cbhm_sel_type_e | type, | ||
const void * | data, | ||
size_t | len | ||
) |
Sends data to clipboard.
- Since :
- 3.0
- Parameters:
-
[in] cbhm_handle Clipboard handle [in] type Selection type [in] data Data to be sent [in] len The length of data
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CBHM_ERROR_NONE Successful CBHM_ERROR_INVALID_PARAMETER Invalid function parameters CBHM_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- cbhm_selection_get()
int cbhm_selection_type_get | ( | cbhm_h | cbhm_handle, |
cbhm_sel_type_e * | type | ||
) |
Gets clipboard selection type.
- Since :
- 3.0
- Parameters:
-
[in] cbhm_handle Clipboard handle [out] type Selection type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CBHM_ERROR_NONE Successful CBHM_ERROR_INVALID_PARAMETER Invalid function parameters
- See also:
- cbhm_selection_type_set()
int cbhm_selection_type_set | ( | cbhm_h | cbhm_handle, |
cbhm_sel_type_e | type | ||
) |
Sets clipboard selection type.
- Since :
- 3.0
- Parameters:
-
[in] cbhm_handle Clipboard handle [in] type Selection type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CBHM_ERROR_NONE Successful CBHM_ERROR_INVALID_PARAMETER Invalid function parameters
- See also:
- cbhm_selection_type_get()
Shows clipboard.
- Since :
- 3.0
- Parameters:
-
[in] cbhm_handle Clipboard handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CBHM_ERROR_NONE Successful CBHM_ERROR_INVALID_PARAMETER Invalid function parameters
- See also:
- cbhm_hide()
int cbhm_state_get | ( | cbhm_h | cbhm_handle, |
cbhm_state_type_e * | type | ||
) |
Gets the clipboard state.
- Since :
- 4.0
- Parameters:
-
[in] cbhm_handle Clipboard handle [out] type State type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CBHM_ERROR_NONE Successful CBHM_ERROR_INVALID_PARAMETER Invalid function parameters