1 /******************************************************************************* 2 * Copyright (c) 2000, 2003 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 * Port to the D programming language: 11 * Frank Benoit <benoit@tionex.de> 12 *******************************************************************************/ 13 module org.eclipse.swt.dnd.DragSourceListener; 14 15 import java.lang.all; 16 17 import org.eclipse.swt.internal.SWTEventListener; 18 import org.eclipse.swt.dnd.DragSourceEvent; 19 20 /** 21 * The <code>DragSourceListener</code> class provides event notification to the application for DragSource events. 22 * 23 * <p>When the user drops data on a <code>DropTarget</code>, the application which defines the <code>DragSource</code> 24 * must provide the dropped data by implementing <code>dragSetData</code>. In the dragSetData, the application 25 * must support all the data types that were specified in the DragSource#setTransfer method.</p> 26 * 27 * <p>After the drop has completed successfully or has been aborted, the application which defines the 28 * <code>DragSource</code> is required to take the appropriate cleanup action. In the case of a successful 29 * <b>move</b> operation, the application must remove the data that was transferred.</p> 30 * 31 */ 32 public interface DragSourceListener : SWTEventListener { 33 34 /** 35 * The user has begun the actions required to drag the widget. This event gives the application 36 * the chance to decide if a drag should be started. 37 * 38 * <p>The following fields in the DragSourceEvent apply: 39 * <ul> 40 * <li>(in)widget 41 * <li>(in)time 42 * <li>(in,out)doit 43 * </ul></p> 44 * 45 * @param event the information associated with the drag start event 46 * 47 * @see DragSourceEvent 48 */ 49 public void dragStart(DragSourceEvent event); 50 51 /** 52 * The data is required from the drag source. 53 * 54 * <p>The following fields in the DragSourceEvent apply: 55 * <ul> 56 * <li>(in)widget 57 * <li>(in)time 58 * <li>(in)dataType - the type of data requested. 59 * <li>(out)data - the application inserts the actual data here (must match the dataType) 60 * </ul></p> 61 * 62 * @param event the information associated with the drag set data event 63 * 64 * @see DragSourceEvent 65 */ 66 public void dragSetData(DragSourceEvent event); 67 68 /** 69 * The drop has successfully completed(mouse up over a valid target) or has been terminated (such as hitting 70 * the ESC key). Perform cleanup such as removing data from the source side on a successful move operation. 71 * 72 * <p>The following fields in the DragSourceEvent apply: 73 * <ul> 74 * <li>(in)widget 75 * <li>(in)time 76 * <li>(in)doit 77 * <li>(in)detail 78 * </ul></p> 79 * 80 * @param event the information associated with the drag finished event 81 * 82 * @see DragSourceEvent 83 */ 84 public void dragFinished(DragSourceEvent event); 85 }