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 format Type of selection format
80 * @param obj The source widget pointer
81 * @param datacb The user data callback if the target widget isn't elm_entry
82 * @param udata The user data pointer for @p datacb
83 * @return If EINA_TRUE, getting data is success.
88 // XXX: This api needs to be refined by cnp experts.
90 // 1. return copy and paste data.
91 // 2. call cnp callback regardless of widget type.
92 // 3. apps insert text data into entry manually.
93 // XXX: EAPI void *elm_object_cnp_selection_get(Evas_Object *obj,
94 // Elm_Sel_Type selection,
95 // Elm_Sel_Format format,
96 // Elm_Cnp_Cb datacb);
97 EAPI Eina_Bool elm_cnp_selection_get(Elm_Sel_Type selection,
98 Elm_Sel_Format format, Evas_Object *obj,
99 Elm_Drop_Cb datacb, void *udata);
102 * @brief Clear the copy and paste data in the widget.
104 * Clear the data in the widget. Normally this function isn't need to call.
106 * @see also elm_cnp_selection_set()
108 * @param selection Selection type for copying and pasting
109 * @param obj The source widget pointer
110 * @return If EINA_TRUE, clearing data is success.
115 // XXX: EAPI void elm_object_cnp_selection_clear(Evas_Object *obj,
116 // Elm_Sel_Type selection);
117 EAPI Eina_Bool elm_cnp_selection_clear(Elm_Sel_Type selection,