Tizen Native API  7.0
Ecore_Evas methods to handle selection

These methods perform Copy&Paste and Drag&Drop operations.

Since (EFL) :
1.24

Functions

void ecore_evas_callback_selection_changed_set (Ecore_Evas *ee, Ecore_Evas_Selection_Changed_Cb cb)
 Sets a callback for Ecore_Evas to be called when a selection buffer changes.
Eina_Bool ecore_evas_selection_set (Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, Eina_Content *content)
 Sets the content of the specified selection buffer.
Eina_Bool ecore_evas_selection_exists (Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer)
 Checks if the specified selection buffer has content.
Eina_Futureecore_evas_selection_get (Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, Eina_Iterator *acceptable_types)
 Retrieves the content of the specified selection buffer.
Eina_Bool ecore_evas_drag_start (Ecore_Evas *ee, unsigned int seat, Eina_Content *content, Ecore_Evas *drag_rep, const char *action, Ecore_Evas_Drag_Finished_Cb terminate_cb, Ecore_Evas_Drag_Accepted_Cb accepted_cb, void *data)
 Starts a new drag operation.
Eina_Bool ecore_evas_drag_cancel (Ecore_Evas *ee, unsigned int seat)
 Cancels an ongoing drag operation.
void ecore_evas_callback_drop_state_changed_set (Ecore_Evas *ee, Ecore_Evas_Drag_State_Changed_Cb cb)
 Sets the method (callback) to call when the mouse pointer enters or exits the specified window while performing a drag operation.
void ecore_evas_callback_drop_motion_set (Ecore_Evas *ee, Ecore_Evas_Drag_Motion_Cb cb)
 Sets the method (callback) to call when the mouse pointer moves over the specified window while performing a drag operation.
void ecore_evas_callback_drop_drop_set (Ecore_Evas *ee, Ecore_Evas_Drop_Cb cb)
 Sets the method (callback) to call when the mouse pointer is released over the specified window while performing a drag operation (thus dropping the dragged content over the window).
Eina_Accessorecore_evas_drop_available_types_get (Ecore_Evas *ee, unsigned int seat)
 Retrieves the list of types the data currently being dragged can be automatically converted to.

Typedefs

typedef void(* Ecore_Evas_Selection_Changed_Cb )(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection)
 Callback called when the content of one of the selection buffers changes.
typedef void(* Ecore_Evas_Drag_Finished_Cb )(Ecore_Evas *ee, unsigned int seat, void *data, Eina_Bool accepted)
 This method is called when the mouse pointer enters or exits the specified window while performing a drag operation.
typedef void(* Ecore_Evas_Drag_Accepted_Cb )(Ecore_Evas *ee, unsigned int seat, void *data, Eina_Bool accepted)
 This method is called when the drag object is accepted while performing a drag operation.
typedef void(* Ecore_Evas_Drag_State_Changed_Cb )(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p, Eina_Bool inside)
 This method is called when the mouse pointer enters or exits the specified window while performing a drag operation.
typedef void(* Ecore_Evas_Drag_Motion_Cb )(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p)
 This method is called when the mouse pointer moves over the specified window while performing a drag operation.
typedef void(* Ecore_Evas_Drop_Cb )(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p, const char *action)
 This method is called when the mouse pointer is released over the specified window while performing a drag operation (thus dropping the dragged content over the window).

Typedef Documentation

typedef void(* Ecore_Evas_Drag_Accepted_Cb)(Ecore_Evas *ee, unsigned int seat, void *data, Eina_Bool accepted)

This method is called when the drag object is accepted while performing a drag operation.

Parameters:
[in]eeThe Ecore Evas the drag operation started on.
[in]dataThe Drag and Drop data.
[in]acceptedEINA_TRUE if drag and drop is accepted. EINA_FALSE if drag and drop is not accepted.
typedef void(* Ecore_Evas_Drag_Finished_Cb)(Ecore_Evas *ee, unsigned int seat, void *data, Eina_Bool accepted)

This method is called when the mouse pointer enters or exits the specified window while performing a drag operation.

Parameters:
[in]eeThe Ecore Evas the drag operation started on.
[in]pPosition (in window coordinates) where the event occurred.
[in]insideEINA_TRUE if the pointer just entered this window. EINA_FALSE if it has just exited.

Set this callback using ecore_evas_callback_drop_state_changed_set.

Since (EFL) :
1.24
typedef void(* Ecore_Evas_Drag_Motion_Cb)(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p)

This method is called when the mouse pointer moves over the specified window while performing a drag operation.

Parameters:
[in]eeThe Ecore Evas the drag operation started on.
[in]pPosition (in window coordinates) where the event occurred.

Set this callback using ecore_evas_callback_drop_motion_set.

Since (EFL) :
1.24
typedef void(* Ecore_Evas_Drag_State_Changed_Cb)(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p, Eina_Bool inside)

This method is called when the mouse pointer enters or exits the specified window while performing a drag operation.

Parameters:
[in]eeThe Ecore Evas the drag operation started on.
[in]pPosition (in window coordinates) where the event occurred.
[in]insideEINA_TRUE if the pointer just entered this window. EINA_FALSE if it has just exited.

Set this callback using ecore_evas_callback_drop_state_changed_set.

Since (EFL) :
1.24
typedef void(* Ecore_Evas_Drop_Cb)(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p, const char *action)

This method is called when the mouse pointer is released over the specified window while performing a drag operation (thus dropping the dragged content over the window).

Parameters:
[in]eeThe Ecore Evas the drag operation started on.
[in]pPosition (in window coordinates) where the event occurred.

The dropped data can be retrieved using ecore_evas_selection_get and the ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER buffer.

Set this callback using ecore_evas_callback_drop_drop_set.

Since (EFL) :
1.24
typedef void(* Ecore_Evas_Selection_Changed_Cb)(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection)

Callback called when the content of one of the selection buffers changes.

Parameters:
[in]eeThe Ecore_Evas that handles this selection.
[in]selectionThe selection buffer that has changed.
Since (EFL) :
1.24

Enumeration Type Documentation

Data buffer to use in Copy&Paste (and Drag&Drop) operations.

Since (EFL) :
1.24
Enumerator:
ECORE_EVAS_SELECTION_BUFFER_SELECTION_BUFFER 

Stores selected / highlighted selection

ECORE_EVAS_SELECTION_BUFFER_COPY_AND_PASTE_BUFFER 

Stores copied things (Ctrl + C)

ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER 

Stores dragged things while drag and drop is happening.

ECORE_EVAS_SELECTION_BUFFER_LAST 

Sentinel value. Do not use.


Function Documentation

void ecore_evas_callback_drop_drop_set ( Ecore_Evas *  ee,
Ecore_Evas_Drop_Cb  cb 
)

Sets the method (callback) to call when the mouse pointer is released over the specified window while performing a drag operation (thus dropping the dragged content over the window).

Parameters:
[in]eeThe Ecore Evas the drag operation started on.
[in]cbMethod to call when the events are received.

Only one such callback can exist for each Ecore_Evas. Calling this method multiple times overwrites previous functions. Use a NULL cb func to stop being notified.

Since (EFL) :
1.24

Sets the method (callback) to call when the mouse pointer moves over the specified window while performing a drag operation.

Parameters:
[in]eeThe Ecore Evas the drag operation started on.
[in]cbMethod to call when the events are received.

Only one such callback can exist for each Ecore_Evas. Calling this method multiple times overwrites previous functions. Use a NULL cb func to stop being notified.

Since (EFL) :
1.24

Sets the method (callback) to call when the mouse pointer enters or exits the specified window while performing a drag operation.

Parameters:
[in]eeThe Ecore Evas the drag operation started on.
[in]cbMethod to call when the events are received.

Only one such callback can exist for each Ecore_Evas. Calling this method multiple times overwrites previous functions. Use a NULL cb func to stop being notified.

Since (EFL) :
1.24

Sets a callback for Ecore_Evas to be called when a selection buffer changes.

Parameters:
[in]eeThe Ecore_Evas to set the callback on.
[in]cbThe function to call.

A call to this function will set a callback on an Ecore_Evas, causing func to be called whenever ee selections change. Only one such callback can exist for each Ecore_Evas. Calling this method multiple times overwrites previous functions. Use a NULL func to stop being notified.

Warning:
If and when this function is called depends on the underlying windowing system.
Since (EFL) :
1.24
Eina_Bool ecore_evas_drag_cancel ( Ecore_Evas *  ee,
unsigned int  seat 
)

Cancels an ongoing drag operation.

Parameters:
[in]eeThe Ecore Evas the drag operation started on.
Returns:
EINA_TRUE if the drag operation has been successfully cancelled.

The initiator of a drag operation can call this method to abort it.

Since (EFL) :
1.24
Eina_Bool ecore_evas_drag_start ( Ecore_Evas *  ee,
unsigned int  seat,
Eina_Content *  content,
Ecore_Evas *  drag_rep,
const char *  action,
Ecore_Evas_Drag_Finished_Cb  terminate_cb,
Ecore_Evas_Drag_Accepted_Cb  accepted_cb,
void *  data 
)

Starts a new drag operation.

Parameters:
[in]eeThe Ecore Evas the drag operation started on.
[in]contentThe content to delivery at the drop site (ownership is transferred). The Eina_Content has data and its associated MIME type, plus a list of alternate types that can be provided.
[in]drag_repAn Ecore_Evas used as a visual representation of the content being dragged. It must have the same type as ee. This is the transparent object dragged along the mouse pointer to indicate that a drag operation is in progress. terminate_cb will be called when drag_rep is not needed anymore and it must be disposed of. Use data to convey drag_rep to terminate_cb. For example, if drag_rep is owned by an Efl_Window, data can point to that window.
[in]actionAction the target application should perform upon receiving this content. It is entirely up to the target application to honor (or even understand) this request.
Returns:
EINA_TRUE if the drag operation has been successfully started.

This method must be called when a drag operation is initiated in order to provide the necessary information.

Since (EFL) :
1.24
Eina_Accessor* ecore_evas_drop_available_types_get ( Ecore_Evas *  ee,
unsigned int  seat 
)

Retrieves the list of types the data currently being dragged can be automatically converted to.

Parameters:
[in]eeThe Ecore Evas the drag operation started on.
Returns:

This can be used in any of the drag and drop callbacks (Ecore_Evas_Drag_State_Changed_Cb, Ecore_Evas_Drag_Motion_Cb and Ecore_Evas_Drop_Cb) to check if the data being dragged is acceptable and give the user some early feedback before the data is actually dropped on the window.

This is functionally equivalent to calling ecore_evas_selection_get and examining the available types in the returned Eina_Content, but much faster since the actual data does not have to be asynchronously requested to the initiator application.

Since (EFL) :
1.24
Eina_Bool ecore_evas_selection_exists ( Ecore_Evas *  ee,
unsigned int  seat,
Ecore_Evas_Selection_Buffer  buffer 
)

Checks if the specified selection buffer has content.

Parameters:
[in]eeThe ecore evas to query
[in]bufferWhich selection buffer to ask
Returns:
EINA_TRUE if there is an available selection for the specified buffer.

EINA_TRUE is also returned when the selection is in the window associated with ee

Note:
Due to the asynchronous nature of selection buffers, this method might not return the right result when invoked from the selection callback set with ecore_evas_callback_selection_changed_set.
Since (EFL) :
1.24
Eina_Future* ecore_evas_selection_get ( Ecore_Evas *  ee,
unsigned int  seat,
Ecore_Evas_Selection_Buffer  buffer,
Eina_Iterator acceptable_types 
)

Retrieves the content of the specified selection buffer.

Parameters:
[in]eeThe ecore evas to query.
[in]bufferSelection buffer to retrieve.
[in]acceptable_typesMIME types which are acceptable for the returned Eina_Content. The iterator contains plain strings (char *). Ownership is transferred for the iterator but not for the strings. This is convenient for the usual case of a hard-coded array of strings, since the iterator can be generated on the fly, used and forgotten.
Returns:
An Eina_Future containing an Eina_Content which has one of the types in acceptable_type. An error is delivered when no matching type is found or when the requested selection buffer is empty.

This method is time consuming, therefore, it is recommended to verify the existence of a selection using ecore_evas_selection_exists before calling it.

Since (EFL) :
1.24
Eina_Bool ecore_evas_selection_set ( Ecore_Evas *  ee,
unsigned int  seat,
Ecore_Evas_Selection_Buffer  buffer,
Eina_Content *  content 
)

Sets the content of the specified selection buffer.

Parameters:
[in]eeThe Ecore_Evas to set the selection buffer on.
[in]bufferThe selection buffer to set.
[in]contentContent to set to the selection buffer. The Eina_Content specifies the MIME type of the data. Ownership of the content is transferred.
Note:
Only ECORE_EVAS_SELECTION_BUFFER_SELECTION_BUFFER and ECORE_EVAS_SELECTION_BUFFER_COPY_AND_PASTE_BUFFER buffers can be set. Drag and drop operations use a different set of methods.
Since (EFL) :
1.24