summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_dnd.eo
blob: 7c903c88cba592e7fbde804eb62be204ab4f5ba4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import efl_ui_dnd_types;

mixin Efl.Ui.Dnd {
   data: null;
   methods {
      drag_start {
         [[Start a drag and drop process at the drag side.
           During dragging, there are three events emitted as belows:
              - EFL_UI_DND_EVENT_DRAG_POS
              - EFL_UI_DND_EVENT_DRAG_ACCEPT
              - EFL_UI_DND_EVENT_DRAG_DONE
         ]]
         params {
            @in format: Efl.Selection_Format; [[The data format]]
            @in data: Eina.Slice; [[The drag data]]
            @in action: Efl.Selection_Action; [[Action when data is transferred]]
            @in icon_func: Efl.Dnd.Drag_Icon_Create; [[Function pointer to create icon]]
            @in seat: uint; [[Specified seat for multiple seats case.]]
         }
      }
      drag_action_set {
         [[Set the action for the drag]]
         params {
            @in action: Efl.Selection_Action; [[Drag action]]
            @in seat: uint; [[Specified seat for multiple seats case.]]
         }
      }
      drag_cancel {
         [[Cancel the on-going drag]]
         params {
            @in seat: uint; [[Specified seat for multiple seats case.]]
         }
      }
      drop_target_add {
         [[Make the current object as drop targert.
           There are four events emitted:
            - EFL_UI_DND_EVENT_DRAG_ENTER
            - EFL_UI_DND_EVENT_DRAG_LEAVE
            - EFL_UI_DND_EVENT_DRAG_POS
            - EFL_UI_DND_EVENT_DRAG_DROP.]]
         params {
            @in format: Efl.Selection_Format; [[Accepted data format]]
            @in seat: uint; [[Specified seat for multiple seats case.]]
         }
      }
      drop_target_del {
         [[Delete the dropable status from object]]
         params {
            @in format: Efl.Selection_Format; [[Accepted data format]]
            @in seat: uint; [[Specified seat for multiple seats case.]]
         }
      }
   }
   events {
      /* FIXME: This is not very future-proof. Better return a struct. */
      drag,accept: ptr(bool); [[accept drag data]]
      drag,done: void; [[drag is done (mouse up)]]
      drag,enter: void; [[called when the drag object enters this object]]
      drag,leave: void; [[called when the drag object leaves this object]]
      drag,pos: Efl.Dnd.Drag_Pos; [[called when the drag object changes drag position]]
      drag,drop: Efl.Selection_Data; [[called when the drag object dropped on this object]]
   }
}