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 unformatted 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 HTML-like 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 copy and paste data to a widget.
50 * XXX: need to be rewritten.
51 * Append the given callback to the list. This functions will be called.
53 * @param selection Selection type for copying and pasting
54 * @param obj 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.
62 // XXX: EAPI void elm_object_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection,
63 // Elm_Sel_Format format, const void *buf,
65 EAPI Eina_Bool elm_cnp_selection_set(Elm_Sel_Type selection, Evas_Object *obj,
66 Elm_Sel_Format format, const void *buf,
70 * @brief Retrieve the copy and paste data from the widget.
72 * Gets the data from the widget which is set for copying and pasting.
73 * Mainly the widget is elm_entry. If then @p datacb and @p udata can be NULL.
74 * If not, @p datacb and @p udata are used for retrieving data.
76 * @see also elm_cnp_selection_set()
78 * @param selection Selection type for copying and pasting
79 * @param obj The source widget pointer
80 * @param datacb The user data callback if the target widget isn't elm_entry
81 * @param udata The user data pointer for @p datacb
82 * @return If EINA_TRUE, getting data is success.
87 // XXX: This api needs to be refined by cnp experts.
89 // 1. return copy and paste data.
90 // 2. call cnp callback regardless of widget type.
91 // 3. apps insert text data into entry manually.
92 // XXX: EAPI void *elm_object_cnp_selection_get(Evas_Object *obj,
93 // Elm_Sel_Type selection,
94 // Elm_Sel_Format format,
95 // Elm_Cnp_Cb datacb);
96 EAPI Eina_Bool elm_cnp_selection_get(Elm_Sel_Type selection,
97 Elm_Sel_Format format, Evas_Object *obj,
98 Elm_Drop_Cb datacb, void *udata);
101 * @brief Clear the copy and paste data in the widget.
103 * Clear the data in the widget. Normally this function isn't need to call.
105 * @see also elm_cnp_selection_set()
107 * @param selection Selection type for copying and pasting
108 * @param widget The source widget pointer
109 * @return If EINA_TRUE, clearing data is success.
114 // XXX: EAPI void elm_object_cnp_selection_clear(Evas_Object *obj,
115 // Elm_Sel_Type selection);
116 EAPI Eina_Bool elm_cnp_selection_clear(Elm_Sel_Type selection,