Merge "gengrid TC modified"
[framework/uifw/elementary.git] / tests / debian / tmp / usr / include / elementary-0 / 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 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,
29    /** Images */
30    ELM_SEL_FORMAT_IMAGE = 0x04,
31    /** Vcards */
32    ELM_SEL_FORMAT_VCARD = 0x08,
33    /** Raw HTMLish 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 a data of a widget to copy and paste.
49  *
50  * Append the given callback to the list. This functions will be called
51  * called.
52  *
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.
58  *
59  * @ingroup CopyPaste
60  *
61  */
62
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);
64
65 /**
66  * @brief Retrive the data from the widget which is set for copying and pasting.
67  *
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.
71  *
72  * @see also elm_cnp_selection_set()
73  *
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.
79  *
80  * @ingroup CopyPaste
81  *
82  */
83
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);
85
86 /**
87  * @brief Clear the data in the widget which is set for copying and pasting.
88  *
89  * Clear the data in the widget. Normally this function isn't need to call.
90  *
91  * @see also elm_cnp_selection_set()
92  *
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.
96  *
97  * @ingroup CopyPaste
98  *
99  */
100
101 EAPI Eina_Bool elm_cnp_selection_clear(Elm_Sel_Type selection, Evas_Object *widget);
102
103 /**
104  * @}
105  */