Tizen Native API  3.0
Clipboard History Manager

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_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.

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 Documentation

typedef struct cbhm* cbhm_h

Clipboard handle.

Since :
3.0
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_handleClipboard handle
[in]user_dataUser data to be passed to the given event callback function
Returns:
This is reserved
See also:
cbhm_item_selected_callabck_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]Clipboardhandle
[out]bufBuffer for receiving data
[in]lenThe length of buffer
[in]user_dataUser data to be passed to the given event callback function
Returns:
This is reserved
See also:
cbhm_item_selected_callabck_add()

Enumeration Type Documentation

Enumeration for Clipboard Error Codes.

Since :
3.0
Enumerator:
CBHM_ERROR_NONE 

Successful

CBHM_ERROR_OUT_OF_MEMORY 

Out of memory

CBHM_ERROR_NOT_SUPPORTED 

Not supported

CBHM_ERROR_INVALID_PARAMETER 

Invalid parameter

CBHM_ERROR_NO_DATA 

No data available

CBHM_ERROR_CONNECTION_REFUSED 

Connection refused

CBHM_ERROR_ADDRES_IN_USE 

Address already in use

Enumeration for Clipboard Data Type.

Since :
3.0
Enumerator:
CBHM_SEL_TYPE_TEXT 

Content is from outside of Elementary

CBHM_SEL_TYPE_MARKUP 

Plain unformatted text: Used for things that don't want rich markup

CBHM_SEL_TYPE_IMAGE 

Edje textblock markup, including inline images

CBHM_SEL_TYPE_HTML 

Images


Function Documentation

int cbhm_close_service ( cbhm_h  cbhm_handle)

Closes clipboard handle.

Since :
3.0
Parameters:
[in]cbhm_handleClipboard handle
Returns:
0 on success, otherwise a negative error value
Return values:
CBHM_ERROR_NONESuccessful
CBHM_ERROR_INVALID_PARAMETERInvalid function parameters
See also:
cbhm_open_service()
int cbhm_hide ( cbhm_h  cbhm_handle)

Hides clipboard.

Since :
3.0
Parameters:
[in]cbhm_handleClipboard handle
Returns:
0 on success, otherwise a negative error value
Return values:
CBHM_ERROR_NONESuccessful
CBHM_ERROR_INVALID_PARAMETERInvalid function parameters
See also:
cbhm_show()
int cbhm_item_count_get ( cbhm_h  cbhm_handle)

Gets the count of clipboard items.

Since :
3.0
Parameters:
[in]cbhm_handleClipboard handle
Returns:
The count of clipboard items
Return values:
CBHM_ERROR_INVALID_PARAMETERInvalid 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_handleClipboard handle
[in]callbackCallback function called when a clipboard item is selected
[in]user_dataUser data to be passed to the given event callback function
Returns:
0 on success, otherwise a negative error value
Return values:
CBHM_ERROR_NONESuccessful
CBHM_ERROR_INVALID_PARAMETERInvalid function parameters
CBHM_ERROR_OUT_OF_MEMORYOut of memory
int cbhm_open_service ( cbhm_h cbhm_handle)

Creates and initializes clipboard handle.

Since :
3.0
Parameters:
[out]cbhm_handleClipboard handle
Returns:
0 on success, otherwise a negative error value
Return values:
CBHM_ERROR_NONESuccessful
CBHM_ERROR_INVALID_PARAMETERInvalid function parameters
CBHM_ERROR_OUT_OF_MEMORYOut 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_handleClipboard handle
[in]typeSelection type
[in]callbackCallback function receiving data from clipboard
[in]user_dataUser data to be passed to the given event callback function
Returns:
0 on success, otherwise a negative error value
Return values:
CBHM_ERROR_NONESuccessful
CBHM_ERROR_INVALID_PARAMETERInvalid function parameters
CBHM_ERROR_NO_DATANo 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_handleClipboard handle
[in]typeSelection type
[in]dataData to be sent
[in]lenThe length of data
Returns:
0 on success, otherwise a negative error value
Return values:
CBHM_ERROR_NONESuccessful
CBHM_ERROR_INVALID_PARAMETERInvalid function parameters
CBHM_ERROR_OUT_OF_MEMORYOut 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_handleClipboard handle
[out]typeSelection type
Returns:
0 on success, otherwise a negative error value
Return values:
CBHM_ERROR_NONESuccessful
CBHM_ERROR_INVALID_PARAMETERInvalid 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_handleClipboard handle
[in]typeSelection type
Returns:
0 on success, otherwise a negative error value
Return values:
CBHM_ERROR_NONESuccessful
CBHM_ERROR_INVALID_PARAMETERInvalid function parameters
See also:
cbhm_selection_type_get()
int cbhm_show ( cbhm_h  cbhm_handle)

Shows clipboard.

Since :
3.0
Parameters:
[in]cbhm_handleClipboard handle
Returns:
0 on success, otherwise a negative error value
Return values:
CBHM_ERROR_NONESuccessful
CBHM_ERROR_INVALID_PARAMETERInvalid function parameters
See also:
cbhm_hide()