elementary: fix some doxygen warnings
[framework/uifw/elementary.git] / src / lib / elm_cnp.h
1 /**
2  * @addtogroup CopyPaste
3  * @{
4  */
5
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);
8
9 typedef enum
10 {
11    ELM_SEL_TYPE_PRIMARY,
12    ELM_SEL_TYPE_SECONDARY,
13    ELM_SEL_TYPE_CLIPBOARD,
14    ELM_SEL_TYPE_XDND,
15
16    ELM_SEL_TYPE_MAX,
17 } Elm_Sel_Type;
18
19 typedef enum
20 {
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,
29    /** Images */
30    ELM_SEL_FORMAT_IMAGE = 0x04,
31    /** Vcards */
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,
35
36    ELM_SEL_FORMAT_MAX
37 } Elm_Sel_Format;
38
39 struct _Elm_Selection_Data
40 {
41    int            x, y;
42    Elm_Sel_Format format;
43    void          *data;
44    size_t         len;
45 };
46
47 /**
48  * @brief Set copy and paste data to a widget.
49  *
50  * XXX: need to be rewritten.
51  * Append the given callback to the list. This functions will be called.
52  *
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.
58  *
59  * @ingroup CopyPaste
60  *
61  */
62 // XXX: EAPI void elm_object_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection,
63 //                                             Elm_Sel_Format format, const void *buf,
64 //                                             size_t buflen);
65 EAPI Eina_Bool elm_cnp_selection_set(Elm_Sel_Type selection, Evas_Object *obj,
66                                      Elm_Sel_Format format, const void *buf,
67                                      size_t buflen);
68
69 /**
70  * @brief Retrieve the copy and paste data from the widget.
71  *
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.
75  *
76  * @see also elm_cnp_selection_set()
77  *
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.
83  *
84  * @ingroup CopyPaste
85  *
86  */
87 // XXX: This api needs to be refined by cnp experts.
88 //      I suggest:
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);
99
100 /**
101  * @brief Clear the copy and paste data in the widget.
102  *
103  * Clear the data in the widget. Normally this function isn't need to call.
104  *
105  * @see also elm_cnp_selection_set()
106  *
107  * @param selection Selection type for copying and pasting
108  * @param obj The source widget pointer
109  * @return If EINA_TRUE, clearing data is success.
110  *
111  * @ingroup CopyPaste
112  *
113  */
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,
117                                        Evas_Object *obj);
118
119 /**
120  * @}
121  */