gtk.drop_target_async
Module for [DropTargetAsync] class
Types 3
gtk.drop_target_async.DropTargetAsync is an event controller to receive Drag-and-Drop operations, asynchronously.
It is the more complete but also more complex method of handling drop operations compared to gtk.drop_target.DropTarget, and you should only use it if gtk.drop_target.DropTarget doesn't provide all the features you need.
To use a gtk.drop_target_async.DropTargetAsync to receive drops on a widget, you create a gtk.drop_target_async.DropTargetAsync object, configure which data formats and actions you support, connect to its signals, and then attach it to the widget with gtk.widget.Widget.addController.
During a drag operation, the first signal that a gtk.drop_target_async.DropTargetAsync emits is gtk.drop_target_async.DropTargetAsync.accept, which is meant to determine whether the target is a possible drop site for the ongoing drop. The default handler for the ::accept signal accepts the drop if it finds a compatible data format and an action that is supported on both sides.
If it is, and the widget becomes a target, you will receive a gtk.drop_target_async.DropTargetAsync.dragEnter signal, followed by gtk.drop_target_async.DropTargetAsync.dragMotion signals as the pointer moves, optionally a gtk.drop_target_async.DropTargetAsync.drop signal when a drop happens, and finally a gtk.drop_target_async.DropTargetAsync.dragLeave signal when the pointer moves off the widget.
The ::drag-enter and ::drag-motion handler return a gdk.types.DragAction to update the status of the ongoing operation. The ::drop handler should decide if it ultimately accepts the drop and if it does, it should initiate the data transfer and finish the operation by calling gdk.drop.Drop.finish.
Between the ::drag-enter and ::drag-leave signals the widget is a current drop target, and will receive the gtk.types.StateFlags.DropActive state, which can be used by themes to style the widget as a drop target.
DropTargetAsyncGidBuilder builder() static nothrowGet builder for [gtk.drop_target_async.DropTargetAsync] Returns: New builder objectgdk.types.DragAction actions() @property nothrowGet `actions` property. Returns: The `GdkDragActions` that this drop target supports.void actions(gdk.types.DragAction propval) @property nothrowSet `actions` property. Params: propval = The `GdkDragActions` that this drop target supports.gdk.content_formats.ContentFormats formats() @property nothrowGet `formats` property. Returns: The [gdk.content_formats.ContentFormats] that determines the supported data formats.void formats(gdk.content_formats.ContentFormats propval) @property nothrowSet `formats` property. Params: propval = The [gdk.content_formats.ContentFormats] that determines the supported data formats.gdk.types.DragAction getActions() nothrowGets the actions that this drop target supports. Returns: the actions that this drop target supportsgdk.content_formats.ContentFormats getFormats() nothrowGets the data formats that this drop target accepts.void setActions(gdk.types.DragAction actions) nothrowSets the actions that this drop target supports.void setFormats(gdk.content_formats.ContentFormats formats = null) nothrowSets the data formats that this drop target will accept.gulong connectAccept(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.drop.Drop)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.drop_target_async.DropTargetAsync)))
&& Parameters!T.length < 3) nothrowConnect to `Accept` signal.gulong connectDragEnter(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == gdk.types.DragAction)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.drop.Drop)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == double)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == double)))
&& (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] : gtk.drop_target_async.DropTargetAsync)))
&& Parameters!T.length < 5) nothrowConnect to `DragEnter` signal.gulong connectDragLeave(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.drop.Drop)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.drop_target_async.DropTargetAsync)))
&& Parameters!T.length < 3) nothrowConnect to `DragLeave` signal.gulong connectDragMotion(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == gdk.types.DragAction)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.drop.Drop)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == double)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == double)))
&& (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] : gtk.drop_target_async.DropTargetAsync)))
&& Parameters!T.length < 5) nothrowConnect to `DragMotion` signal.gulong connectDrop(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.drop.Drop)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == double)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == double)))
&& (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] : gtk.drop_target_async.DropTargetAsync)))
&& Parameters!T.length < 5) nothrowConnect to `Drop` signal.this(gdk.content_formats.ContentFormats formats, gdk.types.DragAction actions)Creates a new [gtk.drop_target_async.DropTargetAsync] object.Fluent builder implementation template for gtk.drop_target_async.DropTargetAsync
T actions(gdk.types.DragAction propval) nothrowSet `actions` property. Params: propval = The `GdkDragActions` that this drop target supports. Returns: Builder instance for fluent chainingT formats(gdk.content_formats.ContentFormats propval) nothrowSet `formats` property. Params: propval = The [gdk.content_formats.ContentFormats] that determines the supported data formats. Returns: Builder instance for fluent chainingFluent builder for gtk.drop_target_async.DropTargetAsync