2 * @addtogroup CopyPaste
6 typedef struct _Elm_Selection_Data Elm_Selection_Data;
7 typedef Eina_Bool (*Elm_Drop_Cb)(void *d, Evas_Object *o, Elm_Selection_Data *data);
12 ELM_SEL_TYPE_SECONDARY,
13 ELM_SEL_TYPE_CLIPBOARD,
21 /** Targets: for matching every atom requesting */
22 ELM_SEL_FORMAT_TARGETS = -1,
23 /** they come from outside of elm */
24 ELM_SEL_FORMAT_NONE = 0x0,
25 /** Plain unformated text: Used for things that don't want rich markup */
26 ELM_SEL_FORMAT_TEXT = 0x01,
27 /** Edje textblock markup, including inline images */
28 ELM_SEL_FORMAT_MARKUP = 0x02,
30 ELM_SEL_FORMAT_IMAGE = 0x04,
32 ELM_SEL_FORMAT_VCARD = 0x08,
33 /** Raw HTMLish things for widgets that want that stuff (hello webkit!) */
34 ELM_SEL_FORMAT_HTML = 0x10,
39 struct _Elm_Selection_Data
42 Elm_Sel_Format format;
48 * @brief Set a data of a widget to copy and paste.
50 * Append the given callback to the list. This functions will be called
53 * @param selection selection type for copying and pasting
54 * @param widget The source widget pointer
55 * @param format Type of selection format
56 * @param buf The pointer of data source
57 * @return If EINA_TRUE, setting data is success.
63 EAPI Eina_Bool elm_cnp_selection_set(Elm_Sel_Type selection, Evas_Object *widget, Elm_Sel_Format format, const void *buf, size_t buflen);
66 * @brief Retrive the data from the widget which is set for copying and pasting.
68 * Getting the data from the widget which is set for copying and pasting.
69 * Mainly the widget is elm_entry. If then @p datacb and @p udata are
70 * can be NULL. If not, @p datacb and @p udata are used for retriving data.
72 * @see also elm_cnp_selection_set()
74 * @param selection selection type for copying and pasting
75 * @param widget The source widget pointer
76 * @param datacb The user data callback if the target widget isn't elm_entry
77 * @param udata The user data pointer for @p datacb
78 * @return If EINA_TRUE, getting data is success.
84 EAPI Eina_Bool elm_cnp_selection_get(Elm_Sel_Type selection, Elm_Sel_Format format, Evas_Object *widget, Elm_Drop_Cb datacb, void *udata);
87 * @brief Clear the data in the widget which is set for copying and pasting.
89 * Clear the data in the widget. Normally this function isn't need to call.
91 * @see also elm_cnp_selection_set()
93 * @param selection selection type for copying and pasting
94 * @param widget The source widget pointer
95 * @return If EINA_TRUE, clearing data is success.
101 EAPI Eina_Bool elm_cnp_selection_clear(Elm_Sel_Type selection, Evas_Object *widget);